PHP SOAP übergeben ComplexType parameter

Ich versuche zu rufen SOAP-service von meine-web-app. Ich erstelle ein soap-client ohne problem, aber ich habe ein problem beim Aufruf von SOAP-Methode GetCustomer. Ich bekomme followinf SOAP-Fehler

SOAP-ERROR: Encoding: object hasn't 'any' property.

Ich denke, das problem ist in der mitgelieferten Parameter. Die Parameter sind vom Typ ComplexType und ich bin nicht sicher, ob ich weitergeben rechten von PHP. Hier ist WSDL aus GetCustomer-Methode:

<s:element name="GetCustomer">
    <s:complexType>
        <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string"/>
            <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
            <s:element minOccurs="0" maxOccurs="1" name="xmlParams">
                <s:complexType mixed="true">
                    <s:sequence>
                        <s:any/>
                    </s:sequence>
                </s:complexType>
            </s:element>
        </s:sequence>
    </s:complexType>
</s:element>

Habe ich gefunden dieser Artikel, der dieses Problem behebt, wenn ich diese zu meinem code bekomme ich die obige Fehlermeldung. Hier ist mein PHP code:

$params = new StdClass();
$params->user = '****';
$params->password = '****';
$params->xmlParams = new StdClass();

$soap_options = array('trace' => 1, 'exceptions'  => 1 );
$wsdl = "https://web-icdev.saop.si/iCenter_WS/SAOPWS_Customer.asmx?WSDL";
$client = new SoapClient($wsdl, $soap_options);

try {
    $result = $client->GetCustomer($params);
    var_dump($result);
} 
catch (SOAPFault $f) {
    echo $f->getMessage();
}
InformationsquelleAutor Primoz Rome | 2012-12-07
Schreibe einen Kommentar