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 ai...@gmx.de on 2005/11/04 21:47:11 UTC
Passing options to transport sender
Hi,
When I create a call I like to pass options to my transport sender.
For that I use the following code:
SimpleTargetedChain c = new SimpleTargetedChain(new MySender());
config.deployTransport("myTransport ", c);
c.setOption("Hello", "HelloAgain"); // Set option
But when I read the set option within the transport sender I just receive a
Nullpointer exception.
How do I can pass options to a given transport sender??
Thx,
Chris
// Complete method to create a call on client side
public static Call createCall(ClientContext cContext)
throws ServiceException
{
Call.addTransportPackage("org.my.axis.transport");
Call.setTransportForProtocol("myTransport", MyTransport.class);
EngineConfiguration defaultConfig =
EngineConfigurationFactoryFinder
.newFactory().getClientEngineConfig();
SimpleProvider config = new SimpleProvider(defaultConfig);
SimpleTargetedChain c = new SimpleTargetedChain(new MySender());
// THIS DOESN'T WORK!!!
if (cContext != null)
c.setOption(Constants.CLIENT_CONTEXT, cContext);
config.deployTransport("myTransport ", c);
Service service = new Service(config);
Call call = (Call) service.createCall();
call.setTransport(new MyTransport());
return call;
}