I try to get live prices but get a error that says:
"Fjärrservern returnerade ett fel: (500) Internt serverfel. Response: The following exception was encountered when processing XML data: 'Data at the root level is invalid. Line 6, position 5.' at line 6 and position 5."
The request I send is:
<GetEcomData ExternalUserId="KT000002" AccessUserCustomerNumber="10000">
<tables>
<Products type="filter" unitPrices="true">
<Product>
<ProductId>PROD144</ProductId>
<ProductVariantId></ProductVariantId>
<ProductNumber>100795</ProductNumber>
<ProductIdentifier>100795..LANG1</ProductIdentifier>
<CurrencyCode>SE</CurrencyCode>
<Quantity>1</Quantity>
</Product>
</Products>
</tables>
</GetEcomData>
</request></Process></s:Body></s:Envelope>
The code I use is:
{
try
{
Endpoint endPoint = _endpointService.GetEndpointById(1);
endPoint.AuthenticationId = 4;
endPoint.Body = _endpointService.GetDynamicwebServiceSoapBody(endPoint, BuildSoapForPriceRequest(product, user));
endPoint.Body = HttpUtility.HtmlDecode(endPoint.Body);
endPoint.RequestType = EndpointRequestType.POST;
var response = _endpointService.Execute(endPoint);
XDocument responseXDocument = XDocument.Parse(response);
return 0;
}
catch (Exception ex)
{
Logger.Log($"GetLivePriceFromBc2() " + ex.Message);
return 0;
}
}
{
try
{
return $@"
<GetEcomData ExternalUserId=""{user.ExternalID}"" AccessUserCustomerNumber=""{user.CustomerNumber}"">
<tables>
<Products type=""filter"" unitPrices=""true"">
<Product>
<ProductId>{product.Id}</ProductId>
<ProductVariantId>{product.VariantId}</ProductVariantId>
<ProductNumber>{product.Number}</ProductNumber>
<ProductIdentifier>{product.Number}..{product.LanguageId}</ProductIdentifier>
<CurrencyCode>SE</CurrencyCode>
<Quantity>1</Quantity>
</Product>
</Products>
</tables>
</GetEcomData>
";
}
catch (Exception ex)
{
Logger.Log("BuildSoapForPriceRequest() " + ex.Message);
return "";
}
}