You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mahen Perera <ma...@gmail.com> on 2004/08/25 07:31:39 UTC

Session Management using SOAP Headers in AXIS

Hi !

I want to manage Session using SOAP headers. For this i am using the
"SimpleSessionHandler" provided by AXIS. I added this handler
successfully to the server side and it is getting executed. I noticed
the SOAP headers containing the Session id using the TCPMON tool.

However, I was unable to get the Client Side "SimpleSessionHandler "
to get executed.


Following is the deploy.wsdd file


<?xml version="1.0" encoding="UTF-8"?>
<!-- Use this file to deploy some handlers/chains and services     
--><!-- Two ways to do this:                                          
--><!--   java org.apache.axis.client.AdminClient deploy.wsdd         
--><!--      after the axis server is running                         
--><!-- or                                                            
--><!--   java org.apache.axis.utils.Admin client|server deploy.wsdd  
--><!--      from the same directory that the Axis engine runs        
--><deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">



<handler name="session"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>

  <!-- Services from AppInitiationWSControllerService WSDL service -->

  <service name="AppInitiationWSController" provider="java:RPC">

<requestFlow>
 <handler type="session"/> 
</requestFlow>

 <responseFlow> 
<handler type="session"/> 
</responseFlow>

      <parameter name="wsdlTargetNamespace"
value="http://control.webservice.service.poc.fm.com"/>
      <parameter name="wsdlServiceElement"
value="AppInitiationWSControllerService"/>
      <parameter name="wsdlServicePort" value="AppInitiationWSController"/>
      <parameter name="className"
value="com.fm.poc.service.webservice.control.AppInitiationWSController"/>
      <parameter name="wsdlPortType" value="AppInitiationWSController"/>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://control.webservice.service.poc.fm.com"
name="getInterestAreas" qname="operNS:getInterestAreas"
returnQName="getInterestAreasReturn"
returnType="rtns:ArrayOf_tns1_NumericKeyVO">
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://control.webservice.service.poc.fm.com"
name="getCountries" qname="operNS:getCountries"
returnQName="getCountriesReturn"
returnType="rtns:ArrayOf_tns1_NumericKeyVO">
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://control.webservice.service.poc.fm.com"
name="getStatesByCountry" qname="operNS:getStatesByCountry"
returnQName="getStatesByCountryReturn"
returnType="rtns:ArrayOf_tns1_StringKeyVO">
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="countryID" type="tns:int"/>
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://control.webservice.service.poc.fm.com"
name="getSchoolsByState" qname="operNS:getSchoolsByState"
returnQName="getSchoolsByStateReturn"
returnType="rtns:ArrayOf_tns1_NumericKeyVO">
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="stateCode" type="tns:string"/>
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://control.webservice.service.poc.fm.com"
name="getQuestions" qname="operNS:getQuestions"
returnQName="getQuestionsReturn"
returnType="rtns:ArrayOf_tns1_NumericKeyVO">
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://www.w3.org/2001/XMLSchema"
name="requestPreApproval" qname="operNS:requestPreApproval"
returnQName="requestPreApprovalReturn" returnType="rtns:int">
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="loanAmount" type="tns:double"/>
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://www.w3.org/2001/XMLSchema"
name="getDisclosureStatement" qname="operNS:getDisclosureStatement"
returnQName="getDisclosureStatementReturn" returnType="rtns:string">
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="lenderID" type="tns:int"/>
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://control.webservice.service.poc.fm.com"
name="getStudyPrograms" qname="operNS:getStudyPrograms"
returnQName="getStudyProgramsReturn"
returnType="rtns:ArrayOf_tns1_NumericKeyVO">
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://vo.dataaccess.domain.service.poc.fm.com"
name="getProductDetails" qname="operNS:getProductDetails"
returnQName="getProductDetailsReturn" returnType="rtns:LoanProductVO">
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://vo.dataaccess.domain.service.poc.fm.com"
name="getLoanProduct" qname="operNS:getLoanProduct"
returnQName="getLoanProductReturn" returnType="rtns:LoanProductVO">
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="schoolID" type="tns:int"/>
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="gradeID" type="tns:int"/>
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="enrollmentID" type="tns:int"/>
        <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema"
name="majorID" type="tns:int"/>
      </operation>
      <operation
xmlns:operNS="http://control.webservice.service.poc.fm.com"
xmlns:rtns="http://www.w3.org/2001/XMLSchema"
name="saveLoanApplication" qname="operNS:saveLoanApplication"
returnQName="saveLoanApplicationReturn" returnType="rtns:int">
        <parameter
xmlns:tns="http://vo.dataaccess.domain.service.poc.fm.com"
name="saveAppDetailVO" type="tns:SaveAppDetailVO"/>
      </operation>
      <parameter name="allowedMethods" value="getInterestAreas
getCountries getStatesByCountry getSchoolsByState getQuestions
requestPreApproval getDisclosureStatement getStudyPrograms
getProductDetails getLoanProduct saveLoanApplication"/>

      <typeMapping
xmlns:ns="http://common.vo.dataaccess.domain.service.poc.fm.com"
qname="ns:BaseVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.common.BaseVO"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      <typeMapping
xmlns:ns="http://common.vo.dataaccess.domain.service.poc.fm.com"
qname="ns:NumericKeyVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.common.NumericKeyVO"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      <typeMapping
xmlns:ns="http://common.vo.dataaccess.domain.service.poc.fm.com"
qname="ns:StringKeyVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.common.StringKeyVO"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      <typeMapping
xmlns:ns="http://control.webservice.service.poc.fm.com"
qname="ns:ArrayOf_tns1_NumericKeyVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.common.NumericKeyVO[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      <typeMapping
xmlns:ns="http://control.webservice.service.poc.fm.com"
qname="ns:ArrayOf_tns1_StringKeyVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.common.StringKeyVO[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      <typeMapping
xmlns:ns="http://vo.dataaccess.domain.service.poc.fm.com"
qname="ns:LoanProductVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.LoanProductVO"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      <typeMapping
xmlns:ns="http://vo.dataaccess.domain.service.poc.fm.com"
qname="ns:SaveAppDetailVO"
type="java:com.fm.poc.service.domain.dataaccess.vo.SaveAppDetailVO"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  </service>
</deployment>




I issued the following command to generate the client-config.wsdd file.

org.apache.axis.utils.Admin client deploy.wsdd



The following client-config.wsdd file was generated.

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <handler name="session"
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
 <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
 <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
 <transport name="local"
pivot="java:org.apache.axis.transport.local.LocalSender"/>
</deployment>


I added this to the Axis.jar file ,,..

However, the Handler did not get executed.

Hoping for a quick response

Mahen