Reputation: 1100
Does anybody know how I can troubleshoot web services responses? When I get my soap message back from a web service call I get this error "The string '' is not a valid AllXsd value" as soon as it's a value type like a datetime per example.
My proxy classes are generated from wsdl's using wsdl.exe, the wsdl seems valid. I have seen nothing wrong in the proxy classes (specified values are generated, datetime is nullable).
I have tried netmon to see the soap envelopes on the wire but everything seems normal.
Can you think of other ways to troubleshoot this? or maybe a clue about what is going on here?
Upvotes: 3
Views: 2474
Reputation: 11957
My SOAP request was returning BadRequest because of this xsi:nil="true"
thing.
What fixed it was to add this to the top of the SOAP envelope:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.blahblahblah.com/myobjectdefinition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
I don't know why SoapUI didn't generate this bit, but anyway it fixed it for me.
Upvotes: 0
Reputation: 1100
Ok I found out what the problem was.
There is 2 ways for an element to be null in SOAP:
Either with the entire element missing Or with the argument xsi:nil="true" and no value
They fixed it by modifying their message with the first option. Since then I'm able to deserialize without problems.
Thank you for your answers.
Upvotes: 1
Reputation: 5374
Try Web Service Studio and hit your web service with that tool to see if it is having the same problem as your client. You may gather some clues. Is the web service your code? If it is, are you using asmx or WCF? are you using a DataContract serializer or XmlSerializer? Have you tried regenerating your client proxy?
Upvotes: 1
Reputation: 502
Do you have any documentation available on the web service? You report having this problem when you use datetime, verify the date is in the correct format date.ToString("yyyy-MM-dd");
or whatever your service is expecting.
Upvotes: 1