VS 2019 VB.NET and c#
I have a web service that calls another web service. The provider web service returns an array of objects. The consumer web service tries to assign the results of the call to a variable and throws an error:
Hexadecimal value 0x00 is a invalid character, line 1, position nnnnn
Note I do not convert the results to or from xml, the 'system' is doing that.
I checked the data and while complex it is fine. I found through trial and error that if I remove a single field that happens to be set to Nothing it works (there are hundreds of fields and many are nothing). I can see nothing special about the field I removed. So it sounds buggy.
I was thinking it might be a unicode issue so I added a globalization entry to the provider web service web.config:
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
Which had no effect.
So I have an array of objects (I simplified it to a count of 1, still get the error) that I am trying to return and somewhere between return statement in the provider web service and the assignment of the results to a variable in the consumer web service I'm getting bad xml.
I suppose I could convert it to xml myself, ensuring it is valid, and serve that, but it seems like it should work as is.
Any ideas on how I can track this down?
ADDENDUM
Should have made this a bit more clear. I'm returning an array of user defined objects from a web method, so the data is serialized into a XML SOAP response. If I use postman to look at the response the soap xml response is valid, however when a remote service calls the web method I see this error. So first I'm not sure where the error is being introduced...it does not look like the web method is at fault, postman can call it and get valid xml. But my other program, that happens to be a web service as well, presumably gets bad xml from the request.