I recently re-wrote a WCF service for a client. Their previous service was on .NET 3.5 and I cleaned up the code and upgraded to 4.5.2.
Functionally, the service works, but I'm having trouble with some aspects of the message format not matching up.
When I use the WCF service client to test the service, I get a message with the following structure:
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://XXXXX.com/XXXXX/service/v1_0/IXXXXXInterfacePort/GetRates</a:Action>
<a:MessageID>urn:uuid:071db031-f492-42f5-89e6-fb4a321c81c9</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetRatesIP xmlns="http://XXXXX.com/XXXXX/service/v1_0">
<ShipmentHeader xmlns="">
<ShipmentID>XXXXX</ShipmentID>
<Zipcode>XXXXX</Zipcode>
</ShipmentHeader>
<ShipmentItemsList xmlns="">
<ShipmentItems>
<quantity>10</quantity>
<sku>XXXXX</sku>
<freeShipping>true</freeShipping>
</ShipmentItems>
</ShipmentItemsList>
</GetRatesIP>
</s:Body>
But when the client puts the service into test, the message structure coming from the client looks like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetRatesIP xmlns="http://XXXXX.com/XXXXX/service/v1_0">
<ShipmentHeader xmlns="">
<ShipmentID>XXXXX</ShipmentID>
<Zipcode>XXXXX</Zipcode>
</ShipmentHeader>
<ShipmentItemsList xmlns="">
<ShipmentItems>
<quantity>10</quantity>
<sku>XXXXX</sku>
</ShipmentItems>
</ShipmentItemsList>
</GetRatesIP>
</soap:Body>
</soap:Envelope>
Data wise, everything seems OK. My version has a free shipping attribute, but from what I can see this is treated as optional by the service and should be OK if it is missing. At any rate, the client claims that even though it's in the code the value has never been sent by the service client, even though it's mentioned in their code.
My guess is that the service is having trouble with the "soap:Envelope ..." style versus the "s:Envelope ..." style. I used the exact same service contracts. The existing code was using the XML serializer as opposed to the data contract serializer, but again I copied the attributes (Serializable, XmlType, XmlArray, XmlArrayItem, etc.) and the MessageContract attributes exactly from the existing code. Looked at the config on the server, nothing looked wrong there. Working on getting the client side config, but not expecting it to shed any light.
Anybody have any idea what could be going on here? I've been (and will continue) to look on the Internet, but I'm not finding an answer. My luck, it's some weird, obscure flag set somewhere in the bowls of Visual Studio/WCF that just need to be flipped.
Thanks, James