mercredi 22 juin 2016

PHP SOAP call parameters for GUID

I'm implementing a web service for one of my clients and the method requires 3 parameters (username, password) and an empty GUID which should be passed in as a reference. I've tried multiple options but cannot figure out what the issue is. Any ideas?

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <LogonAndRequestToken xmlns="">
       <username>string</username>
       <password>string</password>
       <guid>guid</guid>
     </LogonAndRequestToken>
   </soap:Body>
 </soap:Envelope>

I am using the following code at the moment:

       //$guid = "00000000-0000-0000-0000-000000000000";
       if($this->utilities->ping()->PingResult->ErrorCode == 0) {
           pr($this->utilities->LogonAndRequestToken(array("username" => "username", "password" => "pass", "guid" => 00000000-0000-0000-0000-000000000000)));
       }
       exit;

pr() is a shorthand function for print_r() and I have tried the GUID as is now and also the commented out version. With the version now I get an exception thrown that the GUID is not the correct format and the commented out one gives a response from the server but indicates that there is a 10001 error (technical error and that I should contact support). As I am convinced the username and password is correct I am sure I'm missing something. Any help would be appreciated thank you!

Here is some more info:

From the service description:

 <s:complexType>
      <s:sequence>
           <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/>
           <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
           <s:element minOccurs="1" maxOccurs="1" name="guid" type="s1:guid"/>
      </s:sequence>
 </s:complexType>

I also tried the following option: array(...,"guid" => &$guid)

Aucun commentaire:

Enregistrer un commentaire