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 Srinivas Vemula <sr...@mensamind.com> on 2004/02/16 14:00:23 UTC
C# Cllient , Axis Server, Session Management
Hi All,
I am new to using axis. We are trying to communciate from a .NET
C# client. Can any one let me know, how to track sessions in this
scenario? Basically, we would like to put some authorization info in a
session object as the first call from the client will be for authentication.
After that client will call other Axis (web) services for executing
some more tasks. We would like to check for the authorization
information for subsequent calls from the same client and deny services
if we dont find the relevant information in the session object .
Any help or pointers to solve this? Thank you all for your help and
time.
srini
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it. You should delete it and notify the sender immediately.
Re: C# Cllient , Axis Server, Session Management
Posted by Srinivas Vemula <sr...@mensamind.com>.
It works ..
Thank you Stefano and Abhinav for your time
srini
Stefano Sambi wrote:
>I changed my wsdl like Abhinav said, and it works.
>I also used ".Net web service studio"
>(http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=65a1
>d4ea-0f7a-41bd-8494-e916ebc4159c)
>to verify my wsdl. If something is wrong in your wsdl file, this product
>will tell you it.
>Anyway here is my wsdl:
>
><?xml version="1.0" encoding="UTF-8"?>
><wsdl:definitions
>xmlns:impl="http://localhost/axis/services/SessionService4bis"
>xmlns:intf="http://localhost/axis/services/SessionService4bis"
>xmlns:apachesoap="http://xml.apache.org/xml-soap"
>xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:tns1="http://www.w3.org/1999/XMLSchema"
>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>xmlns:session="http://foundationip.com/services"
>targetNamespace="http://localhost/axis/services/SessionService4bis">
><wsdl:types>
><schema xmlns="http://www.w3.org/2001/XMLSchema"
>targetNamespace="http://foundationip.com/services">
><import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
><complexType name="SessionID">
><sequence>
><element name="ID" minOccurs="1" maxOccurs="1" type="xsd:string" />
></sequence>
></complexType>
></schema>
></wsdl:types>
><wsdl:message name="soapHeader">
><wsdl:part name="sessionID" type="session:SessionID"/>
></wsdl:message>
><wsdl:message name="sommaAlTotaleResponse">
><wsdl:part name="sommaAlTotaleReturn" type="xsd:int"/>
></wsdl:message>
><wsdl:message name="adessoTogliResponse">
><wsdl:part name="adessoTogliReturn" type="xsd:int"/>
></wsdl:message>
><wsdl:message name="sommaAlTotaleRequest">
><wsdl:part name="a" type="xsd:int"/>
></wsdl:message>
><wsdl:message name="adessoTogliRequest">
><wsdl:part name="a" type="xsd:int"/>
></wsdl:message>
><wsdl:portType name="SessionService4">
><wsdl:operation name="sommaAlTotale" parameterOrder="a">
><wsdl:input name="sommaAlTotaleRequest"
>message="impl:sommaAlTotaleRequest"/>
><wsdl:output name="sommaAlTotaleResponse"
>message="impl:sommaAlTotaleResponse"/>
></wsdl:operation>
><wsdl:operation name="adessoTogli" parameterOrder="a">
><wsdl:input name="adessoTogliRequest" message="impl:adessoTogliRequest"/>
><wsdl:output name="adessoTogliResponse" message="impl:adessoTogliResponse"/>
></wsdl:operation>
></wsdl:portType>
><wsdl:binding name="SessionService4bisSoapBinding"
>type="impl:SessionService4">
><wsdlsoap:binding style="rpc"
>transport="http://schemas.xmlsoap.org/soap/http"/>
><wsdl:operation name="sommaAlTotale">
><wsdlsoap:operation/>
><wsdl:input>
><wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
><wsdlsoap:body use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>namespace="http://axis4bis"/>
></wsdl:input>
><wsdl:output>
><wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
><wsdlsoap:body use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>namespace="http://localhost/axis/services/SessionService4bis"/>
></wsdl:output>
></wsdl:operation>
><wsdl:operation name="adessoTogli">
><wsdlsoap:operation/>
><wsdl:input>
><wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
><wsdlsoap:body use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>namespace="http://axis4bis"/>
></wsdl:input>
><wsdl:output>
><wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
><wsdlsoap:body use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>namespace="http://localhost/axis/services/SessionService4bis"/>
></wsdl:output>
></wsdl:operation>
></wsdl:binding>
><wsdl:service name="SessionService4Service">
><wsdl:port name="SessionService4bis"
>binding="impl:SessionService4bisSoapBinding">
><wsdlsoap:address
>location="http://localhost:9000/axis/services/SessionService4bis"/>
></wsdl:port>
></wsdl:service>
></wsdl:definitions>
>
>----- Original Message -----
>From: Srinivas Vemula
>To: axis-user@ws.apache.org
>Sent: Friday, March 12, 2004 6:58 AM
>Subject: Re: C# Cllient , Axis Server, Session Management
>
>
>Hi,
> Unfortunately we are having problems getting it to work. After we add
>the header, C# hasnt been able to recognize SessionID as an element.
>service.sessionID doesnt come up.
>
> Could you please share ur experience in a lil more detail? Or could you
>post the changed wsdl ??
>srini
>
>
>
>
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it. You should delete it and notify the sender immediately.
Re: C# Cllient , Axis Server, Session Management
Posted by Stefano Sambi <st...@business-e.it>.
I changed my wsdl like Abhinav said, and it works.
I also used ".Net web service studio"
(http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=65a1
d4ea-0f7a-41bd-8494-e916ebc4159c)
to verify my wsdl. If something is wrong in your wsdl file, this product
will tell you it.
Anyway here is my wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
xmlns:impl="http://localhost/axis/services/SessionService4bis"
xmlns:intf="http://localhost/axis/services/SessionService4bis"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns1="http://www.w3.org/1999/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:session="http://foundationip.com/services"
targetNamespace="http://localhost/axis/services/SessionService4bis">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://foundationip.com/services">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="SessionID">
<sequence>
<element name="ID" minOccurs="1" maxOccurs="1" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="soapHeader">
<wsdl:part name="sessionID" type="session:SessionID"/>
</wsdl:message>
<wsdl:message name="sommaAlTotaleResponse">
<wsdl:part name="sommaAlTotaleReturn" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="adessoTogliResponse">
<wsdl:part name="adessoTogliReturn" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="sommaAlTotaleRequest">
<wsdl:part name="a" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="adessoTogliRequest">
<wsdl:part name="a" type="xsd:int"/>
</wsdl:message>
<wsdl:portType name="SessionService4">
<wsdl:operation name="sommaAlTotale" parameterOrder="a">
<wsdl:input name="sommaAlTotaleRequest"
message="impl:sommaAlTotaleRequest"/>
<wsdl:output name="sommaAlTotaleResponse"
message="impl:sommaAlTotaleResponse"/>
</wsdl:operation>
<wsdl:operation name="adessoTogli" parameterOrder="a">
<wsdl:input name="adessoTogliRequest" message="impl:adessoTogliRequest"/>
<wsdl:output name="adessoTogliResponse" message="impl:adessoTogliResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SessionService4bisSoapBinding"
type="impl:SessionService4">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sommaAlTotale">
<wsdlsoap:operation/>
<wsdl:input>
<wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://axis4bis"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/axis/services/SessionService4bis"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="adessoTogli">
<wsdlsoap:operation/>
<wsdl:input>
<wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://axis4bis"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:header message="impl:soapHeader" part="sessionID" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/axis/services/SessionService4bis"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SessionService4Service">
<wsdl:port name="SessionService4bis"
binding="impl:SessionService4bisSoapBinding">
<wsdlsoap:address
location="http://localhost:9000/axis/services/SessionService4bis"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
----- Original Message -----
From: Srinivas Vemula
To: axis-user@ws.apache.org
Sent: Friday, March 12, 2004 6:58 AM
Subject: Re: C# Cllient , Axis Server, Session Management
Hi,
Unfortunately we are having problems getting it to work. After we add
the header, C# hasnt been able to recognize SessionID as an element.
service.sessionID doesnt come up.
Could you please share ur experience in a lil more detail? Or could you
post the changed wsdl ??
srini
Re: C# Cllient , Axis Server, Session Management
Posted by Srinivas Vemula <sr...@mensamind.com>.
Hi,
Unfortunately we are having problems getting it to work. After we
add the header, C# hasnt been able to recognize SessionID as an element.
service.sessionID doesnt come up.
Could you please share ur experience in a lil more detail? Or could
you post the changed wsdl ??
srini
Stefano Sambi wrote:
>Thanks for your responses, it seems that it works.
>Thank you
>Stefano
>
>
>
>----- Original Message -----
>From: "Abhinav Maheshwari" <ab...@contata.co.in>
>To: <ax...@ws.apache.org>
>Sent: Thursday, March 11, 2004 2:27 PM
>Subject: RE: C# Cllient , Axis Server, Session Management
>
>
>
>
>>Hi Stefan,
>>I am pasting a wsdl for your reference. Please see the embedded comments.
>>
>>On the client side, C# needs to see the SessionID element in WSDL so that
>>
>>
>it
>
>
>>can create member variable SessionID for the service. But Axis does not
>>generate such a WSDL. Hence you need to modify the WSDL produced by Axis
>>
>>
>and
>
>
>>manually add the SessionID element. Then you should use the modified WSDL
>>
>>
>in
>
>
>>Visual Studio. Following is an example of the modified WSDL with the
>>comments preceding the modifications.
>>
>>After you show this WSDL to Visual Studio, it will generate the proxy and
>>you can retreive the Session ID by using authenticationService.SessionID.
>>Hope this helps.
>>
>>Warm Regards,
>>Abhinav Maheshwari
>>
>>
>>
>><wsdl:definitions
>>
>>
>>
>targetNamespace="http://tornado/portfolioip/services/AuthenticationService"
>
>
>>xmlns:apachesoap="http://xml.apache.org/xml-soap"
>>xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>>xmlns:tns2="http://pair.biz.portfolioip.its.com"
>>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>>xmlns:tns1="http://exception.services.portfolioip.its.com"
>>xmlns:impl="http://tornado/portfolioip/services/AuthenticationService"
>>xmlns:intf="http://tornado/portfolioip/services/AuthenticationService"
>>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>>xmlns:fip="http://foundationip.com/services"
>>xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema
>>xmlns="http://www.w3.org/2001/XMLSchema"
>>targetNamespace="http://exception.services.portfolioip.its.com"><import
>>namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
>>name="InvalidUsernameException"><sequence><element name="message"
>>nillable="true" type="xsd:string"/></sequence></complexType><complexType
>>name="InvalidPasswordException"><sequence><element name="message"
>>nillable="true"
>>
>>
>type="xsd:string"/></sequence></complexType></schema><schema
>
>
>>xmlns="http://www.w3.org/2001/XMLSchema"
>>targetNamespace="http://pair.biz.portfolioip.its.com"><import
>>namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
>>name="AuthenticationFacadeException"><sequence><element name="message"
>>nillable="true" type="xsd:string"/></sequence></complexType></schema>
>>
>><!-- added session ID element. The namespace must match the namespace in
>>SessionHandler -->
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>>targetNamespace="http://foundationip.com/services">
>> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
>> <complexType name="SessionID">
>> <sequence>
>> <element name="ID" minOccurs="1" maxOccurs="1"
>>type="xsd:string" />
>> </sequence>
>> </complexType>
>> </schema>
>><!-- end of session ID element -->
>>
>></wsdl:types>
>>
>> <!-- added a header for session -->
>> <wsdl:message name="sessionHeader">
>> <wsdl:part name="SessionID" type="fip:SessionID" />
>> </wsdl:message>
>> <!-- end of session header -->
>>
>> <wsdl:message name="authenticateResponse">
>> </wsdl:message>
>> <wsdl:message name="authenticateRequest">
>> <wsdl:part name="userName" type="xsd:string"/>
>> <wsdl:part name="password" type="xsd:string"/>
>> </wsdl:message>
>> <wsdl:message name="InvalidUsernameException">
>> <wsdl:part name="fault" type="tns1:InvalidUsernameException"/>
>> </wsdl:message>
>> <wsdl:message name="AuthenticationFacadeException">
>> <wsdl:part name="fault" type="tns2:AuthenticationFacadeException"/>
>> </wsdl:message>
>> <wsdl:message name="InvalidPasswordException">
>> <wsdl:part name="fault" type="tns1:InvalidPasswordException"/>
>> </wsdl:message>
>> <wsdl:portType name="AuthenticationService">
>> <wsdl:operation name="authenticate" parameterOrder="userName
>>
>>
>password">
>
>
>> <wsdl:input name="authenticateRequest"
>>message="impl:authenticateRequest"/>
>> <wsdl:output name="authenticateResponse"
>>message="impl:authenticateResponse"/>
>> <wsdl:fault name="AuthenticationFacadeException"
>>message="impl:AuthenticationFacadeException"/>
>> <wsdl:fault name="InvalidPasswordException"
>>message="impl:InvalidPasswordException"/>
>> <wsdl:fault name="InvalidUsernameException"
>>message="impl:InvalidUsernameException"/>
>> </wsdl:operation>
>> </wsdl:portType>
>> <wsdl:binding name="AuthenticationServiceSoapBinding"
>>type="impl:AuthenticationService">
>> <wsdlsoap:binding style="rpc"
>>transport="http://schemas.xmlsoap.org/soap/http"/>
>> <wsdl:operation name="authenticate">
>> <wsdlsoap:operation soapAction=""/>
>> <wsdl:input name="authenticateRequest">
>> <wsdlsoap:body use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>namespace="http://localhost/portfolioip/services/AuthenticationService"/>
>> </wsdl:input>
>> <wsdl:output name="authenticateResponse">
>>
>> <!-- Authentication service returns a Session ID. If a service
>>
>>
>needs
>
>
>>a session ID during request, this element should also be present in
>>
>>
>request
>
>
>>definition -->
>>
>> <wsdlsoap:header use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>message="impl:sessionHeader" part="SessionID" />
>> <wsdlsoap:body use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>namespace="http://tornado/portfolioip/services/AuthenticationService"/>
>> </wsdl:output>
>> <wsdl:fault name="AuthenticationFacadeException">
>> <wsdlsoap:fault use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>namespace="http://tornado/portfolioip/services/AuthenticationService"/>
>> </wsdl:fault>
>> <wsdl:fault name="InvalidPasswordException">
>> <wsdlsoap:fault use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>namespace="http://tornado/portfolioip/services/AuthenticationService"/>
>> </wsdl:fault>
>> <wsdl:fault name="InvalidUsernameException">
>> <wsdlsoap:fault use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>namespace="http://tornado/portfolioip/services/AuthenticationService"/>
>> </wsdl:fault>
>> </wsdl:operation>
>> </wsdl:binding>
>> <wsdl:service name="AuthenticationServiceService">
>> <wsdl:port name="AuthenticationService"
>>binding="impl:AuthenticationServiceSoapBinding">
>> <wsdlsoap:address
>>location="http://tornado/portfolioip/services/AuthenticationService"/>
>> </wsdl:port>
>> </wsdl:service>
>></wsdl:definitions>
>>
>>
>>-----Original Message-----
>>From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
>>Sent: Thursday, March 11, 2004 3:29 PM
>>To: axis-user@ws.apache.org
>>Subject: Re: C# Cllient , Axis Server, Session Management
>>
>>
>>Hi Stefan,
>>
>>
>> <complexType name="SessionID">
>> <sequence>
>> <element name="ID" minOccurs="1" maxOccurs="1"
>>type="xsd:string" />
>> </sequence>
>> </complexType>
>> </schema>
>><!-- end of session ID element -->
>>
>></wsdl:types>
>>See if this works..
>>srini
>>Stefano Sambi wrote:
>>
>>I'm trying to use your SessionHandler to manage session between C# client
>>and Axis web service but I do not succeed to set the SOAP header in my
>>
>>
>wsdl.
>
>
>>Can you send me an example of your wsdl? And also how do you manage
>>
>>
>sessions
>
>
>>in your C# client?
>>
>>Here it's my changes to wsdl that don't work:
>>I added the definition of sessionID element in 'Types' section:
>><wsdl:types>
>> <xsd:schema targetNamespace=http://localhost/axis/services/MyService>
>> <xsd:complexType name="Session">
>> <xsd:sequence>
>> <xsd:element name="sessionID">
>> <xsd:complexType>
>> <xsd:sequence>
>> <xsd:element name="ID" type="xsd:string"/>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:element>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:schema>
>></wsdl:types>
>>
>>I added the definition of soap header message in 'Messages' section:
>><wsdl:message name="soapHeader">
>> <wsdl:part name="SessionID" type="impl:Session"
>>xmlns:impl=http://localhost/axis/services/MyService/>
>></wsdl:message>
>>
>>and I added the soap header binding to my operation in 'Binding' section:
>><wsdlsoap:header message="impl:soapHeader" part="SessionID" use="encoded"
>>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>>
>>
>>
>>Thanks
>>Stefano
>>
>>----- Original Message -----
>>From: "Abhinav Maheshwari" <ab...@contata.co.in>
>>To: <ax...@ws.apache.org>
>>Sent: Monday, February 16, 2004 3:15 PM
>>Subject: RE: C# Cllient , Axis Server, Session Management
>>
>>
>>
>>Hi Srinivas,
>>You need to use the SessionHandler to maintain session information but
>>
>>there
>>
>>are problems with using the one supplied with Axis. This is a modified
>>version of the SessionHandler supplied with Axis which can be used.
>>
>>Also, you need to manually put the SOAP Header in the WSDL generated by
>>
>>Axis
>>
>>so that Visual Studio can generate the code for session variables.
>>
>>Regards,
>>Abhinav
>>
>>-----Original Message-----
>>From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
>>Sent: Monday, February 16, 2004 6:30 PM
>>To: axis-user@ws.apache.org
>>Subject: C# Cllient , Axis Server, Session Management
>>
>>
>>Hi All,
>> I am new to using axis. We are trying to communciate from a .NET
>>C# client. Can any one let me know, how to track sessions in this
>>scenario? Basically, we would like to put some authorization info in a
>>session object as the first call from the client will be for
>>
>>authentication.
>>
>> After that client will call other Axis (web) services for executing
>>some more tasks. We would like to check for the authorization
>>information for subsequent calls from the same client and deny services
>>if we dont find the relevant information in the session object .
>> Any help or pointers to solve this? Thank you all for your help and
>>time.
>>srini
>>
>>--
>>Srinivas Vemula +91 40 23547826- Ext 201
>>Associate Consultant +91 40 23541447 (Fax)
>>Mensamind +91 98497-42720 (Mobile)
>>Hyderabad
>>India
>>http://www.mensamind.com
>>
>>DISCLAIMER
>>The information contained in this e-mail is confidential and intended for
>>the named recipient(s) only. If you are not an intended recipient of this
>>email you must not copy, distribute or take any further action in reliance
>>on it. You should delete it and notify the sender immediately.
>>
>>
>>
>>
>>
>>
>>--
>>Srinivas Vemula +91 40 23547826- Ext 201
>>Associate Consultant +91 40 23541447 (Fax)
>>Mensamind +91 98497-42720 (Mobile)
>>Hyderabad
>>India
>>http://www.mensamind.com
>>
>>DISCLAIMER
>>The information contained in this e-mail is confidential and intended for
>>the named recipient(s) only. If you are not an intended recipient of this
>>email you must not copy, distribute or take any further action in reliance
>>on it. You should delete it and notify the sender immediately.
>>
>>
>>
>>
>
>
>
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it. You should delete it and notify the sender immediately.
Re: C# Cllient , Axis Server, Session Management
Posted by MB...@unicacorp.com.
"Abhinav Maheshwari" <ab...@contata.co.in> writes:
> > Hi Stefan,
> > I am pasting a wsdl for your reference. Please see the embedded
comments.
> > On the client side, C# needs to see the SessionID element in WSDL so
that
> > it can create member variable SessionID for the service. But Axis does
not
> > generate such a WSDL. Hence you need to modify the WSDL produced by
Axis
> > and manually add the SessionID element. Then you should use the
modified WSDL
> > in Visual Studio. Following is an example of the modified WSDL with
the
> > comments preceding the modifications.
Is it possible to accomplish this via the HTTP headers instead of the
SOAP headers? Or does that technique only work with Axis clients?
Thanks!
Mike B.
Re: C# Cllient , Axis Server, Session Management
Posted by Stefano Sambi <st...@business-e.it>.
Thanks for your responses, it seems that it works.
Thank you
Stefano
----- Original Message -----
From: "Abhinav Maheshwari" <ab...@contata.co.in>
To: <ax...@ws.apache.org>
Sent: Thursday, March 11, 2004 2:27 PM
Subject: RE: C# Cllient , Axis Server, Session Management
> Hi Stefan,
> I am pasting a wsdl for your reference. Please see the embedded comments.
>
> On the client side, C# needs to see the SessionID element in WSDL so that
it
> can create member variable SessionID for the service. But Axis does not
> generate such a WSDL. Hence you need to modify the WSDL produced by Axis
and
> manually add the SessionID element. Then you should use the modified WSDL
in
> Visual Studio. Following is an example of the modified WSDL with the
> comments preceding the modifications.
>
> After you show this WSDL to Visual Studio, it will generate the proxy and
> you can retreive the Session ID by using authenticationService.SessionID.
> Hope this helps.
>
> Warm Regards,
> Abhinav Maheshwari
>
>
>
> <wsdl:definitions
>
targetNamespace="http://tornado/portfolioip/services/AuthenticationService"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns2="http://pair.biz.portfolioip.its.com"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:tns1="http://exception.services.portfolioip.its.com"
> xmlns:impl="http://tornado/portfolioip/services/AuthenticationService"
> xmlns:intf="http://tornado/portfolioip/services/AuthenticationService"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:fip="http://foundationip.com/services"
> xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://exception.services.portfolioip.its.com"><import
> namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
> name="InvalidUsernameException"><sequence><element name="message"
> nillable="true" type="xsd:string"/></sequence></complexType><complexType
> name="InvalidPasswordException"><sequence><element name="message"
> nillable="true"
type="xsd:string"/></sequence></complexType></schema><schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://pair.biz.portfolioip.its.com"><import
> namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
> name="AuthenticationFacadeException"><sequence><element name="message"
> nillable="true" type="xsd:string"/></sequence></complexType></schema>
>
> <!-- added session ID element. The namespace must match the namespace in
> SessionHandler -->
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://foundationip.com/services">
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> <complexType name="SessionID">
> <sequence>
> <element name="ID" minOccurs="1" maxOccurs="1"
> type="xsd:string" />
> </sequence>
> </complexType>
> </schema>
> <!-- end of session ID element -->
>
> </wsdl:types>
>
> <!-- added a header for session -->
> <wsdl:message name="sessionHeader">
> <wsdl:part name="SessionID" type="fip:SessionID" />
> </wsdl:message>
> <!-- end of session header -->
>
> <wsdl:message name="authenticateResponse">
> </wsdl:message>
> <wsdl:message name="authenticateRequest">
> <wsdl:part name="userName" type="xsd:string"/>
> <wsdl:part name="password" type="xsd:string"/>
> </wsdl:message>
> <wsdl:message name="InvalidUsernameException">
> <wsdl:part name="fault" type="tns1:InvalidUsernameException"/>
> </wsdl:message>
> <wsdl:message name="AuthenticationFacadeException">
> <wsdl:part name="fault" type="tns2:AuthenticationFacadeException"/>
> </wsdl:message>
> <wsdl:message name="InvalidPasswordException">
> <wsdl:part name="fault" type="tns1:InvalidPasswordException"/>
> </wsdl:message>
> <wsdl:portType name="AuthenticationService">
> <wsdl:operation name="authenticate" parameterOrder="userName
password">
> <wsdl:input name="authenticateRequest"
> message="impl:authenticateRequest"/>
> <wsdl:output name="authenticateResponse"
> message="impl:authenticateResponse"/>
> <wsdl:fault name="AuthenticationFacadeException"
> message="impl:AuthenticationFacadeException"/>
> <wsdl:fault name="InvalidPasswordException"
> message="impl:InvalidPasswordException"/>
> <wsdl:fault name="InvalidUsernameException"
> message="impl:InvalidUsernameException"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="AuthenticationServiceSoapBinding"
> type="impl:AuthenticationService">
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="authenticate">
> <wsdlsoap:operation soapAction=""/>
> <wsdl:input name="authenticateRequest">
> <wsdlsoap:body use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://localhost/portfolioip/services/AuthenticationService"/>
> </wsdl:input>
> <wsdl:output name="authenticateResponse">
>
> <!-- Authentication service returns a Session ID. If a service
needs
> a session ID during request, this element should also be present in
request
> definition -->
>
> <wsdlsoap:header use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> message="impl:sessionHeader" part="SessionID" />
> <wsdlsoap:body use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://tornado/portfolioip/services/AuthenticationService"/>
> </wsdl:output>
> <wsdl:fault name="AuthenticationFacadeException">
> <wsdlsoap:fault use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://tornado/portfolioip/services/AuthenticationService"/>
> </wsdl:fault>
> <wsdl:fault name="InvalidPasswordException">
> <wsdlsoap:fault use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://tornado/portfolioip/services/AuthenticationService"/>
> </wsdl:fault>
> <wsdl:fault name="InvalidUsernameException">
> <wsdlsoap:fault use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://tornado/portfolioip/services/AuthenticationService"/>
> </wsdl:fault>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="AuthenticationServiceService">
> <wsdl:port name="AuthenticationService"
> binding="impl:AuthenticationServiceSoapBinding">
> <wsdlsoap:address
> location="http://tornado/portfolioip/services/AuthenticationService"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> -----Original Message-----
> From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
> Sent: Thursday, March 11, 2004 3:29 PM
> To: axis-user@ws.apache.org
> Subject: Re: C# Cllient , Axis Server, Session Management
>
>
> Hi Stefan,
>
>
> <complexType name="SessionID">
> <sequence>
> <element name="ID" minOccurs="1" maxOccurs="1"
> type="xsd:string" />
> </sequence>
> </complexType>
> </schema>
> <!-- end of session ID element -->
>
> </wsdl:types>
> See if this works..
> srini
> Stefano Sambi wrote:
>
> I'm trying to use your SessionHandler to manage session between C# client
> and Axis web service but I do not succeed to set the SOAP header in my
wsdl.
> Can you send me an example of your wsdl? And also how do you manage
sessions
> in your C# client?
>
> Here it's my changes to wsdl that don't work:
> I added the definition of sessionID element in 'Types' section:
> <wsdl:types>
> <xsd:schema targetNamespace=http://localhost/axis/services/MyService>
> <xsd:complexType name="Session">
> <xsd:sequence>
> <xsd:element name="sessionID">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="ID" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
> </wsdl:types>
>
> I added the definition of soap header message in 'Messages' section:
> <wsdl:message name="soapHeader">
> <wsdl:part name="SessionID" type="impl:Session"
> xmlns:impl=http://localhost/axis/services/MyService/>
> </wsdl:message>
>
> and I added the soap header binding to my operation in 'Binding' section:
> <wsdlsoap:header message="impl:soapHeader" part="SessionID" use="encoded"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>
>
>
> Thanks
> Stefano
>
> ----- Original Message -----
> From: "Abhinav Maheshwari" <ab...@contata.co.in>
> To: <ax...@ws.apache.org>
> Sent: Monday, February 16, 2004 3:15 PM
> Subject: RE: C# Cllient , Axis Server, Session Management
>
>
>
> Hi Srinivas,
> You need to use the SessionHandler to maintain session information but
>
> there
>
> are problems with using the one supplied with Axis. This is a modified
> version of the SessionHandler supplied with Axis which can be used.
>
> Also, you need to manually put the SOAP Header in the WSDL generated by
>
> Axis
>
> so that Visual Studio can generate the code for session variables.
>
> Regards,
> Abhinav
>
> -----Original Message-----
> From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
> Sent: Monday, February 16, 2004 6:30 PM
> To: axis-user@ws.apache.org
> Subject: C# Cllient , Axis Server, Session Management
>
>
> Hi All,
> I am new to using axis. We are trying to communciate from a .NET
> C# client. Can any one let me know, how to track sessions in this
> scenario? Basically, we would like to put some authorization info in a
> session object as the first call from the client will be for
>
> authentication.
>
> After that client will call other Axis (web) services for executing
> some more tasks. We would like to check for the authorization
> information for subsequent calls from the same client and deny services
> if we dont find the relevant information in the session object .
> Any help or pointers to solve this? Thank you all for your help and
> time.
> srini
>
> --
> Srinivas Vemula +91 40 23547826- Ext 201
> Associate Consultant +91 40 23541447 (Fax)
> Mensamind +91 98497-42720 (Mobile)
> Hyderabad
> India
> http://www.mensamind.com
>
> DISCLAIMER
> The information contained in this e-mail is confidential and intended for
> the named recipient(s) only. If you are not an intended recipient of this
> email you must not copy, distribute or take any further action in reliance
> on it. You should delete it and notify the sender immediately.
>
>
>
>
>
>
> --
> Srinivas Vemula +91 40 23547826- Ext 201
> Associate Consultant +91 40 23541447 (Fax)
> Mensamind +91 98497-42720 (Mobile)
> Hyderabad
> India
> http://www.mensamind.com
>
> DISCLAIMER
> The information contained in this e-mail is confidential and intended for
> the named recipient(s) only. If you are not an intended recipient of this
> email you must not copy, distribute or take any further action in reliance
> on it. You should delete it and notify the sender immediately.
>
>
RE: C# Cllient , Axis Server, Session Management
Posted by Abhinav Maheshwari <ab...@contata.co.in>.
Hi Stefan,
I am pasting a wsdl for your reference. Please see the embedded comments.
On the client side, C# needs to see the SessionID element in WSDL so that it
can create member variable SessionID for the service. But Axis does not
generate such a WSDL. Hence you need to modify the WSDL produced by Axis and
manually add the SessionID element. Then you should use the modified WSDL in
Visual Studio. Following is an example of the modified WSDL with the
comments preceding the modifications.
After you show this WSDL to Visual Studio, it will generate the proxy and
you can retreive the Session ID by using authenticationService.SessionID.
Hope this helps.
Warm Regards,
Abhinav Maheshwari
<wsdl:definitions
targetNamespace="http://tornado/portfolioip/services/AuthenticationService"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns2="http://pair.biz.portfolioip.its.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns1="http://exception.services.portfolioip.its.com"
xmlns:impl="http://tornado/portfolioip/services/AuthenticationService"
xmlns:intf="http://tornado/portfolioip/services/AuthenticationService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:fip="http://foundationip.com/services"
xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://exception.services.portfolioip.its.com"><import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
name="InvalidUsernameException"><sequence><element name="message"
nillable="true" type="xsd:string"/></sequence></complexType><complexType
name="InvalidPasswordException"><sequence><element name="message"
nillable="true" type="xsd:string"/></sequence></complexType></schema><schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://pair.biz.portfolioip.its.com"><import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
name="AuthenticationFacadeException"><sequence><element name="message"
nillable="true" type="xsd:string"/></sequence></complexType></schema>
<!-- added session ID element. The namespace must match the namespace in
SessionHandler -->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://foundationip.com/services">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="SessionID">
<sequence>
<element name="ID" minOccurs="1" maxOccurs="1"
type="xsd:string" />
</sequence>
</complexType>
</schema>
<!-- end of session ID element -->
</wsdl:types>
<!-- added a header for session -->
<wsdl:message name="sessionHeader">
<wsdl:part name="SessionID" type="fip:SessionID" />
</wsdl:message>
<!-- end of session header -->
<wsdl:message name="authenticateResponse">
</wsdl:message>
<wsdl:message name="authenticateRequest">
<wsdl:part name="userName" type="xsd:string"/>
<wsdl:part name="password" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="InvalidUsernameException">
<wsdl:part name="fault" type="tns1:InvalidUsernameException"/>
</wsdl:message>
<wsdl:message name="AuthenticationFacadeException">
<wsdl:part name="fault" type="tns2:AuthenticationFacadeException"/>
</wsdl:message>
<wsdl:message name="InvalidPasswordException">
<wsdl:part name="fault" type="tns1:InvalidPasswordException"/>
</wsdl:message>
<wsdl:portType name="AuthenticationService">
<wsdl:operation name="authenticate" parameterOrder="userName password">
<wsdl:input name="authenticateRequest"
message="impl:authenticateRequest"/>
<wsdl:output name="authenticateResponse"
message="impl:authenticateResponse"/>
<wsdl:fault name="AuthenticationFacadeException"
message="impl:AuthenticationFacadeException"/>
<wsdl:fault name="InvalidPasswordException"
message="impl:InvalidPasswordException"/>
<wsdl:fault name="InvalidUsernameException"
message="impl:InvalidUsernameException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AuthenticationServiceSoapBinding"
type="impl:AuthenticationService">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="authenticate">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="authenticateRequest">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/portfolioip/services/AuthenticationService"/>
</wsdl:input>
<wsdl:output name="authenticateResponse">
<!-- Authentication service returns a Session ID. If a service needs
a session ID during request, this element should also be present in request
definition -->
<wsdlsoap:header use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
message="impl:sessionHeader" part="SessionID" />
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://tornado/portfolioip/services/AuthenticationService"/>
</wsdl:output>
<wsdl:fault name="AuthenticationFacadeException">
<wsdlsoap:fault use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://tornado/portfolioip/services/AuthenticationService"/>
</wsdl:fault>
<wsdl:fault name="InvalidPasswordException">
<wsdlsoap:fault use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://tornado/portfolioip/services/AuthenticationService"/>
</wsdl:fault>
<wsdl:fault name="InvalidUsernameException">
<wsdlsoap:fault use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://tornado/portfolioip/services/AuthenticationService"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AuthenticationServiceService">
<wsdl:port name="AuthenticationService"
binding="impl:AuthenticationServiceSoapBinding">
<wsdlsoap:address
location="http://tornado/portfolioip/services/AuthenticationService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-----Original Message-----
From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
Sent: Thursday, March 11, 2004 3:29 PM
To: axis-user@ws.apache.org
Subject: Re: C# Cllient , Axis Server, Session Management
Hi Stefan,
<complexType name="SessionID">
<sequence>
<element name="ID" minOccurs="1" maxOccurs="1"
type="xsd:string" />
</sequence>
</complexType>
</schema>
<!-- end of session ID element -->
</wsdl:types>
See if this works..
srini
Stefano Sambi wrote:
I'm trying to use your SessionHandler to manage session between C# client
and Axis web service but I do not succeed to set the SOAP header in my wsdl.
Can you send me an example of your wsdl? And also how do you manage sessions
in your C# client?
Here it's my changes to wsdl that don't work:
I added the definition of sessionID element in 'Types' section:
<wsdl:types>
<xsd:schema targetNamespace=http://localhost/axis/services/MyService>
<xsd:complexType name="Session">
<xsd:sequence>
<xsd:element name="sessionID">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
I added the definition of soap header message in 'Messages' section:
<wsdl:message name="soapHeader">
<wsdl:part name="SessionID" type="impl:Session"
xmlns:impl=http://localhost/axis/services/MyService/>
</wsdl:message>
and I added the soap header binding to my operation in 'Binding' section:
<wsdlsoap:header message="impl:soapHeader" part="SessionID" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
Thanks
Stefano
----- Original Message -----
From: "Abhinav Maheshwari" <ab...@contata.co.in>
To: <ax...@ws.apache.org>
Sent: Monday, February 16, 2004 3:15 PM
Subject: RE: C# Cllient , Axis Server, Session Management
Hi Srinivas,
You need to use the SessionHandler to maintain session information but
there
are problems with using the one supplied with Axis. This is a modified
version of the SessionHandler supplied with Axis which can be used.
Also, you need to manually put the SOAP Header in the WSDL generated by
Axis
so that Visual Studio can generate the code for session variables.
Regards,
Abhinav
-----Original Message-----
From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
Sent: Monday, February 16, 2004 6:30 PM
To: axis-user@ws.apache.org
Subject: C# Cllient , Axis Server, Session Management
Hi All,
I am new to using axis. We are trying to communciate from a .NET
C# client. Can any one let me know, how to track sessions in this
scenario? Basically, we would like to put some authorization info in a
session object as the first call from the client will be for
authentication.
After that client will call other Axis (web) services for executing
some more tasks. We would like to check for the authorization
information for subsequent calls from the same client and deny services
if we dont find the relevant information in the session object .
Any help or pointers to solve this? Thank you all for your help and
time.
srini
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for
the named recipient(s) only. If you are not an intended recipient of this
email you must not copy, distribute or take any further action in reliance
on it. You should delete it and notify the sender immediately.
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for
the named recipient(s) only. If you are not an intended recipient of this
email you must not copy, distribute or take any further action in reliance
on it. You should delete it and notify the sender immediately.
Re: C# Cllient , Axis Server, Session Management
Posted by Srinivas Vemula <sr...@mensamind.com>.
Hi Stefan,
<complexType name="SessionID">
<sequence>
<element name="ID" minOccurs="1" maxOccurs="1"
type="xsd:string" />
</sequence>
</complexType>
</schema>
<!-- end of session ID element -->
</wsdl:types>
See if this works..
srini
Stefano Sambi wrote:
>I'm trying to use your SessionHandler to manage session between C# client
>and Axis web service but I do not succeed to set the SOAP header in my wsdl.
>Can you send me an example of your wsdl? And also how do you manage sessions
>in your C# client?
>
>Here it's my changes to wsdl that don't work:
>I added the definition of sessionID element in 'Types' section:
><wsdl:types>
> <xsd:schema targetNamespace=http://localhost/axis/services/MyService>
> <xsd:complexType name="Session">
> <xsd:sequence>
> <xsd:element name="sessionID">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="ID" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
></wsdl:types>
>
>I added the definition of soap header message in 'Messages' section:
><wsdl:message name="soapHeader">
> <wsdl:part name="SessionID" type="impl:Session"
>xmlns:impl=http://localhost/axis/services/MyService/>
></wsdl:message>
>
>and I added the soap header binding to my operation in 'Binding' section:
><wsdlsoap:header message="impl:soapHeader" part="SessionID" use="encoded"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>
>
>
>Thanks
>Stefano
>
>----- Original Message -----
>From: "Abhinav Maheshwari" <ab...@contata.co.in>
>To: <ax...@ws.apache.org>
>Sent: Monday, February 16, 2004 3:15 PM
>Subject: RE: C# Cllient , Axis Server, Session Management
>
>
>
>
>>Hi Srinivas,
>>You need to use the SessionHandler to maintain session information but
>>
>>
>there
>
>
>>are problems with using the one supplied with Axis. This is a modified
>>version of the SessionHandler supplied with Axis which can be used.
>>
>>Also, you need to manually put the SOAP Header in the WSDL generated by
>>
>>
>Axis
>
>
>>so that Visual Studio can generate the code for session variables.
>>
>>Regards,
>>Abhinav
>>
>>-----Original Message-----
>>From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
>>Sent: Monday, February 16, 2004 6:30 PM
>>To: axis-user@ws.apache.org
>>Subject: C# Cllient , Axis Server, Session Management
>>
>>
>>Hi All,
>> I am new to using axis. We are trying to communciate from a .NET
>>C# client. Can any one let me know, how to track sessions in this
>>scenario? Basically, we would like to put some authorization info in a
>>session object as the first call from the client will be for
>>
>>
>authentication.
>
>
>> After that client will call other Axis (web) services for executing
>>some more tasks. We would like to check for the authorization
>>information for subsequent calls from the same client and deny services
>>if we dont find the relevant information in the session object .
>> Any help or pointers to solve this? Thank you all for your help and
>>time.
>>srini
>>
>>--
>>Srinivas Vemula +91 40 23547826- Ext 201
>>Associate Consultant +91 40 23541447 (Fax)
>>Mensamind +91 98497-42720 (Mobile)
>>Hyderabad
>>India
>>http://www.mensamind.com
>>
>>DISCLAIMER
>>The information contained in this e-mail is confidential and intended for
>>the named recipient(s) only. If you are not an intended recipient of this
>>email you must not copy, distribute or take any further action in reliance
>>on it. You should delete it and notify the sender immediately.
>>
>>
>>
>
>
>
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it. You should delete it and notify the sender immediately.
Re: C# Cllient , Axis Server, Session Management
Posted by Stefano Sambi <st...@business-e.it>.
I'm trying to use your SessionHandler to manage session between C# client
and Axis web service but I do not succeed to set the SOAP header in my wsdl.
Can you send me an example of your wsdl? And also how do you manage sessions
in your C# client?
Here it's my changes to wsdl that don't work:
I added the definition of sessionID element in 'Types' section:
<wsdl:types>
<xsd:schema targetNamespace=http://localhost/axis/services/MyService>
<xsd:complexType name="Session">
<xsd:sequence>
<xsd:element name="sessionID">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
I added the definition of soap header message in 'Messages' section:
<wsdl:message name="soapHeader">
<wsdl:part name="SessionID" type="impl:Session"
xmlns:impl=http://localhost/axis/services/MyService/>
</wsdl:message>
and I added the soap header binding to my operation in 'Binding' section:
<wsdlsoap:header message="impl:soapHeader" part="SessionID" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
Thanks
Stefano
----- Original Message -----
From: "Abhinav Maheshwari" <ab...@contata.co.in>
To: <ax...@ws.apache.org>
Sent: Monday, February 16, 2004 3:15 PM
Subject: RE: C# Cllient , Axis Server, Session Management
> Hi Srinivas,
> You need to use the SessionHandler to maintain session information but
there
> are problems with using the one supplied with Axis. This is a modified
> version of the SessionHandler supplied with Axis which can be used.
>
> Also, you need to manually put the SOAP Header in the WSDL generated by
Axis
> so that Visual Studio can generate the code for session variables.
>
> Regards,
> Abhinav
>
> -----Original Message-----
> From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
> Sent: Monday, February 16, 2004 6:30 PM
> To: axis-user@ws.apache.org
> Subject: C# Cllient , Axis Server, Session Management
>
>
> Hi All,
> I am new to using axis. We are trying to communciate from a .NET
> C# client. Can any one let me know, how to track sessions in this
> scenario? Basically, we would like to put some authorization info in a
> session object as the first call from the client will be for
authentication.
> After that client will call other Axis (web) services for executing
> some more tasks. We would like to check for the authorization
> information for subsequent calls from the same client and deny services
> if we dont find the relevant information in the session object .
> Any help or pointers to solve this? Thank you all for your help and
> time.
> srini
>
> --
> Srinivas Vemula +91 40 23547826- Ext 201
> Associate Consultant +91 40 23541447 (Fax)
> Mensamind +91 98497-42720 (Mobile)
> Hyderabad
> India
> http://www.mensamind.com
>
> DISCLAIMER
> The information contained in this e-mail is confidential and intended for
> the named recipient(s) only. If you are not an intended recipient of this
> email you must not copy, distribute or take any further action in reliance
> on it. You should delete it and notify the sender immediately.
>
Re: C# Cllient , Axis Server, Session Management
Posted by Srinivas Vemula <sr...@mensamind.com>.
Thank you very much for your time Abhinav. Could you send me a sample
wsdl u use with the headers ??
Srini
Abhinav Maheshwari wrote:
>Hi Srinivas,
>You need to use the SessionHandler to maintain session information but there
>are problems with using the one supplied with Axis. This is a modified
>version of the SessionHandler supplied with Axis which can be used.
>
>Also, you need to manually put the SOAP Header in the WSDL generated by Axis
>so that Visual Studio can generate the code for session variables.
>
>Regards,
>Abhinav
>
>-----Original Message-----
>From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
>Sent: Monday, February 16, 2004 6:30 PM
>To: axis-user@ws.apache.org
>Subject: C# Cllient , Axis Server, Session Management
>
>
>Hi All,
> I am new to using axis. We are trying to communciate from a .NET
>C# client. Can any one let me know, how to track sessions in this
>scenario? Basically, we would like to put some authorization info in a
>session object as the first call from the client will be for authentication.
> After that client will call other Axis (web) services for executing
>some more tasks. We would like to check for the authorization
>information for subsequent calls from the same client and deny services
>if we dont find the relevant information in the session object .
> Any help or pointers to solve this? Thank you all for your help and
>time.
>srini
>
>--
>Srinivas Vemula +91 40 23547826- Ext 201
>Associate Consultant +91 40 23541447 (Fax)
>Mensamind +91 98497-42720 (Mobile)
>Hyderabad
>India
>http://www.mensamind.com
>
>DISCLAIMER
>The information contained in this e-mail is confidential and intended for
>the named recipient(s) only. If you are not an intended recipient of this
>email you must not copy, distribute or take any further action in reliance
>on it. You should delete it and notify the sender immediately.
>
>
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it. You should delete it and notify the sender immediately.
RE: C# Cllient , Axis Server, Session Management
Posted by Abhinav Maheshwari <ab...@contata.co.in>.
Hi Srinivas,
You need to use the SessionHandler to maintain session information but there
are problems with using the one supplied with Axis. This is a modified
version of the SessionHandler supplied with Axis which can be used.
Also, you need to manually put the SOAP Header in the WSDL generated by Axis
so that Visual Studio can generate the code for session variables.
Regards,
Abhinav
-----Original Message-----
From: Srinivas Vemula [mailto:srinivas.vemula@mensamind.com]
Sent: Monday, February 16, 2004 6:30 PM
To: axis-user@ws.apache.org
Subject: C# Cllient , Axis Server, Session Management
Hi All,
I am new to using axis. We are trying to communciate from a .NET
C# client. Can any one let me know, how to track sessions in this
scenario? Basically, we would like to put some authorization info in a
session object as the first call from the client will be for authentication.
After that client will call other Axis (web) services for executing
some more tasks. We would like to check for the authorization
information for subsequent calls from the same client and deny services
if we dont find the relevant information in the session object .
Any help or pointers to solve this? Thank you all for your help and
time.
srini
--
Srinivas Vemula +91 40 23547826- Ext 201
Associate Consultant +91 40 23541447 (Fax)
Mensamind +91 98497-42720 (Mobile)
Hyderabad
India
http://www.mensamind.com
DISCLAIMER
The information contained in this e-mail is confidential and intended for
the named recipient(s) only. If you are not an intended recipient of this
email you must not copy, distribute or take any further action in reliance
on it. You should delete it and notify the sender immediately.