Closed hhuutan closed 5 years ago
My latest commit lost the order of things. Let me see what I can do.
Can you paste your code showing me how you make your request please?
My temporary solution is using [XmlElementAttribute(Order = ... )] above each public property in Objects class and it works well. My code example:
/// <remarks/>
[XmlElementAttribute(Order = 1)]
public CustomerRef CustomerRef
{
get
{
return this.customerRefField;
}
set
{
this.customerRefField = value;
}
}
/// <remarks/>
[XmlElementAttribute(Order = 2)]
public ClassRef ClassRef
{
get
{
return this.classRefField;
}
set
{
this.classRefField = value;
}
}
/// <remarks/>
[XmlElementAttribute(Order = 3)]
public TemplateRef TemplateRef
{
get
{
return this.templateRefField;
}
set
{
this.templateRefField = value;
}
}
/// <remarks/>
[XmlElementAttribute(Order = 4)]
public DATETYPE TxnDate
{
get
{
return this.txnDateField;
}
set
{
this.txnDateField = value;
}
}
/// <remarks/>
[XmlElementAttribute(Order = 5)]
[System.ComponentModel.DataAnnotations.StringLength(11)]
public string RefNumber
{
get
{
return this.refNumberField;
}
set
{
string temp = QbNormalizer.NormalizeString(value, 11);
this.refNumberField = temp;
}
}
/// <remarks/>
[XmlElementAttribute(Order = 6)]
public BillAddress BillAddress
{
get
{
return this.billAddressField;
}
set
{
this.billAddressField = value;
}
}
/// <remarks/>
[XmlElementAttribute(Order = 7)]
public ShipAddress ShipAddress
{
get
{
return this.shipAddressField;
}
set
{
this.shipAddressField = value;
}
}
Can you please provide the code you use to make the request. The framework you use as well?
I cannot repro the problem, so I need the code you used to make the problem happen. Not the solution.
And tell me which framework you are using please...
I'm using .net core 2.2 in my web project
Hey, my lastest test in your sample was passed but in my project with .net core 2.2 was failed. This is probably the main reason. So sorry
There is a problem with .NET Core 2.2 We will have to fix this.
I'm trying to create a Sales Order but receive message: QuickBooks found an error when parsing the provided XML text stream. This is my XML:
The reason is the order of fields is not match. For example, in your request the first tag should be CustomerRef, then RefNumber, after BillAddress etc. So here is a correct version of the request:
How to fix it in the code?