cancel
Showing results for 
Search instead for 
Did you mean: 

ByD outbound REST request body is changed for no reason ? Why ?

former_member689468
Participant
0 Kudos

Explanation:

I am sending a POST request from a custom BO. Its a json request, all the parameters are in the body of the request. In the body I send username, password, software id and file parameter. All the parameters are strings. The File parameter is parsed on the web service and it should be a properly formatted XML file. Here my troubles begin.

While testing with SoapUI I prepare the body of my request and I verify that it is handeled correctly, the web service returns a postive response and the e-invoice is created. When I create the same request using ABSL and send it with WebServiceUtilities.ExecuteRESTService I get an error response from the web service. Here obviously something happens with the body of my request and it is changed. The question is why ?

So I tried to see how the outbound request looks like but I couldnt find any way of accesing the outbound REST requests in Byd. Is there even a way of seeing those outbound requests ??

I then hosted my own webservice that returns the request it recieves - this way I could see how the request that ByD sends looks like. And I noticed that the method WebServiceUtilities.ExecuteRESTService really does change how my outbound request looks like. For some reason all the "<" signs were replaced with "<" and ofcourse the webservice that is in charge of creating e-invoice returns an error because of it. The question here is why would that ever happen ??

How can I change that or influence it in any way? When looking trough the debuger the Body value in the outbound request looks properly formated

but when it is actually sent the body is changed.

After some exhausting attempts I tried to send the same request with WebServiceUtilities.ExecuteRESTServiceWithoutEncoding method. This time the call was sucesfull and I get a sucess response and the e-invoice is created. This is what the request looks like when its sent (the data is dummy data so dont worry about username and password being visible here)

So now I dont understand how and why this works in the way it does ? Also I cant see any of the special croatian characters in either of the requests.

The WebServiceUtilities.ExecuteRESTServiceWithoutEncoding returns a sucess response but the information on the side of the customer is gibberish because of no special characters and I cant have that. On the other hand if I use WebServiceUtilities.ExecuteRESTService then the json string is altered and nothing works.

Can you please help me find an answer to this ? Why does the method WebServiceUtilities.ExecuteRESTService change my outbound request and can I influence it any way ? Can I see the outbound request in byd without having to use my own web services for testing ? Can I use the WebServiceUtilities.ExecuteRESTServiceWithoutEncoding and get the UTF-8 characters in there somehow ?

Thank you, best regards, Josip

Accepted Solutions (0)

Answers (0)