Axis 1.2/1.3 interop .NET-CookieContainer problem.

V

VEJIKYUULYCY

Hi all,

I'm trying to get a .Net client (C# console app) maintain
a session with a Java-based web service (Axis), but it doesn't seem
to work. (Of course, a Java client to the same service works fine)

My C# code looks like this:
TestSvcService ts = new TestSvcService();
ts.CookieContainer = new CookieContainer();
ts.doThis();
ts.doThat();
...

Each call to the service results in a fresh, empty session,
instead of maintaining the initial one.

I'm watching the message exchange with a TCP monitor, and the
only clue I can come up with is that .Net expects a different
cookie name from the one set by the Java server; the initial
HTTP response contains the following set-cookie instruction:
Set-Cookie: jsessionid=3029091017259021561;path=/

But in the next request, .Net doesn't send any cookie at all.

I searched the whole web and google and found that this problem is
described a few times without any idea how to solve it. So is someone
already fixed it, please send a reply!

Thanks a lot,
-- Carsten
 
D

DC

I just tried this and it works for me, as advertised.

used on server side:
AXIS 1.3
Sun JDK 1.5

used on client side:
..NET SDK 1.1

If you follow the guidance of designing your service "WSDL First", then you
run WSDL2Java to build your AXIS-based service. On the WSDL2Java command
line you need to specify "--deployScope Session" in order to generate the
proper instructions in the deploy.wsdd file. Did you do that?

If you are not following the "WSDL First" guidance, then do you have an
element like this:
<parameter name="scope" value="Session"/>

in the deploy.wsdd, for the service in question?

One way to troubleshoot this is to insert an http proxy in between the
client and server. you can do this with a tool like proxytrace[1], for
example. then on the instance of the ws proxy class in the client (your
TestSvcService), you set the Proxy property:

#if USE_PROXY
System.Net.IWebProxy proxyObject = new
System.Net.WebProxy("http://localhost:3128",false); // true == bypass proxy
for local addresses
ts.Proxy= proxyObject;
#endif

If you want to see the traffic show up in the proxytrace tool, be sure that
the Url property on your ws proxy is set to use a non-loopback ip address.
Maybe you checked this?

How are you verifying that the .NET client is not sending the cookie?

-Dino
 
V

VEJIKYUULYCY

Hi.

Thank you for the answer.

I tried and tried and did not get it to work. But then I switched to
the RPC-provider and then the cookie magically worked.

So the problem seems to be caused by the provider="java:EJB". If I use
a standard java bean with the rpc provider="java:RPC", the problem
disappears....

Best regards
Carsten
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top