473,806 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4292
Hi,

Try SoapClient->__setCookie( )

Regards,

John Peters

On May 3, 12:24 pm, fulatoro <mus...@gmail.c omwrote:
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("htt p://....$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...@gmai l.comwrote:
Hi,

Try SoapClient->__setCookie( )

Regards,

John Peters

On May 3, 12:24 pm, fulatoro <mus...@gmail.c omwrote:
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.c omwrote:
Tried it already does not work. The issue is that the Server is
authenticating as I am doing my second

$clientreq = new SoapClient("htt p://....$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...@gmai l.comwrote:
Hi,
Try SoapClient->__setCookie( )
Regards,
John Peters
On May 3, 12:24 pm, fulatoro <mus...@gmail.c omwrote:
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
6038
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 Xml.XmlNode object. When I test the web services using IE, I receive the XML data I want. But when I use MSSOAPLib.soapClient in MS Access, I got an error of “Wrong number of arguments or invalid property assignment.” I don't think this was...
1
18426
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") But I am getting the following error when the script is run: Microsoft VBScript runtime (0x800A01AD) ActiveX component can't create object: 'MSSOAP.SoapClient'
3
2302
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 ! Thanks Paul
1
3611
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 request XML which causes the problem in getting response from the service. Request XML generated by SoapClient: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://abc.com/GBTSTo/GBTSTReq/01"...
0
4760
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 http://www.schlossnagle.org/~george/blog/index.php?/archives/235-Salesforce.com-and-PHP.html ) To acheive this, I subclass SoapClient and overwrite the __doRequest() method. According to the PHP documentation and the article above, the
4
14239
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 me fuming mad. The two methods are "GetSessionToken" which expects two strings, and "SetProjectData" which expects XML wrapped in a CDATA tag. My problem is that the XML I pass to SetProjectData is being escaped by the PHP SoapClient and I don't...
11
21815
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? Currently I am creating a $string full of CDATA and XML tags. But when I pass this to the webservice, the CDATA and XML tags are escaped and lose their meaning. $client = new SoapClient("my.wsdl",array("trace"=>1)); $string = "<! ]>";...
1
2524
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 and then SoapClient->call() fails with some ugly messages containing PHP code. Is it possible to do something like try {
0
1266
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 them via SoapClient._cookies. If you call something like SoapClient__setCookie("testkey","testvalue") the result is an array with the name "testkey" and one element, the given "testvalue". But I could not find out how I can give more than one...
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.