PHP - SOAP - WSDL: No Deserializer found to deserialize Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmnclk
    New Member
    • Jun 2014
    • 2

    PHP - SOAP - WSDL: No Deserializer found to deserialize Error

    This is the xml file format I have to use:

    Code:
    <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>
    this is WSDL URL: https://tst.eboekhuis.nl/cbwebs/CBWSCallEngine?WSDL

    everytime I try, I get below error message:

    Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] No Deserializer found to deserialize a ':CbOrderProduc t' using encoding style 'null'. [java.lang.Illeg alArgumentExcep tion]

    I tried simple SoapVar like below:

    Code:
    $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,
        array(
            '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);
    Also I tried like below which I found on 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"));
    none of them work. I tried different type of xml files.

    could anyone let me know what the problem is?
    Last edited by Dormilich; Jun 18 '14, 07:09 AM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    why is there a Java error in your PHP?

    Comment

    • mmnclk
      New Member
      • Jun 2014
      • 2

      #3
      that's what service returns. I think they use java on their end. Not sure

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        It’s a problem on the other end. I’m not an Expert for SOAP, but it looks like your Request-XML is somewhat faulty. you should talk to their support.

        Comment

        Working...