lib/isbm_adaptor/consumer_request.rb
def post_request(session_id, content, topic, expiry = nil)
      validate_presence_of session_id, 'Session Id'
      validate_presence_of content, 'Content'
      validate_presence_of topic, 'Topic'
      validate_xml content

      # Use Builder to generate XML body as we need to concatenate XML message content
      xml = Builder::XmlMarkup.new
      xml.isbm :SessionID, session_id
      xml.isbm :MessageContent do
        xml << content
      end
      xml.isbm :Topic, topic
      duration = expiry.to_s
      xml.isbm :Expiry, duration unless duration.nil?

      response = @client.call(:post_request, message: xml.target!)

      response.to_hash[:post_request_response][:message_id].to_s
    end
def post_request(session_id, content, topic, expiry = nil)
      validate_presence_of session_id, 'Session Id'
      validate_presence_of content, 'Content'
      validate_presence_of topic, 'Topic'
      validate_xml content

      # Use Builder to generate XML body as we need to concatenate XML message content
      xml = Builder::XmlMarkup.new
      xml.isbm :SessionID, session_id
      xml.isbm :MessageContent do
        xml << content
      end
      xml.isbm :Topic, topic
      duration = expiry.to_s
      xml.isbm :Expiry, duration unless duration.nil?

      response = @client.call(:post_request, message: xml.target!)

      response.to_hash[:post_request_response][:message_id].to_s
    end
Posts a request message on a channel.

 @param session_id [String] the session id
 @param content [String] a valid XML string as message contents
 @param topic [String] the topic
 @param expiry [Duration] when the message should expire
 @return [String] the request message id
 @raise [ArgumentError] if session_id, content or topics are blank, or
   content is not valid XML