Home > Archive > Java Beans > December 2004 > Web Service stubs and cookies
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Web Service stubs and cookies
|
|
| Mikael Thorsson 2004-12-07, 4:02 pm |
| Hello All, and sorry for cross-posting! Not sure where this fits in...
I've generated some web service client stubs from a WSDL using
jwsdp-1.5 (jax-rpc). So far so good. However, the server application
that I'm calling, uses a cookie to identify which "session" a
particular web service call refers to.
The nice people at the Big Server Company have written a VB.NET
example that shows how to set the cookie in the HTTP POST that is the
result of a call to one of the stub functions. They do something like
this:
myStubClassObject.CookieContainer.SetCookies(uri, cookie)
I would like to do this in Java, but I can't find anything in Sun's
base classes that comes even close to this.
If this is not possible in Sun Java, how can I work around it? I guess
I would have to create my own HttpURLConnection and generate the web
service call myself... but that kind of defeats the idea of a stub
class, doesn't it?
Any ideas appreciated!
| |
| PerfectDayToChaseTornados 2004-12-07, 4:02 pm |
|
"Mikael Thorsson" <thorsson_mikael@hotmail.com> wrote in message
news:b0438d39.0412070607.3ca3df8a@posting.google.com...
| Hello All, and sorry for cross-posting! Not sure where this fits in...
|
| I've generated some web service client stubs from a WSDL using
| jwsdp-1.5 (jax-rpc). So far so good. However, the server application
| that I'm calling, uses a cookie to identify which "session" a
| particular web service call refers to.
|
| The nice people at the Big Server Company have written a VB.NET
| example that shows how to set the cookie in the HTTP POST that is the
| result of a call to one of the stub functions. They do something like
| this:
|
| myStubClassObject.CookieContainer.SetCookies(uri, cookie)
|
| I would like to do this in Java, but I can't find anything in Sun's
| base classes that comes even close to this.
|
| If this is not possible in Sun Java, how can I work around it? I guess
| I would have to create my own HttpURLConnection and generate the web
| service call myself... but that kind of defeats the idea of a stub
| class, doesn't it?
|
| Any ideas appreciated!
Have you thought about using Axis instead of jwsdp? You can definitely do
this kind of thing with Axis (using SOAPHTTPConnection I think)
http://ws.apache.org/axis/
Good luck
--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"
( Kent Beck)
|
|
|
|
|