The deployscope attribute listed in your build.xml file is used for the
server side build. It causes the scope attribute to be generated in the
deploy.xml file as defined (application, session, request).
Once the client stubs have been generated, code the client as previously
suggested:
KodoLocator locator = new KodoLocator();
KodoServicePortType kodoDs = locator.getKodoServicePort(url);
( (Stub) kodoDs).setMaintainSession(true);
Raul Flores
-----Original Message-----
From: Peter Bosmans [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 17, 2005 4:45 AM
To: [email protected]
Subject: Re: Session not set in generated code
Tom,
Thanks for the reply.
If tested your suggestion, but i get a null pointer exception in
someStub._getCall().setMaintainSession(true); // enable sessions
At that point the _call variable is not instantiated, this variable will
be instantiated when i call one of my service method's. (so, that to
late)
But when i look into the generated code 'SomeSoapBindingStub', i found
in the method 'createCall()' the next entry :
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
Is there a way to set the maintainSessionSet in the super method (maybe
via a config-file or an other way)
Kind regards,
Peter
Tom Ziemer schreef:
> Hi Peter,
>
> you could try the following in your client:
>
> SomeServiceLocator someLocator = new SomeServiceLocator(); // ant
> generated SomeSoapBindingStub someStub = null; // ant generated try {
> someStub = SomeSoapBindingStub someLocator.getSomeService(); //
> get the service
> someStub._getCall().setMaintainSession(true); // enable sessions
> someStub.someMethod(); // call one of your service's methods ...
> }
> ...
>
> Hope this helps,
> Regards,
> Tom
>
>
> Peter Bosmans wrote:
>
>> Hi,
>>
>> In my build.xml file, to generate client-side java code, i specify
>> that the client must work in a session scope.
>>
>> <target name="wsdl2java_client">
>> <echo message="Running WSDL2Java Client Emitters"/>
>>
>> <!-- NdsAdmin WSDL to Java for server -->
>> <axis-wsdl2java url="src/NdsAdmin.wsdl"
>> output="${project.home.client}/src"
>> deployscope="session"
>> serverSide="no"
>> skeletonDeploy="no"
>> noimports="no"
>> verbose="no"
>> testcase="no">
>> </axis-wsdl2java>
>> </target>
>>
>> When i run the client, it will not work in session scope.
>> Therefore i must add the following line in the generated Service
source.
>> _call.setMaintainSession(true);
>>
>> But i don't want to add or change stuff in generated code.
>> Is there an other way to set the maintainsession ?
>>
>> Peter
>
>