.net - XmlTypeAttribute does not change name of type -
I am working on a project that makes a web service call using WSE3. Originally used VS2005, has been modified over time. Now, I have to change the name of the type in the SOAP message. I have collected that should be done using XmlTypeAttribute, but that does not affect the type name as an experiment, I used XmlElementAttribute on that property of that class, and changed the name of the generated element for that property. The generated item has been extended using partial orbits.
The SOAP type comes across the "address" across the wire. I'm not sure why XmlTypeAttribute is not affecting it, or why it's coming in less case.
What could be wrong, or a better way of accomplishing the goal?
References.cs:
[System.CodeDom.Compiler.GeneratedCodeAttribute ("System.Xml", "2.0.50727.1434")] [System. SerialableAttit ()] [System.ComponentModel .DesignerCategoryAttribute ("code")] [System.Xml.Serialization.XmlTypeAttribute (TypeName = "MyAddress", Namespace = "http://sample.com/transaction")] ^ // ^ - Soap type name "address", not "MyAddress" public partial class address {Private string address1Field; Private string address2Field; Private string [] court field; Private Systems Datetime Fixed Depositfiled; Haldata Field of Private Bull was specified; /// & lt; Comment / & gt; Expected Public Virtual String Address1 {get {return} address1Field [System.Xml.Serialization.XmlElementAttribute ("MyAddress1", form = System.Xml.Schema.XmlSchemaForm.Unqualified)] // ^ "named SOAP element" MyAddress1 " ;} Set {this.address1Field = value;}} /// & lt; / Comment [> System.Xml.Serialization.XmlElementAttribute ("address2", form = System.Xml.Schema.XmlSchemaForm.Unqualified)] Public Virtual string address2 {get {return this.address2Field;} set {this.address2Field = value;}}}
address.cs:
public partial Category Address {Private Private ID; Public Virtual Ent ID} Return ID;} set {id = value;}}}}
[ XmlType]
changes the name of the complex type
in the schema does not change the element names in the XML.
Instead of [XmlElement (name = Use "MyAddress", Namespace = "Your namespace")]
.
Comments
Post a Comment