views:

520

answers:

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?

A: 

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.

Luis
A: 

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?

Mehmet Aras
A: 

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.

teebot.be