soap-client

SoapClient: how to pass multiple elements with same name?

妖精的绣舞 提交于 2019-11-28 09:21:58
I have following code: $telnums = array(10, 20, 30); $obj = new StdClass(); $obj->telnums = new StdClass(); foreach ($telnums as $telnum) { $obj->telnums = $telnum; } call_user_func(array($this->client, 'createDomain'), new SoapVar($obj, SOAP_ENC_OBJECT)); There $this->client is an instance of SoapClient class. And it generates following request: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="..."> <SOAP-ENV:Body> <ns1:createDomain> <createDomainRequest> <telnums>30</telnums> </createDomainRequest> </ns1:createDomain> </SOAP-ENV:Body> </SOAP-ENV

PHP SOAP Transferring Files

可紊 提交于 2019-11-28 09:19:22
I am trying to learn how to transfer files (.zip files) between a client and server using PHP and SOAP. Currently I have a set up that looks something like this: require('libraries/nusoap/nusoap.php'); $server = new nusoap_server; $server->configureWSDL('server', 'urn:server'); $server->wsdl->schemaTargetNamespace = 'urn:server'; $server->register('sendFile', array('value' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:server', 'urn:server#sendFile'); But I am unsure on what the return type should be if not a string? I am thinking of using a base64_encode . Sayyed Abdul Subhan To be

Error fetching http headers in SoapClient

蹲街弑〆低调 提交于 2019-11-28 06:44:11
I'm trying to invoke a WS over https on a remote host:remote port and I get: Error fetching http headers using the PHP5 SoapClient; I can get the list of functions by doing $client->__getFunctions() but when I call $client->myFunction(...) I always get this error. I've googled and found that increasing default_socket_timeout in php.ini should fix it, but it did not work. Can anyone suggest me a solution? EDIT: here is the code: $wsdl="myWSDL"; $client = new SoapClient($wsdl,array('connection_timeout'=>5,'trace'=>true,'soap_version'=>SOAP_1_2)); var_dump($client->__getFunctions()); try {

PHP SoapClient Timeout

随声附和 提交于 2019-11-28 06:21:56
Is there anyway for a SoapClient Request to time out and throw an exception. As of now, I get PHP Server response timeout, in my case 60 seconds. Basically what I want is, if there isn't any reply from the Web Service within certain time, an exception would be thrown and I could catch it. The 60 seconds warning is not what I want. Andrei Serdeliuc ॐ Have a look at Timing Out PHP Soap Calls by Robert; 21 Oct 2009 if you are comfortable and your environment allows you to extend classes. It basically extends the SoapClient class, replaces the HTTP transport with curl which can handle the timeouts

How to pass an array into a PHP SoapClient call

那年仲夏 提交于 2019-11-27 22:18:50
Using PHP and SoapClient. I need to pass the following XML into a soap request - i.e. multiple <stay> 's within <stays> . <reservation> <stays> <stay> <start_date>2011-01-01</start_date> <end_date>2011-01-15</end_date> </stay> <stay> <start_date>2011-01-16</start_date> <end_date>2011-01-30</end_date> </stay> </stays> </reservation> The problem is that I'm passing the data in as an array: $xml = array('reservation' => array( 'stays' => array( array( 'start_date' => '2011-01-01', 'end_date' => 2011-01-15 ), array( 'start_date' => '2011-01-16', 'end_date' => 2011-01-30 ) ) ); The above doesn't

Soapclient query a Sharepoint web service

梦想的初衷 提交于 2019-11-27 18:58:19
问题 I successfully query a service with the following code from here <?php $authParams = array("login" => "username", "password" => "password"); $listName = "{2882F083-8890-4ADA-A1FC-39ED1D63D825}"; $rowLimit = '150'; $wsdl = "http://localhost:89/list.wsdl"; $soapClient = new SoapClient($wsdl, $authParams); $params = array('listName' => $listName, 'rowLimit' => $rowLimit); $rawXMLresponse = null; try{ $rawXMLresponse = $soapClient->GetListItems($params)->GetListItemsResult->any; } catch(SoapFault

Inspect XML created by PHP SoapClient call before/without sending the request

我的未来我决定 提交于 2019-11-27 17:31:14
The question: Is there a way to view the XML that would be created with a PHP SoapClient function call BEFORE you actually send the request? background: I am new to WSDL communication, and I have a client who wants me to develop in PHP, a way to communicate with a WSDL service written in ASP.NET. I have gotten pretty far, but am running into an issue when it comes to passing a complex type. I have tried a couple of different things so far. 1) Setting up a single array such as $params->Person->name $params->Person->address 2) Setting up a single array $Person = array('name'=>"joe",'address' =

simple php SoapClient example for paypal needed

北慕城南 提交于 2019-11-27 15:24:35
问题 Could I get a simple example of using PHP's SoapClient class to make an empty call to Paypal with nothing but the version number? I have the correct WSDL url and server url, so that's not what I need help with. This is what I have: public function SOAPcall($function, $args=array()) { $args['Version'] = '63.0'; $args = new SoapVar($args, SOAP_ENC_ARRAY, $function.'_Request'); $args = array(new SoapVar($args, SOAP_ENC_ARRAY, $function.'_Req', 'urn:ebay:api:PayPalAPI')); $results = $this-

How to add soap header when making a soap request using the java objects generated by wsdl

梦想的初衷 提交于 2019-11-27 14:25:36
问题 I generated client java objects using JAX-WS RI. I am trying to make a SOAP request to a web service. Service requires authentication in the header which looks like below: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <xsd:authHeader> <xsd:user>username@gmail.com</xsd:user> <xsd:password>password1</xsd:password> </xsd:authHeader> </soapenv:Header> <soapenv:Body> <ns:searchAssetsParam> <ns:includeSubfolders>true</ns:includeSubfolders> <ns

SOAP request with attribute

吃可爱长大的小学妹 提交于 2019-11-27 13:33:20
问题 I can not seem to find out how to set an attribute to a SOAP request without using the XSD_ANYXML encoding. The request parameter should look as follows <request xmlns:ns="/some/ns"> ... <ns:parameter attr="some attribute"> value </ns:parameter> ... </request> Of course the following code works, but it's rather ugly (ugly, because it uses string concatenation where it should use the SOAP_Client API and because it does not use the general namespace) $param = new SoapVar( '<ns_xxx:parameter