question

devel.arcad avatar image
0 Likes"
devel.arcad asked

all fields deserializing to null from response when using trading API and C# .NET

When I make a call to GetBestOffers through eBay's trading API, the call should return a GetBestOffersResponseType with the deserialized object. The issue is that for some reason the .NET framework is not deserializing the GetBestOffersResponseType; instead, the fields on the deserialized object are null for all the data given in the XML response. So, for an XML-formatted SOAP response like so: 2015-07-13T09:44:48.892Z Success 927 E927_CORE_API_17590338_R1 Seller 2193335 2015-07-15T01:42:34.000Z tmoney@gmail.com 500 1995-01-01T00:00:00.000Z testuser_anotheruser WA US 98102 400.0 Pending 5 BuyerBestOffer 500.0 110164745456 2015-07-15T01:42:34.000Z San Jose, California 1000 New 1 1 1 When the .NET framework tries to deserialize the object using the proxy classes generated from the wsdl at http://developer.ebay.com/webservices/latest/ebaysvc.wsdl , all the fields on the returned object are null. The generated code for a GetBestOffersResponseType is: [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public partial class GetBestOffersResponseType : AbstractResponseType { private BestOfferType[] bestOfferArrayField; private ItemType itemField; private ItemBestOffersArrayType itemBestOffersArrayField; private int pageNumberField; private bool pageNumberFieldSpecified; private PaginationResultType paginationResultField; /// [System.Xml.Serialization.XmlArrayAttribute(Order=0)] [System.Xml.Serialization.XmlArrayItemAttribute("BestOffer", IsNullable=false)] public BestOfferType[] BestOfferArray { get { return this.bestOfferArrayField; } set { this.bestOfferArrayField = value; this.RaisePropertyChanged("BestOfferArray"); } } /// [System.Xml.Serialization.XmlElementAttribute(Order=1)] public ItemType Item { get { return this.itemField; } set { this.itemField = value; this.RaisePropertyChanged("Item"); } } /// [System.Xml.Serialization.XmlElementAttribute(Order=2)] public ItemBestOffersArrayType ItemBestOffersArray { get { return this.itemBestOffersArrayField; } set { this.itemBestOffersArrayField = value; this.RaisePropertyChanged("ItemBestOffersArray"); } } /// [System.Xml.Serialization.XmlElementAttribute(Order=3)] public int PageNumber { get { return this.pageNumberField; } set { this.pageNumberField = value; this.RaisePropertyChanged("PageNumber"); } } /// [System.Xml.Serialization.XmlIgnoreAttribute()] public bool PageNumberSpecified { get { return this.pageNumberFieldSpecified; } set { this.pageNumberFieldSpecified = value; this.RaisePropertyChanged("PageNumberSpecified"); } } /// [System.Xml.Serialization.XmlElementAttribute(Order=4)] public PaginationResultType PaginationResult { get { return this.paginationResultField; } set { this.paginationResultField = value; this.RaisePropertyChanged("PaginationResult"); } } } Anybody had this problem before? Any ideas?
c# eaby api
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.