Author Message
CarlosVanegas
Joined: Jul 9, 2020
Messages: 11
Offline
I'm trying to consume a REST web service using the REST Web service operation file.


In this file I have added to the "Message Body" the entry JSON{_JSONBody_} since I need to send json on the request body.


I have also added a header Content-Type and set it to application/json.


However, I'm having two issues, or so the Web service owners tell me.


First: The request body has a line feed and a carriage return on the json opening and closing curly bracket, they want me to remove the lf/cr from the body.


Second: The Content-Type they are getting from me is text/xml


Any idea how to resolve these two issues?


Thanks



UPDATE: I'm now being told that they are receiving "application/json" in the header from me, but their system is converting it to "text/html". They are suspecting this is happening because "the body/json is in string format"
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
What version of OD is this?
CarlosVanegas
Joined: Jul 9, 2020
Messages: 11
Offline
The version of OD is 7.2.2
Thanks.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
I can't really reproduce this problem. You said you saw a lf/cr first. Did you verify it is not already in the string you somehow set in the variable? I suppose the presence of this special character contributes to the 2nd problem.
CarlosVanegas
Joined: Jul 9, 2020
Messages: 11
Offline
Thanks for your input.

The owner of the WS finally figure out that it was an issue on their side and the way they were parsing our payload. Once I used the HTTP monitor I could see that our headers were correct and they had to do a bit more "digging" on their side.


The CR/LF issue was resolved by me picking the variable {_JSONBody_} in the "Message Body" instead of me typing it.... oops.



Again thanks for your help.
Go to:   
Mobile view