Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Create a Dynamic Web Project
    • Select File->New->Project (or Ctrl+N)

    • In the popup window, select Web->Dynamic Web Project category (or type dynamic in Wizards' input field so it's left alone) and click Next

      Image Added

    • Type jaxws-saaj-converterclient as the Project Name and click Next twice.

      Image Added

    • Modify the Group Id to org.apache.geronimo.samples.jaxws.saaj and the Artifact Id to jaxws-saaj-converterclient.

      Image Added

    • Click Finish

Adding code to send and receive SOAP messages

  • Right Click the jaxws-saaj-converterclient, and Select New->JSP

  • Name the jsp as index.jsp and click Finish

    Image Added

  • Add the following code to the index.jsp

...

  • Right click again and add a Servlet named ConverterHandler

    Image Added

  • Add the following code to ConverterHandler.java

...

  • Right click on the Apache Geronimo Server Runtime present in the servers view and select Add and Remove Projects

  • Add jaxws-saaj-converterclient to configured projects list and then click Finish

    Image Added

  • Wait for some time till the server status changes to Synchronized

...

  • Right click the index.jsp present under WebContent directory of our project and select Run As->Run On Server

  • In the popup, check the check box Always use this server when running the project and then click Finish

  • Now Eclipse will try to open the jsp in a web browser which shows you a form to enter amount in Dollars.

  • Enter any amount and press submit, the jsp should display the result that is returned by the web service.

    Image Added

This completes our development and deployment of a basic SAAJ client that works at XML level by sending SOAP request messages to the deployed Web Service.