WSO2Con 2013 CFP Banner

How can I enable SOAP sessions in Axis2?

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
Discuss this article on Stack Overflow
By Sanka Samaranayake
  • 21 Dec, 2006
  • Level: 
  • Reads: 7228
If you want to enable SOAP sessions for a service you need to do the following:.
Sanka Samaranayake

Specify the 'scope="soapsession"' attribute in the services.xml Engage the addressing module for the service You can do that by including <module ref="addressing" /> element within the <service> element in the services.xml. This step is required only if addressing is not engaged globally by default. On the client side you need to do the following:. Engage addressing module to the service. (Note: you need to have the addressing.mar in your class path). QName qname = new QName(null,"addressing-1.1"); serviceClient.engageModule(qname); Enable SOAP sessions in the ServiceClient options. Options options = serviceClient.getOptions(); options.setManageSession(true); Applies To:Apache Axis2/Java versions 1.0 or aboveWSO2 WSAS for Java versions 1.0 or above This KB Q & A Applies to 1. Apache Axis2/Java versions 1.0, 1.1 2. WSO2 WSAS for Java versions 1.0, 1.1 Author Sanka Samaranayake, Software Engineer, WSO2 Inc.,