SOAP web service consumption, error while de-serializing value types

Does anyone know how I can fix web service responses? When I receive a message from soap back from a web service call, I get this error "String" is not a valid AllXsd value ", as soon as it is a value type, for example, datetime for example.

My proxy classes are generated from wsdl using wsdl.exe, wsdl seems valid. I did not see anything bad in proxy classes (given values ​​are generated, datetime is nullable).

I tried netmon to see soapy envelopes on a wire, but everything seems normal.

Can you come up with other ways to fix this problem? or maybe a hint about what's going on here?

+3
source share
4 answers

Well, I found out what the problem is.

In SOAP, there are 2 ways for an element:

Either with all the missing element Or with the xsi argument: nil = "true" and no value

They fixed it by changing their message first. Since then, I can deserialize without any problems.

Thank you for your responses.

+1
source

Do you have any documentation available on the web service? You are reporting this issue when using date and time, make sure the date is in the correct format date.ToString("yyyy-MM-dd");or whatever your service expects.

+1
source

Web Service Studio - , , ​​ , . . - ? , asmx WCF? DataContract XmlSerializer? ?

+1

SOAP BadRequest - xsi:nil="true" .
, SOAP:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

:

<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">

, SoapUI , .

0

Source: https://habr.com/ru/post/1712243/


All Articles