W
W
wreofcccp2018-05-23 19:03:33
PHP
wreofcccp, 2018-05-23 19:03:33

Why is no value passed to the __soapCall() parameter?

The following error occurs:
Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'documentType' property
PHP code:

$location = 'https://...'; 

$client = new SoapClient($location);

$RequestParameters = new SoapParam(array("EdiParameter" =>
       array(
        "name"  => "LastWebID",
        "value" => "0",
       )), "EdiParameter");
       
$RequestIdentify = new SoapParam(array(
    "npo"  	 => $npo,
        "userName" => $userName,
        "password" => $password), "identify");	 

$Status_Order = "NEW_ORDER";

$params = array("identify" 	 => $RequestIdentify, 
                "documentType" => $Status_Order, 
                "parameters"   => $RequestParameters);

$response = $client->__soapCall('DRS', $params);

var_dump($response);

Scheme:
...
<s:element name="DRS">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="identify" type="tns:Identify"/>
<s:element minOccurs="1" maxOccurs="1" name="documentType" type="tns:EdiType"/>
<s:element minOccurs="0" maxOccurs="1" name="parameters" type="tns:ArrayOfEdiParameter"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="Identify">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Npo" type="tns:Npo"/>
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string"/>
</s:sequence>
</s:complexType>
<s:simpleType name="Npo">
<s:restriction base="s:string">
<s:enumeration value="LCNP"/>
</s:restriction>
</s:simpleType>
<s:simpleType name="EdiType">
<s:restriction base="s:string">
<s:enumeration value="NEW_ORDER"/>
<s:enumeration value="ORDER_REPLY"/>
</s:restriction>
</s:simpleType>
...

I can not understand, I am passing a string, please tell me what is the problem.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Trolzen, 2018-08-17
@Trolzen

Probably, the stock value "NEW_ORDER" should also be wrapped in `new SoapParam()`.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question