• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Management in web service

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to write web service code which able to maintain the same session on different request.

The code is as below:
Server code

Client code:

When i am executing the client code, the new session id get generated. but i want to maintain the same session for the certain period, so when next request will go, that request will share the existing session id not the new session. i search through blog, one of blog i found that they are using hashset for storing session id. but how we can retain session timeout value for certain timeinterval. i am new in a web service. guide me
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
response1

<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>;
<wsa:ReferenceParameters>
<axis2:ServiceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">
urn:uuid:a2dfc341-e310-463c-80d0-cc1ac6d530a9 </axis2:ServiceGroupId>
</wsa:ReferenceParameters>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:4081bc29-8347-4831-9642-598616313984
</wsa:MessageID>
<wsa:Action>//schemas.xmlsoap.org/wsdl/MTOMServicePortType/AttachmentResponse
</wsa:Action>
<wsa:RelatesTo>urn:uuid:2a5040b1-9f2b-49d4-b1c7-e75786a5a642
</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ns1:AttachmentResponse xmlns:ns1="http://ws.apache.org/axis2/mtomsample/">service
executed</ns1:AttachmentResponse>
</soapenv:Body>
</soapenv:Envelope>

response2:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>;
<wsa:ReferenceParameters>
<axis2:ServiceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">
urn:uuid:a2dfc341-e310-463c-80d0-cc1ac6d530a9
</axis2:ServiceGroupId>
</wsa:ReferenceParameters>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:66cc6591-cd47-4c48-8878-6c3f416e1308
</wsa:MessageID>
<wsa:Action>//schemas.xmlsoap.org/wsdl/MTOMServicePortType/AttachmentResponse
</wsa:Action>
<wsa:RelatesTo>urn:uuid:9e959964-b82a-4f6c-a4ee-bd656a638237
</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ns1:AttachmentResponse xmlns:ns1="http://ws.apache.org/axis2/mtomsample/">service1
executed</ns1:AttachmentResponse>
</soapenv:Body>
</soapenv:Envelope>

I have copied here two different responses with same servicegroupId,Are you looking for the same.
 
Nilesh Mishra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using websphere7.0 for client program and , i am getting the exception : javax.xml.ws.WebServiceException: Error: Maintain Session is enabled but none of the session properties (Cookies, Over-written URL) are returned. while if i am running the same client program from the console then i am receiving same session id. Please suggest me why in the browser level client program generating exception.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Anand prakash what you described is exactly what I am looking for. Can you please assist.
 
Nilesh Mishra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Brighton Mukorera can you give me details actually what are you looking for?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic