You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Thilo Frotscher <th...@web.de> on 2004/01/08 15:15:34 UTC
Re: Bug? SimpleProvider not usable - Please clarify
Will this bug be fixed in Axis 1.2?
Thanks,
Thilo
Thilo Frotscher wrote:
>
> Glen,
>
> thank you for your help! But it still does not work...and I
> think this is an important bug,
>
> 1) You are right, SOAPService can be used on the client as well.
> I found out how. But: if you create a SimpleProvider and add a
> SOAPService using the method deployService, the handlers for this
> service will never be initialized! Try this code:
>
> // get default configuration
> EngineConfigurationFactory f =
> EngineConfigurationFactoryDefault.newFactory(null);
> EngineConfiguration defaultConfig = f.getClientEngineConfig();
> SimpleProvider myConfig = new SimpleProvider(defaultConfig);
>
> ClientSecurityHandler myHandler = new ClientSecurityHandler();
>
> Chain myRequestChain = new SimpleChain();
> myRequestChain.addHandler(myHandler);
> SOAPService s = new SOAPService(myRequestChain, null, null);
> myConfig.deployService("XYZ", s);
>
> The init-method of myHandler will never be called unless you
> explicity call it in the client application. But I don't think,
> that this is intended, is it?
>
> BTW: methods like setResponseHandler, setRequestHandler would be
> nice for SOAPService. Currently these can be set via the constructor
> only.
>
>
>
> 2) Still doesn't work because of the bug in FileProvider I reported
> in my other email from 2003-12-27, please see
>
> http://marc.theaimsgroup.com/?l=axis-dev&m=107253815025532&w=2
>
> Before one can use the method you added (setGlobalRequest), one should
> test if there is a global chain already to avoid overwriting it. But
> calling getGlobalRequest causes a NullPointerException in FileProvider, as
> described in the email from 12-27.
>
> Example code:
>
> EngineConfigurationFactory f =
> EngineConfigurationFactoryDefault.newFactory(null);
> EngineConfiguration defaultConfig = f.getClientEngineConfig();
> SimpleProvider myConfig = new SimpleProvider(defaultConfig);
>
> ClientSecurityHandler myHandler = new ClientSecurityHandler();
> myHandler.init();
>
> Chain globalReqChain = (Chain) myConfig.getGlobalRequest();
> globalReqChain.addHandler(myHandler);
>
>
> Generally, I think in all classes like SimpleProvider, FileProvider,
> SOAPService etc. methods like getGlobalRequest, getXXXChain etc.
> should either
> a) not return null but an empty chain if nothing is configured
> b) OR have setXXX methods to set a handler or chain
>
>
> Thanks + happy new year!!
> Thilo
>
>
>