I am trying to consume a PHP Soap service however I seem to have having trouble with a complex/abstract type.
This is the SOAP call generated using SOAP UI :-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lin="http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS">
<soapenv:Header/>
<soapenv:Body>
<lin:GetLineCharacteristics>
<lin:request>
<!--Optional:-->
<lin:UserCredentials>
<!--Optional:-->
<!--Optional:-->
<lin:Username>testUser</lin:Username>
<lin:Password>testPass</lin:Password><lin:AgentID>1234</lin:AgentID>
</lin:UserCredentials>
<lin:RequestDetails xsi:type="lin:TelephoneNumberRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<lin:TelephoneNumber>123456789</lin:TelephoneNumber>
</lin:RequestDetails>
<lin:UserConsent>Yes</lin:UserConsent>
<lin:ServiceType>MPF</lin:ServiceType>
</lin:request>
</lin:GetLineCharacteristics>
</soapenv:Body>
</soapenv:Envelope>
Here is my PHP code :-
$call = new StdClass();
$call->request = new StdClass();
$call->request->UserConsent = "Yes";
$call->request->ServiceType = "MPF";
$call->request->UserCredentials = new StdClass();
$call->request->UserCredentials->Username="testUser";
$call->request->UserCredentials->Password="testPass";
$call->request->UserCredentials->AgentID=1234;
$call->request->RequestDetails = new StdClass();
$call->request->RequestDetails->TelephoneNumber = "123456789";
$url = "https://llu.webservices.opalonline.co.uk/LineCharacteristicsWSV6/LineCharacteristicsWS.asmx?wsdl";
$client = new SoapClient($url, array('trace' => 1, exceptions=> 1,'soap_version' => SOAP_1_1));
$result = $client->GetLineCharacteristics($call);
echo $client->__getLastRequest();
echo $client->__getLastResponse();
When I run the code, the following error is generated :-
Fatal error: Uncaught SoapFault exception: [soap:Client] Server was unable to read request. ---> There is an error in XML document (2, 382). ---> The specified type is abstract: name='RequestType', namespace='http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS', at http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS'>. in /Users/jamesormerod/NetBeansProjects/fpdfDev/TestClass.php:23
Can anyone help?
$request->TelephoneNumberRequest->TelephoneNumber