470,849 Members | 1,142 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

SoapClient and Cookies

I am trying to use a webservice method on an ASP .NET server. I am
running a simple php script on my ubuntu machine. Basically, the ASP
servers first requires you to login via a login method by supplying
username and password. It returns a string to indicate whether you
logged in successfully and also returns a cookie.

Afther this authentication, you can connect to another service that is
only accessible if you have received the cookie above. I am able to
make this work via my browser, where I can login, check for the cookie
and I am able to access the WSDL file for the protected methods.

However, I am unable to get it work via a client site php script that
I run from the command line. I am able to see that I was logged in
successfully, I can also print_r($client->_cookies['name'][0]) so I
know I am receiving the cookie. However, it seems like when I try to
instantiate another client it fails complaining that I cannot access
the URL provided.

$clientreq = new SoapClient(....);

How do I ensure that the cookie is used on subsequent requests? I
have seen that Zend classes offer cookie stickiness via
setCookieJar(). how can achieve this in php.

Moussa
Jun 2 '08 #1
3 4113
Hi,

Try SoapClient->__setCookie()

Regards,

John Peters

On May 3, 12:24 pm, fulatoro <mus...@gmail.comwrote:
I am trying to use a webservice method on an ASP .NET server. I am
running a simple php script on my ubuntu machine. Basically, the ASP
servers first requires you to login via a login method by supplying
username and password. It returns a string to indicate whether you
logged in successfully and also returns a cookie.

Afther this authentication, you can connect to another service that is
only accessible if you have received the cookie above. I am able to
make this work via my browser, where I can login, check for the cookie
and I am able to access the WSDL file for the protected methods.

However, I am unable to get it work via a client site php script that
I run from the command line. I am able to see that I was logged in
successfully, I can also print_r($client->_cookies['name'][0]) so I
know I am receiving the cookie. However, it seems like when I try to
instantiate another client it fails complaining that I cannot access
the URL provided.

$clientreq = new SoapClient(....);

How do I ensure that the cookie is used on subsequent requests? I
have seen that Zend classes offer cookie stickiness via
setCookieJar(). how can achieve this in php.

Moussa
Jun 2 '08 #2
Tried it already does not work. The issue is that the Server is
authenticating as I am doing my second

$clientreq = new SoapClient("http://....$WSDL");

It is assuming that the cookie is already available as part of the
session I guess.

Moussa

On May 4, 2:08 am, petersprc <peters...@gmail.comwrote:
Hi,

Try SoapClient->__setCookie()

Regards,

John Peters

On May 3, 12:24 pm, fulatoro <mus...@gmail.comwrote:
I am trying to use a webservice method on an ASP .NET server. I am
running a simple php script on my ubuntu machine. Basically, the ASP
servers first requires you to login via a login method by supplying
username and password. It returns a string to indicate whether you
logged in successfully and also returns a cookie.
Afther this authentication, you can connect to another service that is
only accessible if you have received the cookie above. I am able to
make this work via my browser, where I can login, check for the cookie
and I am able to access the WSDL file for the protected methods.
However, I am unable to get it work via a client site php script that
I run from the command line. I am able to see that I was logged in
successfully, I can also print_r($client->_cookies['name'][0]) so I
know I am receiving the cookie. However, it seems like when I try to
instantiate another client it fails complaining that I cannot access
the URL provided.
$clientreq = new SoapClient(....);
How do I ensure that the cookie is used on subsequent requests? I
have seen that Zend classes offer cookie stickiness via
setCookieJar(). how can achieve this in php.
Moussa

Jun 2 '08 #3
You can use a local WSDL file instead of fetching the second URL.

Regards,

John Peters

On May 5, 2:15 pm, fulatoro <mus...@gmail.comwrote:
Tried it already does not work. The issue is that the Server is
authenticating as I am doing my second

$clientreq = new SoapClient("http://....$WSDL");

It is assuming that the cookie is already available as part of the
session I guess.

Moussa

On May 4, 2:08 am, petersprc <peters...@gmail.comwrote:
Hi,
Try SoapClient->__setCookie()
Regards,
John Peters
On May 3, 12:24 pm, fulatoro <mus...@gmail.comwrote:
I am trying to use a webservice method on an ASP .NET server. I am
running a simple php script on my ubuntu machine. Basically, the ASP
servers first requires you to login via a login method by supplying
username and password. It returns a string to indicate whether you
logged in successfully and also returns a cookie.
Afther this authentication, you can connect to another service that is
only accessible if you have received the cookie above. I am able to
make this work via my browser, where I can login, check for the cookie
and I am able to access the WSDL file for the protected methods.
However, I am unable to get it work via a client site php script that
I run from the command line. I am able to see that I was logged in
successfully, I can also print_r($client->_cookies['name'][0]) so I
know I am receiving the cookie. However, it seems like when I try to
instantiate another client it fails complaining that I cannot access
the URL provided.
$clientreq = new SoapClient(....);
How do I ensure that the cookie is used on subsequent requests? I
have seen that Zend classes offer cookie stickiness via
setCookieJar(). how can achieve this in php.
Moussa
Jun 2 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Yolande | last post: by
1 post views Thread by aws.steve | last post: by
1 post views Thread by Sergei Riaguzov | last post: by
reply views Thread by Adam | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.