views:

39

answers:

2

I am having trouble calling a 3rd party web-service. I have not received a SOAP fault, but am not getting a valid resultset. A colleague of mine has written a client in RPG on the OS400 and it returns a valid resultset. When comparing the RAW request in Fiddler2 for both requests, the only glaring difference I noticed was that my c# client had SOAP xml elements with xmlns="" and his did not. Is it possible to remove said empty namespace declarations? Please see the referenced SOAP request below:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
        <SendArchitectServiceRequest xmlns="archserver.xsd.dataflux.com">
            <serviceName xmlns="">AddressVerify.dmc</serviceName>
            <fieldDefinitions xmlns="">
                <fieldName>AddressLine_1</fieldName>
                <fieldType>STRING</fieldType>
                <fieldLength>255</fieldLength>
            </fieldDefinitions>
            <fieldDefinitions xmlns="">
                <fieldName>AddressLine_2</fieldName>
                <fieldType>STRING</fieldType>
                <fieldLength>255</fieldLength>
            </fieldDefinitions>
            <fieldDefinitions xmlns="">
                <fieldName>City_in</fieldName>
                <fieldType>STRING</fieldType>
                <fieldLength>255</fieldLength>
            </fieldDefinitions>
            <fieldDefinitions xmlns="">
                <fieldName>State_in</fieldName>
                <fieldType>STRING</fieldType>
                <fieldLength>255</fieldLength>
            </fieldDefinitions>
            <fieldDefinitions xmlns="">
                <fieldName>Zip</fieldName>
                <fieldType>STRING</fieldType>
                <fieldLength>255</fieldLength>
            </fieldDefinitions>
            <fieldDefinitions xmlns="">
                <fieldName>Country</fieldName>
                <fieldType>STRING</fieldType>
                <fieldLength>255</fieldLength>
            </fieldDefinitions>
            <dataRows xmlns="">
                <value>3485 W. Harmon Ave.</value>
                <value/>
                <value>Las Vegas</value>
                <value>NV</value>
                <value>89103</value>
                <value>United States</value>
                <reserved>0</reserved>
            </dataRows>
        </SendArchitectServiceRequest>
    </s:Body>
</s:Envelope>
A: 

Since I have not heard any comments or answers to my second question, I will accept the answer I came across which was altering the auto-generated Reference.cs class XML element declarations from [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] to [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified)].

Ben.Vineyard
+1  A: 

Your proposed method seems like the easiest approach. One other approach would be to use SOAP extensions to modifiy the SOAP response, removing the empty xmlns attribute. You would modify the SoapClientMessage in the BeforeDeserialize stage of the SoapMessageStage.

Garett