I use the .wsdl file and svcutil.exe to generate related .cs File, The generated .cs File is like the following:
public partial class mytargettype {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace = "", Order = 0)]
[System.Xml.Serialization.XmlArrayAttribute()]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] prop1;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace = "", Order = 1)]
[System.Xml.Serialization.XmlArrayAttribute()]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] prop1;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace = "", Order = 2)]
[System.Xml.Serialization.XmlArrayAttribute()]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] prop3;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace = "", Order = 3)]
[System.Xml.Serialization.XmlArrayAttribute()]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public System.Nullable<int>[] prop4;
}
The related part of .wsdl file is :
<wsdl:message name="mytargettype">
<wsdl:part name="prop1" type="ns1:stringArray" />
<wsdl:part name="prop2" type="ns1:stringArray" />
<wsdl:part name="prop3" type="ns1:stringArray" />
<wsdl:part name="prop4" type="ns1:intArray" />
</wsdl:message>
So, I need the generated .cs file be like:
[System.ServiceModel.MessageBodyMemberAttribute(Namespace = "", Order = 2)]
[System.Xml.Serialization.XmlArrayAttribute(Namespace = "http://jaxb.dev.java.net/array")]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] prop3;
As you see I need the XmlArrayAttribute
have Namespace parameter,
what change need Add to .WSDL File that caused the .cs file be like the above.