PHP – SOAP – WSDL: nessun deserializzatore trovato per deserializzare l'errore

Questo è il formato di file xml che devo usare:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soapenv:Body> <exec xmlns="CBWSCallEngine" soapenv:encodingStyle="http://xml.apache.org/xml-soap/literalxml"> <arguments> <CbOrderProduct> <Header> <EndpointNm>123456789</EndpointNm> <Certificaat>abcdef</Certificaat> </Header> <Detail> <EAN>9789460941726</EAN> <OrderReference>201406100527</OrderReference> <ClientId></ClientId> <ReadingMethods>D</ReadingMethods> <RetailerId></RetailerId> <License></License> <RentalUnits></RentalUnits> <RentalNumberOfUnits></RentalNumberOfUnits> </Detail> </CbOrderProduct> </arguments> </exec> </soapenv:Body> </soapenv:Envelope> 

questo è l'URL WSDL: https://tst.eboekhuis.nl/cbwebs/CBWSCallEngine?WSDL

each volta che provo, ottengo sotto il messaggio di errore:

Errore irreversibile: exception Uncaught SoapFault: [SOAP-ENV: Client] No Deserializer trovato per deserializzare un ': CbOrderProduct' usando lo stile di codifica 'null'. [Java.lang.IllegalArgumentException]

Ho provato SoapVar semplice come di seguito:

 $xml .= '<CbOrderProduct>'; $xml .= '<Header>'; $xml .= '<EndpointNm>123456</EndpointNm>'; $xml .= '<Certificaat>abcdef</Certificaat>'; $xml .= '</Header>'; $xml .= '<Detail>'; $xml .= '<EAN>9789460941726</EAN>'; $xml .= '<OrderReference>201406100527</OrderReference>'; $xml .= '<ClientId></ClientId>'; $xml .= '<ReadingMethods>D</ReadingMethods>'; $xml .= '<RetailerId></RetailerId>'; $xml .= '<License></License>'; $xml .= '<RentalUnits></RentalUnits>'; $xml .= '<RentalNumberOfUnits></RentalNumberOfUnits>'; $xml .= '</Detail>'; $xml .= '</CbOrderProduct>'; $client = new SoapClient( null, arrays( 'location' => 'https://tst.eboekhuis.nl:443/cbwebs/CBWSCallEngine', 'uri' => 'https://tst.eboekhuis.nl/cbwebs/CBWSCallEngine?WSDL', 'trace' => 1, 'use' => SOAP_LITERAL ) ); $params = new SoapVar($xml, XSD_ANYXML); $result = $client->exec($params); 

Inoltre ho provato come sotto che ho trovato su StackOverflow:

 class CbOrderProduct { var $Header; var $Detail; function __construct() { $this->Header = new stdClass(); $this->Detail = new stdClass(); } function setheader($endpoint,$Certificaat) { $this->Header->EndpointNm = $endpoint; $this->Header->Certificaat = $Certificaat; } function setdetail($ean,$orderreference,$clienid,$readingmethods,$retailerid,$License,$RentalUnit,$RentalNumberOfUnits) { $this->Detail->EAN =$ean; $this->Detail->OrderReference = $orderreference; $this->Detail->ClientId = $clienid; $this->Detail->ReadingMethods = $readingmethods; $this->Detail->RetailerId = $retailerid; $this->Detail->License = $License; $this->Detail->RentalUnit = $RentalUnit; $this->Detail->RentalNumberOfUnits = $RentalNumberOfUnits; } } class exec0Request { var $arguments; function __construct($arguments) { $this->arguments = $arguments; } } $order = new CbOrderProduct(); $order->setheader('123456','abcdef'); $order->setdetail('9789460941726','201406100527','','CR','','','',''); $request = new exec0Request($order); $client = new SoapClient("https://tst.eboekhuis.nl/cbwebs/CBWSCallEngine?WSDL"); $result = $client->exec(new SoapParam($request, "exec0Request")); 

nessuno di loro funziona. Ho provato diversi tipi di file xml.

qualcuno potrebbe farmi sapere qual è il problema?

 Finally I have solved this issue.. :) Below code will definitely work. $xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soapenv:Body> <exec xmlns="CBWSCallEngine" soapenv:encodingStyle="http://xml.apache.org/xml-soap/literalxml"> <arguments> <CbOrderProduct xmlns="http://www.cbonline.nl/xsd"> <Header> <EndpointNm>*********</EndpointNm> <Certificaat>***********</Certificaat> </Header> <Detail> <EAN>9789460941726</EAN> <OrderReference>1988763767</OrderReference> <ReadingMethods>D</ReadingMethods> <RetailerId>12345</RetailerId> </Detail> </CbOrderProduct> </arguments> </exec> </soapenv:Body> </soapenv:Envelope>'; $sUrl = 'https://tst.eboekhuis.nl/cbwebs/CBWSCallEngine?WSDL'; // set parameters $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$sUrl); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, arrays('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); $sOutput = curl_exec($ch); curl_close($ch); echo "<pre>"; print_r($sOutput);