With this wsdl:
<xs:complexType name="GetItemResponseType">
...
<xs:complexContent>
<xs:extension base="ns:AbstractResponseType">
<xs:sequence>
<xs:element name="Item" type="ns:ItemType" minOccurs="0">
...
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="AbstractResponseType" abstract="true">
...
<xs:sequence>
...
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
Which generates this:
[System.Xml.Serialization.XmlIncludeAttribute(typeof(GetItemResponseType))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")]
public abstract partial class AbstractResponseType
{
///....
/// <remarks/>
[System.Xml.Serialization.XmlAnyElementAttribute(Order = 15)]
public System.Xml.XmlElement[] Any
{
get
{
return this.anyField;
}
set
{
this.anyField = value;
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.2.0-preview1.23462.5")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")]
public partial class GetItemResponseType : AbstractResponseType
{
// ...
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public ItemType Item
{
get
{
return this.itemField;
}
set
{
this.itemField = value;
}
}
}
When making a call an receiving a GetItemResponseType instance. Any is set with data that should be in Item. Changing the Order of the XmlElementAttribute does not effect the outcome, only solution is removing Any or moving it to GetResponseType.
Am I doing something wrong?
This is happening with the ebay trading api.
https://developer.ebay.com/webservices/latest/eBaySvc.wsdl
With this wsdl:
Which generates this:
When making a call an receiving a
GetItemResponseTypeinstance.Anyis set with data that should be inItem. Changing theOrderof theXmlElementAttributedoes not effect the outcome, only solution is removingAnyor moving it toGetResponseType.Am I doing something wrong?
This is happening with the ebay trading api.
https://developer.ebay.com/webservices/latest/eBaySvc.wsdl