I am having some problems encoding the char (unitType). Below is the example request from the .NET wdsl page. I need to know what format to encode the character into, because putting it straight into the XML does not work. Does .NET (3.5) SOAP require some specific format?
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<DiagnosticAnalysis xmlns="http://www.somewhere.com/">
<tuple>int</tuple>
<unitID>int</unitID>
<unitType>char</unitType>
</DiagnosticAnalysis>
</soap12:Body>
</soap12:Envelope>
Passing in something like <unitType>L</unitType> does not work, and gives me the error below:
There is an error in XML document (7, 37). —> Input string was not in a correct format.
charis serialized as a number (int) by theXmlSerializer. Since it appears you are trying to build the XML from scratch, try setting the XML to<unitType>76</unitType>(76 is the value forL).I tested using the following code in LinqPad:
Output is: