Sun Java System Web Server 7.0 Update 4 Developer's Guide to Java Web Applications

Testing Web Services

To test Web Services you invoke a web service endpoint deployed on a web service client. A web service client is a Java program that makes a request to the service through a stub that acts as a proxy for the remote service. This stub is generated by the wsimport tool based on the WSDL file of the service.

ProcedureTo Invoke a Web Service Client

  1. WSDL of the deployed web service from URL http://host:port/context-root/endpoint?wsdl

  2. Call wsimport to generate the client-side artifacts using the deployed Web Services's WSDL.

  3. Implement the client to invoke the web service.

    Clients can run a deployed web service by accessing its service-endpoint-address URL, which has the following format:


    The context-root is defined in the web.xml file. The servlet-mapping-url-pattern is defined in the web.xml file.

    In the following example, the context-root is my-ws and the servlet-mapping-url-pattern is /simple. You can view the WSDL file of the deployed service in a browser by adding ?WSDL to the end of the URL, for example,