Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2005

Tip: Looking for answers? Try searching our database.

Axis 1.2/1.3 interop .NET-CookieContainer problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
VEJIKYUULYCY@spammotel.com - 05 Dec 2005 13:51 GMT
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
DC - 13 Dec 2005 00:13 GMT
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

Signature

-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

> Hi all,
>
[quoted text clipped - 28 lines]
> Thanks a lot,
> -- Carsten
VEJIKYUULYCY@spammotel.com - 21 Dec 2005 12:00 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.