3

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?

1
  • Please post the complete exception. Catch the exception and post the result of ex.ToString(). Commented Jul 22, 2009 at 3:25

4 Answers 4

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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?

Comments

1

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.