You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Paul Reed <pr...@us.ibm.com> on 2001/04/04 16:31:57 UTC

Problem using a home grown Provider

Using SOAP 2.1 I'm trying to write my own Provider which extends
RPCJavaProvider and will be used rather than the standard Java/Script
provider.

>From walking through the source it looks like some of the code, handles
custom providers, and some doesn't. Specifically RPCRouterServlet line 250
correctly looks at DeploymentDescriptor.getProviderType() and instantiates
my provider rather than the default ones. However,
ServerHTTPUtils.getTargetObject() line 182 does not -- it assumes the
script provider, if you didn't ask for the Java provider. Since my provider
calls RPCJavaProvider.locate() which uses ServerHTTPUtils.getTargetObject()
things don't work.

As a work around I have to set DeploymentDescriptor.getProviderType() to
DeploymentDescriptor.PROVIDER_JAVA as follows:

public class MyProvider extends RPCJavaProvider {
     public void locate(DeploymentDescriptor dd, Envelope env,
                          Call call, String methodName,
               String targetObjectURI, SOAPContext reqContext)
               throws SOAPException {
          // snip

          // HACK!
          dd.setProviderType(DeploymentDescriptor.PROVIDER_JAVA);

          super.locate(dd, env, call, methodName, targetObjectURI,
reqContext);
          // Should we setProviderType() back after calling locate()?

          // snip
     }
}

First, is defining your own provider a valid and correct thing to do? Has
anyone else done this and seen these problems? Second is this a bug in
ServerHTTPUtils or am I missing something? Third is this a valid work
around?

Regards, Paul
IBM Internet Technology Team | preed@us.ibm.com