Forum Discussion

Wilco_Schreurs's avatar
Wilco_Schreurs
New Contributor
15 years ago

SOAP-ERROR: Encoding: Violation of encoding rules

I'm using SoapUI 3.0.2 to test a new (PHP) webservice client and server that we are building.
I also used the mock service option in SoapUI, to be able to test the new client for functionality that is not yet supported by the new server. I think that's great, SoapUI even generates example responses.

However, with one of the example responses I get an error.

Fatal error: Uncaught SoapFault exception: [Sender] SOAP-ERROR: Encoding: Violation of encoding rules

It took me hours to find out the cause of the problem, so I like to share it with you.

In the WSDL we defined some (optional) numeric attributes (xsd:integer). It turns out that the mock service response generation functionality creates responses that contain example values in these attributes.
The example value generated is "?", and that is not an integer value. Changing it to value "1" for example solves the problem.

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Thanks for sharing! There is a gobal setting in the WSDL Preferences tab that makes soapUI generate sample values of the correct type instead of just '?'.. maybe that would help?

    regards!

    /Ole
    eviware.com