Search code examples
phpwsdllighttpd

Error when calling wsdl method with php


I have a problem with the Akamai API.

I've used this system (http://www.wsdltophp.com/) to convert the WSDL to objects in PHP. I did it since I was having problems doing by hand. But the problem still remains:

One method the WSDL service have is deleteStreamEvent, and it receives two parameters: streamId and eventName. So the call is:

$soapClient->deleteStreamEvent(array ('streamId' => $id, 'eventName' => 'name'));

But the problem is that it sends this XML to the server:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="https://control.akamai.com/ArchiveManagementService.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
    <env:Body>
        <ns1:deleteStreamEvent env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
            <streamId xsi:type="xsd:int">1</streamId>
            <eventName xsi:nil="true"/>
        </ns1:deleteStreamEvent>
    </env:Body>
</env:Envelope>

So, as you can see it allwasy change every number I sent to "1". Why is this happening? This is the first time I see this strange behaviour...

I'm using PHP 5.3 with lighttpd server.


Solution

  • I've found the problem...

    In the call:

    self::getSoapClient ( )->deleteStreamEvent ( array ( 'streamId' => $_streamId, 'eventName' => $_eventName ) )
    

    I've to change it to:

    self::getSoapClient ( )->deleteStreamEvent ( $_streamId, $_eventName )
    

    :D I hope this can help anyone else...

    Thanks!