axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Frotscher <thilo.frotsc...@web.de>
Subject RE: Bug? SimpleProvider not usable - Please clarify
Date Wed, 31 Dec 2003 02:36:51 GMT

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




Mime
View raw message