Time for action – SOAPProxy security pass through

Let us now proxy the secured web service using SOAPProxy passing in the authentication credentials from a properties file:

  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.proxy.SOAPProxy"
            name="proxy-action">
      <property name="wsdl" value="internal://jboss.ws:context=BookService,endpoint=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 "/>
      <property name="file" value="/http.properties"/>
      <property name="clientCredentialsRequired" value="false"/>
    </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 shown:

    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 a BASIC secured web service. We used a JMS queue to send a SOAP message. We passed the security credentials from an HttpClient properties file.

Have a go hero – security pass through

Look at the contents http.properties file. Modify the clientCredentialsRequired property to true and see what is displayed on the server Console. Execute the webservice_proxy_security quickstarts to see how SSL and BASIC are both configured together.

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

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