note 103439 modified in book.soap by danbrown
| From: | danbrown@php.net | Date: | Wed, 13 Apr 2011 17:10:19 +0000 |
| Subject: | note 103439 modified in book.soap by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178802@lists.php.net to get a copy of this message | ||
I needed to perform SOAP actions and get information from a Windows ASP.NET server and encountered
many errors along the way.
At first I had it solved with NUSOAP, and sending my own XMLs with it, but then when I needed to use
SSL it failed again.
So I went back to a regular SoapClient (as opposed to nusoap_client) and now I am using the WSDL
defined functions ($client->function($params)).
The ASP.NET server I'm consuming is quite strange, the WSDL definition does not define the
parameters I need to send, they only define one parameter and they expect me to send another XML
within that.
So here's my solution, in case it helps anyone:
$params['trace'] = true;
$client = new soapclient('https://www.example.com/WebService.asmx?WSDL',
$params);
$msg['AccountData']['any'] =
"<somexml></somexml><otherxml></otherxml>";
$client->Function($msg);
$resulta = xml2array($client->__getLastResponse());
--was--
I needed to perform SOAP actions and get information from a Windows ASP.NET server and encountered
many errors along the way.
At first I had it solved with NUSOAP, and sending my own XMLs with it, but then when I needed to use
SSL it failed again.
So I went back to a regular SoapClient (as opposed to nusoap_client) and now I am using the WSDL
defined functions ($client->function($params)).
The ASP.NET server I'm consuming is quite strange, the WSDL definition does not define the
parameters I need to send, they only define one parameter and they expect me to send another XML
within that.
So here's my solution, in case it helps anyone:
$params['trace'] = true;
$client = new soapclient('https://www.myserver.xom/WebService.asmx?WSDL',
$params);
$msg['AccountData']['any'] =
"<somexml></somexml><otherxml></otherxml>";
$client->Function($msg);
$resulta = xml2array($client->__getLastResponse());
http://php.net/manual/en/book.soap.php