473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 4257
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Yolande | last post by:
Hi there, I try to use MSSOAPLib.soapClient to get the XML data produced by our web services. I have a web method call ReportExec(strID, strRequest). It takes two string arguments and returns a ...
1
by: aws.steve | last post by:
I am trying to get my first Soap based website to work on my Windows 2000 server with IIS 5. The code used to create the client is as follows: set SoapClient = CreateObject("MSSOAP.SoapClient")...
3
by: PaulF | last post by:
Is it possible to use a SoapClient derived class to send a message to a Web Service (eg a .asmx file)? It it is, does anyone have any code they could point me at that actually does this ! ...
1
by: Dheepu Kumar1 | last post by:
We are using WSDL in soapclient to access the java web service.The soapclient request is not formed as required by the service. Namespace is not included in one ComplexType element(<GSTBTReq>) in...
0
by: Florian Laws | last post by:
Hello, to work around an interoperability problem with the PHP5 SOAP extension, I'd like to modify the generate XML SOAP request. (as described in...
4
by: brandonkirsch | last post by:
Hey guys, I recently lost hours to the PHP 5.2.1 SoapClient when trying to use a remote webservice. There are two methods I have to use, the first one worked like a charm and the second one has...
11
by: brandonkirsch | last post by:
Hey guys, I've posted a question on here before but I don't think I was very direct about the problem so I'll state it in a new way: How do I send CDATA to a webservice using the PHP SoapClient? ...
1
by: Sergei Riaguzov | last post by:
Hi, How can I catch errors produced by SOAP server with SoapClient? The first thing which comes in mind is eval() but maybe there is a better way? The server is sending some fault information...
0
by: Adam | last post by:
Hello everbody, does anyone know if there is a possiblity to give the SoapClient __setCookie() method an value which is transformed to array values? I debugged what cookies looks like when you get...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.