Java Reference
In-Depth Information
▪ How to create a complete SOAP message for a response
▪ How to add a complete element to a SOAP header
Here you've used a message mode to ensure that you can access the entire SOAP envelope.
The WSDL is packaged with the WAR, and the other properties of the annotation indicate the
service and port that this provider will respond to requests for.
So you can build and deploy this now, and start listening for requests. Your deployment mes-
sage will indicate that your provider class is available at the specified address if all goes well:
DPL5306:Servlet Web Service Endpoint [com.soacookbook.ch04.MyProvider]
listening at address [http://localhost:8080/soaCookbookWS/
GatewayService]
Glassfish provides a web page representing your service that allows you to view the service
name, port name, and implementing class, as shown in Figure 7-1 .
Figure7-1.Glassfish service list page
At this point, a provider instance will have been created, and you can send it a SOAP request
to test it.
Testing the provider
In this section, you'll create a JUnit test to send requests to your provider. You can create the
JUnit 4.4 class shown in Example 7-12 to execute two tests. This class will test the single
Search WWH ::




Custom Search