Jay I am viewing the HTTP header using tcpmon, i tried using fiddler and it does not show SOAP messages if i am using a web service but shows message in case of it being a web site. In tcpmon i can see the cookie information
"HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Wed, 25 Apr 2007 02:26:19 GMT X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=vgehlgiivvo0gk45vzh50mbt; path=/; HttpOnly Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Content-Length: 1123 ................. " I am able to access the SOAP header information but i unable to get access tothe HTTP header or the cookie information. "Set-Cookie: ASP.NET_SessionId=vgehlgiivvo0gk45vzh50mbt; path=/; HttpOnly" is the cookie information i receive from the http header. Thanks Anil On 4/24/07, James Arbo <[EMAIL PROTECTED]> wrote:
Anil, That probably means there is no "Coookie:" header in the response. Are you certain that your server is returning a "Cookie:" header? Did you set the manageTransportSession to true in axis2.xml? Have you ever used a proxy server? I'm using fiddler and it allows me to view the complete http request and response going over the wire. That's how I validated the proper headers were being sent. There is also a way using axis to get to the HTTPResponse object which allows you to view the headers. -Jay -----Original Message----- *From:* Anil Chukkapalli [mailto:[EMAIL PROTECTED] *Sent:* Tuesday, April 24, 2007 9:41 PM *To:* axis-user@ws.apache.org *Subject:* Re: Axis2 Manage Session Cookie Manually Jay I am getting the message context successfully, i print the but "String incomingCookie = (String) inMsgCtx.getServiceContext ().getProperty( HTTPConstants.COOKIE_STRING)" is returning me a null. Is there any other way I can access the cookie. Thanks Anil On 4/23/07, *James Arbo* < [EMAIL PROTECTED]> wrote: I've successfully retrieved and returned http session cookies. Here's a snippet for reading a cookie from an axis2 client: String incomingCookie = (String) inMsgCtx.getServiceContext().getProperty(HTTPConstants.COOKIE_STRING); Here's one for writing a cookie. /* * This is how to add a custom header, such as a cookie */ Header hdr = new Header("Cookie","my_cookie=xyz;"); ArrayList headers = new ArrayList(); headers.add(hdr); opts = outMsgCtx.getOptions(); opts.setProperty(HTTPConstants.HTTP_HEADERS,headers); You could do something similar to the above but the easiest way for me to get this working was to set the manageTransportSession=true in axis2.xmland then use the following on the client side: opts.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,true); This tells axis to re-use the httpclient object for second, third, etc.. requests. If this is done, the http-client remembers the JSESSIONID from the first request and sends it back to the server on subsequent requests. -Jay -----Original Message----- *From:* Anil Chukkapalli [mailto:[EMAIL PROTECTED] ] *Sent:* Monday, April 23, 2007 2:48 PM *To:* axis-user@ws.apache.org *Subject:* Axis2 Manage Session Cookie Manually Hi Is there any way we can manage sessions manually using Axis2, my non java web service maintains session using cookies. Is there a way my Axis2 client can read the soap/http header to extract the session information and use the extracted infromation for further web service calls, example getting the UUID from the header and use the UUID to create a cookie in my Axis2 client using setProperty. I have tried using the set manage session method to true but that does not work. Can you please point me to another thread that answers my question if you are unable to answer this question. Thanks Anil