cancel
Showing results for 
Search instead for 
Did you mean: 

ByD Goods movement web service inventoryprocessinggoodsandac2- Deserialization error in XML

336

Dear experts,

We are using the webservice inventoryprocessinggoodsandac2 for a Goods Movement action in ByDesign.
The webservice is called via C# source code.

The products are transferred successfully, however we get an exception when trying to Deserialize the webservice response.

The exception is: "There is an error in XML Document (1, 302)"

We also called the webservice through POSTMAN with the below response:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<n0:GoodsAndActivityConfoirmationGoodsMovementResponse xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:LPY:/1SAI/TAE117DBAB886E19F0B0809:804">
<GACDetails>
<ExternalGACID>99999</ExternalGACID>
<GACUUID>00163ec7-f5b5-1edb-bed4-b01012093cee</GACUUID>
<GACID>1687</GACID>
</GACDetails>
</n0:GoodsAndActivityConfoirmationGoodsMovementResponse>
</soap-env:Body>
</soap-env:Envelope>

The position that is mentioned in the Exception is the start of tag <GACUUID

The code for Deserializing the response is:

using (WebResponse webResponse = webRequest.EndGetResponse(asyncResult)) {
using (StreamReader rd = new StreamReader(webResponse.GetResponseStream())) {
XmlRootAttribute xRoot = new XmlRootAttribute();
xRoot.ElementName = "Envelope";
xRoot.Namespace = @"http://schemas.xmlsoap.org/soap/envelope/";
xRoot.IsNullable = true;
XmlSerializer serializer = new XmlSerializer(typeof(Shared.Models.ByDGoodsMovementsResponse.Envelope), xRoot);
var response = (Shared.Models.ByDGoodsMovementsResponse.Envelope)serializer.Deserialize(rd);
}
}

The Model used for the deserialization is created using the webservice response and the standard functionality of VS "Paste XML As Classes".

The class for the GACDetails tag is the below:

public partial class GACDetails {
private ushort externalGACIDField;
private string gACUUIDField;
private ushort gACIDField;

..................... }


Looking forward for your feedback.

Kind Regards,
Savvas Karasavvas

Accepted Solutions (0)

Answers (0)