SOAP-ERROR: Encoding: Violation of encoding rules?

前端 未结 11 521
夕颜
夕颜 2021-01-02 03:42

Guys, I\'m stuck, banging my head off the desk for the past few hours.

I am trying to consume a service, and I have 8 other functions that I call that are almost IDE

11条回答
  •  再見小時候
    2021-01-02 04:05

    It looks like you have a type mismatch somewhere, either while assembling your request (one of the parameters is not of type string), or the server returns something other than an int (violating the WSDL response definition and thus causing the client to consider the response invalid, as it expects something else).

    • To test the first case, ensure casting all parameters to string first
    • To test the second case, create your SoapClient with the trace option set to true in order to gain access to the actual XML answer from the server via $client->__getLastResponse() afterwards (You can use this for request debugging also via __getLastRequest()).

    Some additional observations/questions:

    • According to the posted WSDL, the 'CanLoadProductRequest' has a fifth param 'esn', which you do not supply in your function call.
    • Any reason why you use $client->__soapCall("CanLoadProduct", $params) instead of $client->CanLoadProduct($username, $password, etc.)? (The first version is a lower level variation which is intended to be used for non_WSDL scenarios. The second version might give you a more detailed error/exception)
    • Can you test the SOAP Call to CanLoadProductRequest by some other means? The error could be on the server side, trying to return a result type that does not fit the WSDL definition.

提交回复
热议问题