You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ma...@wellsfargo.com on 2008/04/16 20:55:16 UTC

Generated Stub code design issue

Using WSDL2Java, I'm looking for a way to update the
ConfigurationContext without touching the generated Stub.

One promising method in the stub is the intantiation method that takes a
ConfigurationContext as a parameter. There's an issue with this though.
See below:


    /**
     * Constructor that takes in a configContext  and useseperate
listner
     */
    public MyStub(
        org.apache.axis2.context.ConfigurationContext
configurationContext,
        java.lang.String targetEndpoint, boolean useSeparateListener)
        throws org.apache.axis2.AxisFault {
        //To populate AxisService
        populateAxisService();
        populateFaults();

        _serviceClient = new
org.apache.axis2.client.ServiceClient(configurationContext,
                _service);

        configurationContext = _serviceClient.getServiceContext()
// **  Issue
                                             .getConfigurationContext();
// **

        _serviceClient.getOptions()
                      .setTo(new
org.apache.axis2.addressing.EndpointReference(
                targetEndpoint));
 
_serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
    }


As you can see, the passed-in context is overwritten when I would have
hoped it would become a reference in the context to be used by the
service. There is, AFAIK, no other way to get a reference to the context
other than by modifying the Stub code, which I'd dearly like to avoid.
This feels like an oportunity to tweak the stub generation and/or
ConfigurationContext class... but in the mean time would anyone else
have an idea of how to access the ConfigurationContext without touching
the generated code?

Thanks in advance,

Martin