Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Axis 1.2/1.3 interop .NET-CookieContainer problem.

Reply
Thread Tools

Axis 1.2/1.3 interop .NET-CookieContainer problem.

 
 
VEJIKYUULYCY@spammotel.com
Guest
Posts: n/a
 
      12-05-2005
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

 
Reply With Quote
 
 
 
 
DC
Guest
Posts: n/a
 
      12-13-2005
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

--
-Dino
D i n o . C h i e s a AT M i c r o s o f t . c o m

[1] http://www.pocketsoap.com/tcptrace/pt.aspx

<> wrote in message
news: ups.com...
> 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
>



 
Reply With Quote
 
 
 
 
VEJIKYUULYCY@spammotel.com
Guest
Posts: n/a
 
      12-21-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Axis question: what is the correct way to use Axis? ed Java 2 12-08-2006 07:31 PM
Calling a Web Service using Axis, from within an Axis Web Service running under Tomcat hocho888 Java 1 04-29-2005 08:26 PM
AXIS jars org.apache.axis.wsi.* and org.apache.axis.transport.jms.* unkwb@web.de Java 0 02-23-2005 04:02 PM
Axis 1.1 don't delete attachments in the axis attachment cache Stefan Java 0 05-06-2004 08:00 PM
axis.jar does not contain org.apache.axis.client.ServiceClient? Joey Vendetta Java 0 04-01-2004 05:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57