Java Reference
In-Depth Information
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="CreditService">
<port name="CreditAuthorizerPort"
binding="tns:CreditAuthorizerPortBinding">
<soap:address
location="http://localhost:8080/soaCookbookWS/CreditService" />
</port>
</service>
</definitions>
The service implementation class will refer directly to this WSDL file, which will be packaged
alongside the service implementation in the WEB-INF/wsdlfolder at build time. Also notice
that your schema is defined as Credit.xsdbecause it is deployed to the same directory as the
WSDL in the WAR.
This WSDL specifies document/literal style and use and the parameter style is bare, just so
you understand how your service will be invoked. Your web service will make this relation-
ship explicit.
NOTE
Remember that if you use the mechanism within Glassfish that automatically generates a WSDL for
you, it will redefine your schema and lose the constraints. That's why you package the schemas with
the application instead of letting Glassfish write them for you, which would be more expedient.
Service implementation
The implementation of the web service is a simple class. Despite the fact that it will be avail-
able as a servlet within the container, you don't have to actually implement the HttpServlet
interface. You can just define a regular class and package it in a WAR. You don't need to write
anything into web.xmleither.
Search WWH ::




Custom Search