Java Tutorial - Java Scipt : Integration and Testing

Java Tutorial - Java Scipt :

Integration and Testing


Now that Axis is up and running, let’s test Web services. Axis comes with several sample services that are available by default. To reach a Web service, you need to know the SOAP endpoint at which that the service is available; this SOAP endpoint is in the form of a standard URL. In the official specifications, SOAP calls should be sent via HTTP POST. To make things easier to debug, Axis also allows HTTP GET requests. With a HTTP GET request, we can encode some SOAP parameters in the query string of the URL, which is everything from the question mark on.

Let’s try calling one of the default Axis Web services. We’ll retrieve the Axis version information by calling the getVersion method in the Version Web service. The URL to access that is:

http://localhost:8080/axis/services/Version?method=getVersion

 Don’t worry if you encounter a message stating, “Problem with servlet engine config file: /WEB-INF/server-config.wsdd.” This configuration file is automatically created as soon as a Web service is deployed.

You should see something similar to Figure 11.4.

Figure 11.4  Results from calling getVersion.

Now that we know Web services are working, let’s move on to the interesting stuff: writing and deploying our own Web services.