Здравствуйте, я получаю сообщение об ошибке
(-<OrderUpdateReply>-<Error><ErrorDescription>There is no Unicode byte order mark. Cannot switch to Unicode.</ErrorDescription></Error></OrderUpdateReply>
, когда я пытаюсь выполнить этот блок кода: XSD - это UFT-8 - есть идеи?
private async Task<string> UpdateOrder(string accountName, string password, string userName)
{
string XMLstring = UpdateOrderXML(accountName, password, userName);
StringContent stringcontent = new StringContent(XMLstring);
stringcontent.Headers.ContentType.MediaType = "text/XML";
HttpResponseMessage response = await http.PostAsync("https://www.mywebsite.com/shared/xml/orderupdate.rest", stringcontent);
/*string for response*/
string ResponseString = await response.Content.ReadAsStringAsync();
XmlDocument xml = new XmlDocument();
xml.LoadXml(ResponseString);
================================================ ============================================= Строка ответа выглядит следующим образом: Я отмечаю XSD такое UTF-8, но строка ответа UTF-16 - как исправить?
Строка ответа
under return XMLstring
<?xml version="1.0" encoding="UTF-16"?>
<OrderUpdateRequestModel xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OrderUpdate>
<OrderNo>102329</OrderNo>
<StatusUpdate>
<Status>Shipped</Status>
<TrackingNumber>1234567890</TrackingNumber>
</StatusUpdate>
<BillingStatusUpdate>
<BillingStatus>Billed</BillingStatus>
</BillingStatusUpdate>
<ShippingOptionsUpdate>
<ShipRate>25</ShipRate>
</ShippingOptionsUpdate>
<CommentsUpdate>
<CustomerComments>Sage ERP Invoice No.</CustomerComments>
</CommentsUpdate>
<SalesTaxUpdate>
<SalesTaxRate>5</SalesTaxRate>
</SalesTaxUpdate>
</OrderUpdate>
</OrderUpdateRequestModel>
xml returned on error:
<?xml version="1.0" encoding="UTF-8"?>
<OrderUpdateReply>
<Error>
<ErrorDescription>There is no Unicode byte order mark. Cannot switch to Unicode.</ErrorDescription>
</Error>
</OrderUpdateReply>
this is the header for the xsd file:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="OrderUpdateRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="DataTypes.xsd" />
<xs:element name="OrderUpdateRequest">