Wednesday, March 7, 2012

ATG WSDL Document


Web Services Description Language (WSDL) is an XML language for describing Web services in a platform-independent way. A WSDL document describes a Web service’s methods by specifying the locations of the resources they use and defining the methods’ inputs and outputs. (A WSDL document for a Web service generated by the ATG platform always describes one method, because each Web service can expose only one Nucleus method.)

There must be a separate WSDL document for each Web service. The WSDL document is generated by the /atg/webservice/WSDLGenerator component, which is of class atg.webservice.WSDLGeneratorImpl. This document is used for two key purposes:

It is used by the JAX-RPC API to generate runtime classes.

At runtime, it is used by Web service clients to look up the semantics of the SOAP messages to send to invoke the service.

When the Web service’s input and output values are primitive types, they are defined in the primary WSDL document. For example:

<message name="getOrderStatusInput">
 <part name="in0" type="xsd:string">
</message>

Each non-primitive input or output requires its own WSDL document that is imported by the primary WSDL document. Import statements similar to the following are included in the primary WSDL document when the Web service is created using the Dynamo Administration UI:

<import location="atg.commerce.order.status.wsdl"
 namespace="http://www.atg.com/atg.commerce.order.status"/>

The location specified is relative to the primary WSDL document. Some Web service clients are able to interpret relative locations, but others require fully qualified URLs. To work with these clients, when the ATG platform receives a request for a WSDL document, it uses the servlet class atg.webservice.WSDLFinderServlet and the filter class atg.webservice.WSDLImportFilter to translate the location value into a fully qualified URL:

At runtime, JAXRPCServlet updates the SOAP address in the WSDL document to include the domain host name and port number.

When WSDLFinderServlet detects a WSDL request, WSDLImportFilter appends the domain name and port number (from the SOAP address provided by JAXRPCServlet) and the context path (by calling request.getContextPath() on the Dynamo request) to the location value in the import statement. The resulting import statement looks similar to this:

<import location=
 "http://myhost:7881/catalog/atg.commerce.order.status.wsdl"
 namespace="http://www.atg.com/atg.commerce.order.status"/>

The WSDLFinderServlet and WSDLImportFilter classes are declared in the web.xml file for the Web application that the Web service is a part of, as discussed in the next section. For more information about request handling, see the ATG Programming Guide.

No comments:

Popular Posts