The Axis 1.4 toolkit used operates by listening for SOAP messages on HTTP, and using them - in conjunction with generated parameter structs - to make EJB invocations to the server. To facilitate customization of this behavior, it is possible for the developer to implement a hook which gets called during the process and which has access to the SOAP message. This gives the developer flexibility to do things like perform additional processing of the SOAP message, authenticate with different credentials, specify a locale etc.
By default RPC and DOWS Method Parameters web services use the class curam.util.connectors.webservice.CuramEJBMethodProvider, and DOWS XML document web services use the class curam.util.connectors.webservice.CuramMsgStyleEJBMethodProvider. These classes perform some of the processing on the SOAP message and connect to the application using default credentials. When you specify a custom provider for your RPC or DOWS Method Parameters web service class, you must provide an implementation class which extends one of the above classes.
The following rules apply:
- The name of the custom provider class is specified using the Provider_Name property in Rational Software Architect.
- If a value for this property is specified, you must provide a Java implementation of the class. For example, if you set this property to ' MyProvider ' then you must implement a class named MyProvider which extends the class curam.util.connectors.webservice.CuramEJBMethodProvider or curam.util.connectors.webservice.CuramMsgStyleEJBMethodProvider.
- By overriding methods of this class the developer can gain access to the SOAP message and perform additional processing on it. In most cases the developer should also call the super version of the overridden method to ensure that the underlying Axis 1.4 web service framework continues to work as normal.
- Your provider class implementation must be in a package named webservice.
- If you specify a custom provider class for a web service class, the web service no longer automatically connects using the default credentials. Therefore your provider must provide the credentials. Typically these will be obtained from the SOAP message.
- Since the custom provider implementation resides in a different EAR file to the application, its Java source must reside in a separate location to the other Java source files, e.g. EJBServer/components/core/source/webservice/MyProvider.java
- Since the Ear file for web services can be deployed into a dedicated web services server it may not have access to the same services as the main application, such as a database, JMS, etc. However it does have access to the same infrastructure classes such as curam.util.type.DateTime, etc.
- The locale for the web service call can be set by setting the locale property in the MessageContext object for the call. If this property is not set, the locale defaults to that of the user under whose credentials the call is made.