The SOAP server in the store listens for incoming SOAP messages and routes them to a particular destination. The server (sometimes referred to as a SOAP router) is really a Java Servlet that routes messages to a particular SOAP service.

First, we created a Nucleus component to act as the SOAP server: /atg/projects/b2bstore/soap/RPCRouterServlet. The properties file for this component looks like:

$class=atg.server.soap.DynamoRPCRouterServlet
$scope=global
serviceManager=ServiceManager
RPCRouter=RPCRouter

The RPCRouterServlet component requires a configured ServiceManager and an RPCRouter component.

The ServiceManager component maintains a list of all the exposed services that are available to a particular SOAPRouter. The single service that gets registered with this ServiceManager is the DOMWriterService, which is documented in the next section.

This is the properties file for /atg/projects/b2bstore/soap/ServiceManager:

$class=atg.apache.soap.server.ServiceManager
$scope=global
deployedServicesFile={atg.dynamo.server.home}/data/motorprise/
D6DeployedServices.ds

We created an RPCRouter component, located at /atg/projects/b2bstore/soap/RPCRouter, that is specific to Motorprise. The RPCRouter component routes a particular RPC request to a particular service. This component can handle incoming SOAP RPC requests independent of the method of the request’s transport, such as HTTP or e-mail.

The RPCRouterServlet receives a request over HTTP, extracts out the SOAP message, and then forwards it to the RPCRouter component. The RPCRouter component then examines the SOAP message and determines for which service the message is designated.

Finally, we needed to ensure that messages sent to a particular URL would be routed to the RPCRouterServlet. We wanted HTTP requests that are sent to /Dynamo/solutions/B2BStore/soap (as defined in the SOAP client) to be automatically forwarded to RPCRouterServlet. We used the dispatcherServiceMap property of the /atg/dynamo/Configuration component to forward these requests by adding a Configuration.properties file at <ATG9dir>/Motorprise/config/atg/dynamo/ with the following contents:

dispatcherServiceMap+=\
     /Dynamo/solutions/B2BStore/soap=/atg/projects/b2bstore/soap/
       RPCRouterServlet

Thus, when a SOAP client sends messages to a location of /Dynamo/solutions/B2BStore/soap, the messages are forwarded to the SOAP server.

 
loading table of contents...