Answer the question
In order to leave comments, you need to log in
What does the error that the SOAP client displays mean?
Hello.
Unable to get data from SOAP server.
Throws an error:
Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'Type' property
Client code:
<?php
$client = new SoapClient(
'http://89.208.141.8/CargoMSK/ws/Cargo3WS.1cws?wsdl',
array(
'login' => "web", // логин
'password' => "web", // пароль
)
);
$a = array(
'login' => 'login',
'password' => 'password',
'documents' => array(
'Key' => 'Documents',
'Properties' => array(
'Key' => 'DocumentType',
'Value ' => 'Order',
'ValueType' => 'string',
),
'List' => array(
array('Key' => '00-00000497004')
)
),
'parameters' => array(
'Key' => 'Parameters',
)
);
$d = $client->Tracking($a);
print_r($d);
?>
Answer the question
In order to leave comments, you need to log in
Read wsdl. We find the required request.
<operation name="Tracking">
<input message="tns:TrackingRequestMessage"/>
<output message="tns:TrackingResponseMessage"/>
</operation>
<message name="TrackingRequestMessage">
<part name="parameters" element="tns:Tracking"/>
</message>
<xs:element name="Tracking">
<xs:complexType>
<xs:sequence>
<xs:element name="Language" type="xs:string" nillable="true"/>
<xs:element name="Login" type="xs:string" nillable="true"/>
<xs:element name="Password" type="xs:string" nillable="true"/>
<xs:element name="Type" type="xs:string"/>
<xs:element name="Documents" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
$result = $client->Tracking([
'Language' => ?string,
'Login' => ?string,
'Password' => ?string,
'Type' => string,
'Documents' => ?string
]);
var_dump($client->__getFunctions());
/* ...
[92] => string(47) "TrackingResponse Tracking(Tracking $parameters)"
... */
var_dump($client->__getTypes());
/* ...
[120] => string(103) "struct Tracking {
string Language;
string Login;
string Password;
string Type;
string Documents;
}"
[121] => string(51) "struct TrackingResponse {
ResultTracking return;
}"
[24] => string(81) "struct ResultTracking {
TrackingInfo Items;
boolean Error;
string ErrorInfo;
}"
[28] => string(227) "struct TrackingInfo {
boolean Error;
string Type;
string Number;
string Info;
string AgentURL;
dateTime CreateDate;
string State;
dateTime DeliveryDate;
string DeliveryInfo;
TrackingEvent History;
Waybill Waybills;
}"
[27] => string(83) "struct TrackingEvent {
dateTime EventDate;
string EventName;
string EventInfo;
}"
[31] => string(546) "struct Waybill {
string Type;
string Number;
dateTime CreateDate;
string State;
dateTime DeliveryDate;
string Sender;
string SenderGeography;
string Recipient;
string RecipientGeography;
string RecipientAddress;
dateTime SendDate;
string Payer;
int CargoQty;
float NetWeight;
float GrossWeight;
string ConsolidationNumber;
string InventoryWaybillNumber;
string DeliveryMethod;
float Volume;
boolean RequirePaymentInCash;
float PaymentInCash;
string PaymentInCashCurrency;
string RecipientOfficial;
TrackingEvent History;
}"
... */
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question