cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XML in the HTTP Request

Former Member
0 Likes
1,555

Hi all,


I have created a RESTwebservice and the transaction/IWFND/GW_CLIENT allows to use an XML in the HTTP request.

My question is, how can I get the XML File where I can put the data that I need to perform the CREATE, READ, etc Requests?


When I get the metadata of my webservice (http://p2w4r5s8:8080/sap/opu/odata/sap/ZZ_TEST_GATEWAY_002_SRV/$metadata), then I get answer contained in the attachment file metadata_answer.xml


How can I use the metadata XML to use it in the CREATE, READ, DELETE, ... Requests?


The idea is to use an XML in the request and not to put all the necessary data in the URL-String:

Cheers and thanks in advance

Mar

Accepted Solutions (0)

Answers (2)

Answers (2)

kammaje_cis
SAP Mentor
SAP Mentor
0 Likes

In addition to Andreas's answer, you may refer to this blog on how to test each operation.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Likes

The  request that you showed in the Gateway client ../ZZZ_ENTITY_002(IBukrs='XD45',...) is the valid GET request to obtain a single entity using OData.

You will only provide data via XML in the http body of your request if you create or update an entity, not for READ requests.

To create such an XML for a CREATE or UPDATE you can perform your read request and then press the button "use as request" above the HTTP response window and then change the content and the http method to either PUT or POST.

If you use POST don't forget to change the URL so that it only contains the entityset .../ZZZ_ENTITY_002 while a PUT would be performed on the entity itself ../ZZZ_ENTITY_002(IBukrs='XD45',...)

Best Regards,

Andre