Time for action – incorporating SOAPProxy into the application

We will now modify the current example to use SOAPProxy:

  1. In JBoss Developer Studio, open the esbcontent/META-INF/jboss-esb.xml file in Source mode.
  2. Replace the following code:
    <action class="org.jboss.soa.esb.actions.soap.SOAPProcessor"
            name="JBossWSAdapter">
      <property name="jbossws-endpoint" value="BookService"/>
      <property name="jbossws-context" value="BookService"/>
    </action>

    With this code:

    <action class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy"
            name="proxy-action">
      <property name="wsdl" value="internal://jboss.ws:context=BookService,endpoint=BookService"/>
    </action>
  3. Click the Save button and the modified application should now be deployed in the server.
  4. Select the src folder, expand it till the SendJMSMessage.java file is displayed in the tree. Now click Run | Run As | Java Application.

    The server Console will display the output as below:

    INFO  [STDOUT] AFTER invoking jbossws endpoint:
    INFO  [STDOUT] [<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:getBooksResponse xmlns:ns2="http://chapter8.samples.esb.soa.jboss.org/"><return>Great Expectations</return><return>Hound Of The Baskervilles</return><return>The Da Vinci Code</return><return>The Immortals Of Meluha</return></ns2:getBooksResponse></env:Body></env:Envelope>].
    

What just happened?

We used SOAPProxy to invoke the web service. We used a JMS Queue to send a SOAP message.

Have a go hero – advanced use cases for SOAPProxy

Have a look at webservice_proxy_routed and webservice_proxy_versioning quickstarts to see how those are configured and work.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset