php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74984 [Client] SOAP-ERROR: Encoding: object has no XXX property
Submitted: 2017-07-25 03:03 UTC Modified: 2017-07-25 03:31 UTC
From: peter_liang at vtech dot com Assigned:
Status: Closed Package: SOAP related
PHP Version: 7.0.21 OS: CentOS 7.3
Private report: No CVE-ID: None
 [2017-07-25 03:03 UTC] peter_liang at vtech dot com
Description:
------------
When I call a webservice, it works on Java and SoapUI, fails in PHP.
Java & SoapUI return a list, PHP return a stdClass with nothing.

// SoapUI
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="#namespace#">
   <soapenv:Header/>
   <soapenv:Body>
      <man:fetchCustomerDevices>
         <caller-id>#called-id#</caller-id>
         <customer-id>#customer-id#</customer-id>                  
      </man:fetchCustomerDevices>
   </soapenv:Body>
</soapenv:Envelope>

// Java  
service.fetchCustomerDevices(
        #called-id#, 
        new BigInteger(#customer-id#), 
        null, 
        false);
			
// PHP
$arguments = 
    array(
        'caller-id' => '#called-id#',
        'customer-id' => #customer-id#,
        'device-serial' => null,
        'sendEmail' => false
    );

$soapClient = new \SoapClient($wsdl, null);
$result = $soapClient->fetchCustomerDevices($arguments);



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-25 03:31 UTC] peter_liang at vtech dot com
-Status: Open +Status: Closed
 [2017-07-25 03:31 UTC] peter_liang at vtech dot com
I change the PHP SoapUI call as follow, the issue resolves.

$arguments = array ();
$arguments[] = new SoapVar("#caller-id#",XSD_STRING,null,null, "caller-id");
$arguments[] = new SoapVar(#customer-id#,XSD_INTEGER,null,null, "customer-id");
$soapClient = new \SoapClient(#WSDL#, null);
$result = $soapClient->fetchCustomerDevices(new SoapVar($arguments,SOAP_ENC_OBJECT));

Thus I closed the bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC