I have this WSDL: https://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx?WSDL
I am trying to use SoapClient to send a request to the CustomerSearch method.
The code I use is as follows:
$url = 'https://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx?WSDL'; $client = new SoapClient($url); $CustomerSearch = array( 'AuthorID' => $authorID, 'UserID' => $userID, 'UserPassword' => $userPassword, 'Email' => $customerEmail ); $xml = array('CustomerSearch' => $CustomerSearch); $result = $client->CustomerSearch(array('xml' => $xml));
When I run the code, I get the following PHP exception:
Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'any' property
I also tried this for XML:
$xml = " <?xml version=\"1.0\" encoding=\"utf-8\"?> <CustomerSearch> <AuthorID>$authorID</AuthorID> <UserID>$userID</UserID> <UserPassword>$userPassword</UserPassword> <Email>$customerEmail</Email> </CustomerSearch> ";
Which gives me the following results (from print_r):
object(stdClass)#4 (1) { ["CustomerSearchResult"]=> object(stdClass)#5 (1) { ["any"]=> string(108) "-2Invalid Xml Document" } }
The documentation says that the input XML should look something like this:
<CustomerSearch> <AuthorID></AuthorID> <UserID></UserID> <UserPassword></UserPassword> <SearchField></SearchField> <SearchField></SearchField> </CustomerSearch>
I'm new to Soap and I tried messing around (going through raw, printed XML) and it seems like it can't get this to work. Any understanding of what I may be doing wrong would be greatly appreciated.
Axel source share