Sidebar

where to pass xml message in WSDL while hitting soap based web service channel?

0 votes
925 views
asked Apr 2, 2019 by (330 points)
edited Apr 2, 2019 by brandon-w-8204

I am trying to create a channel to listen xml message over soap based channel.

source node of my channel :-

i want to listen xml message on this source node and then that message i m trying to store in some location.

so while hitting this webservice i am using below wsdl provided by qvera

where to pass my xml message in to it and then how to save my recieved xml message in to a file location?

Do I need to add some mapping function?

1 Answer

0 votes

Change your source message to an HTTP listener. Then when you call the endpoint just pass your xml however you want that structured as the content of the call. The source will look similar to this:

<Request>
<Content-Type><![CDATA[multipart/related; type="application/xop+xml"; boundary="uuid:e009f542-d68a-41d0-ae88-c8d543586af9"; start="<root.message@cxf.apache.org>"; start-info="application/soap+xml"; action="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b"]]></Content-Type>
<Method>POST</Method>
<RequestURI>/xdrRecipient</RequestURI>
<RemoteUser>null</RemoteUser>
<RemoteAddress>127.0.0.1</RemoteAddress>
<RemoteHost>127.0.0.1</RemoteHost>
<RemotePort>52545</RemotePort>
<ForwardedFor>207.150.207.139</ForwardedFor>
<Part>
<content-type><![CDATA[application/xop+xml; charset=UTF-8; type="application/soap+xml"; action="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b";]]></content-type>
<content-transfer-encoding><![CDATA[binary]]></content-transfer-encoding>
<content-id><![CDATA[<root.message@cxf.apache.org>]]></content-id>
<Content>Your content will be here base64 encoded</Content>
</Part>
</Request>

You can use the following code to set your message to the xml you sent. The HTTP listener puts all the data about the http call into a XML structure which is why your source message looks like it does

try {
   if ('binary' === message.getNode('/Request/Part[1]/content-transfer-encoding') + '') {
      var tempMessage = base64DecodeXML(source.getNode('/Request/Part[1]/Content').trim(), null);
      qie.debug("tempMessage = " + tempMessage);
      message = qie.createXMLMessage(tempMessage);
      message.removeAllNamespaces();
      message.formatXML(3);
   } else {
      message = qie.createXMLMessage(source.getNode('/Request/Part[1]/Content').trim());
      message.removeAllNamespaces();
      message.formatXML(3);
   }
} catch (err) {
   qie.warn('Unable to parse content in source: ' + err);
   message.discard();
}

answered Apr 2, 2019 by brandon-w-8204 (33,270 points)
edited Apr 2, 2019 by brandon-w-8204
commented Apr 2, 2019 by (330 points)
Yes.. i understand http protocol but i want to configure my source node as soap based web-service only and with that i want to listen xml or json data.so is it possible? if it is then how ?
commented Apr 2, 2019 by brandon-w-8204 (33,270 points)
The HTTP listener will accept JSON or XML. It also accepts soap based webservice calls. Qvera forces the format to XML so that all the data about the HTTP call can be seen and used. Examples are the url, source IP, etc. The content you send will all be put in the content tag in the source message.

Here is a KB explain this further:
https://www.qvera.com/kb/index.php/1531/why-does-source-http-receiver-force-the-format-to-xml?show=1531#q1531
...