This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • SAAJ Messaging Web Services

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

This article takes you through the some of basic concepts involved in SAAJ Messaging. The goal of this tutorial is to give a brief overview about the terminology involved with SOAP (or SAAJ) messages.

...

  • Let us have a brief look at the code that we added in ConverterHandler.java
    • createSOAPMessage() - Here we will create a new SOAP message from MessageFactory instance and set the SOAP body of message according to the request and format needed by WSDL file.
      SOAP request message that is returned by createSOAPMessage for operation ("dollarToRupees") and argument ("23") looks like this: SOAP Request Message <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:dollarToRupees xmlns:ns1="urn:http://jaxws.samples.geronimo.apache.org"> <arg0>23</arg0> </ns1:dollarToRupees> </soapenv:Body> </soapenv:Envelope>
    • returnResult() - This function processes the SOAP response message sent by the Web service and returns the result. This function uses call method over a SOAP Connection to send the request and receive the response.
      SOAP response message that is returned by Web Service for the above SOAP Request message looks like this: SOAP Response Message <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <dlwmin:dollarToRupeesResponse xmlns:dlwmin="http://jaxws.samples.geronimo.apache.org"> <axis2ns1:return>933.34</axis2ns1:return> </dlwmin:dollarToRupeesResponse> </soapenv:Body> </soapenv:Envelope>
    • Here the SOAP Response is parsed by using the functions present in SAAJ API. Also observe that call is a blocking call which means that it will continue waiting until it receives a response.

...