[ Zend Framework ] :: SOAP web service with session
Moderator: General Moderators
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
[ Zend Framework ] :: SOAP web service with session
Is it possible to establish a session between SOAP server and client? If yes, Can anyone guide me how i can do that.
Im using Zend_Soap
Thanks,
Kalpesh Mahida
Im using Zend_Soap
Thanks,
Kalpesh Mahida
Re: [ Zend Framework ] :: SOAP web service with session
There is no such construct "soap session". Typically a web service will define it's own way of passing session IDs or API keys around, which will vary from one web service to the next. SOAP is just the protocol and provides no mechanism analogous to HTTP cookies.
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: [ Zend Framework ] :: SOAP web service with session
Hi Josh,
Thanks for your reply.
I want to create Statefull Webservices. So, as you said my SOAP server has to create a session and has to return back the session id back to SOAP client and further communication between client and server will be carried out using the session id given by server, right? But how can i do that?
Thanks for your reply.
I want to create Statefull Webservices. So, as you said my SOAP server has to create a session and has to return back the session id back to SOAP client and further communication between client and server will be carried out using the session id given by server, right? But how can i do that?
Re: [ Zend Framework ] :: SOAP web service with session
That is a rather open ended question. Are you able to send the string "hello world" and receive it in a client? That is, are you asking how the basics of Zend_Soap component work?
Or are you knowledgeable of SOAP & Zend already, but you need a high level idea on how to establish "state"?
Or are you knowledgeable of SOAP & Zend already, but you need a high level idea on how to establish "state"?
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: [ Zend Framework ] :: SOAP web service with session
Yes i know ZF and using Zend_Soap im able to send data from client to server and from server to client. Now my concern is to established a state between client and server and want to store some client specific data into session so that in subsequent webservice call i dont need to prepare those data again and again.
My client and server are running perfect without maintaining state.
again thanks Josh for replying.
My client and server are running perfect without maintaining state.
again thanks Josh for replying.
Re: [ Zend Framework ] :: SOAP web service with session
Do you understand how regular PHP sessions work? An array of session data on the server is serialized to a string. The file its saved in is named according to a unique session ID. the client hold's a reference (cookie) to the session ID. With each request, the client provides the session ID. the server looks at the session ID to tell which file to unserialize (which file holds the session data for that particular client). A garbage collect routine cleans up the session files after a period of inactivity.
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: [ Zend Framework ] :: SOAP web service with session
I know how regular session works. I worked on a Silverlight application where all data where coming to Silverlight via web services and and i found those web services session enabled. how they are doing so? can we do something similar?
or even we forget the .net can we implement the session enabled web services in PHP?
or even we forget the .net can we implement the session enabled web services in PHP?
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: [ Zend Framework ] :: SOAP web service with session
am i looking something which is not possible?
Re: [ Zend Framework ] :: SOAP web service with session
Its definitely possible, I just told you how. The same way regular HTTP sessions work. Except instead of cookies your clients will need to track the session ID in another way (ex. database, file, etc.)
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: [ Zend Framework ] :: SOAP web service with session
Thanks Josh,
Yes i can make use of file or database to store data between webservice requests ( same thing PHP developer was doing when PHP dint have support for handling session, right? ).
But, After digging a lot google and PHP manual i found something which might help me out.
SoapServer::setPersistence
SoapServer::setPersistence - Sets SoapServer persistence mode
This function allows saving data between requests in a PHP session.
Yes i can make use of file or database to store data between webservice requests ( same thing PHP developer was doing when PHP dint have support for handling session, right? ).
But, After digging a lot google and PHP manual i found something which might help me out.
SoapServer::setPersistence
SoapServer::setPersistence - Sets SoapServer persistence mode
This function allows saving data between requests in a PHP session.
Re: [ Zend Framework ] :: SOAP web service with session
Actually I guess it seems that most (all?) soap clients support cookies, so you can already use session as normal. That function just automatically saves the current object. However if you are using Zend_Session elsewhere in your project, you should use that instead of this function you've found.kalpesh.mahida wrote:This function allows saving data between requests in a PHP session.
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: [ Zend Framework ] :: SOAP web service with session
used Zend_Session but was not working for me.