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

SAP DataServices - Using PUT method RESTFUL Webservices

gilles_breton
Product and Topic Expert
Product and Topic Expert
1,835

Hi Dear Experts,

I have an issue to use a PUT method.

The problem is in the PUT request. In API says to define request header as Content-Type:application/octet-stream

I tried to define in WADL file this type

I got unsupported type error

After that I tried to change the header like this

And this one

In both cases I get HTTP 500 error

This error due double header collision (json + octet-stream)

The problem is that I can't remove the json header, I don't have any setting for it. It's absolutely automatic.

Many thanks for any help and support.

Gilles

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

I am also running into the same issue, wherein the API I am dealing with (8x8) requires Content-Type=application/x-www-form-urlencoded in the header. When I put it as a Standard HTTP Header Field, it certainly picks it up, but then throws an error as there are now duplicate Content-Type entries. This can easily be replicated in SOAP UI.

From the trace...

TRAN 9/14/2022 9:13:53 AM Content-Type: application/json; charset=utf-8

TRAN 9/14/2022 9:13:53 AM Content-Type: application/x-www-form-urlencoded

TRAN 9/14/2022 9:13:54 AM HTTP/1.1 400 Bad RequestTRAN 9/14/2022 9:13:54 AM {"fault":{"faultstring":"Duplicate Header \"Content-Type\"","detail":{"errorcode":"protocol.http.DuplicateHeader"}}}There is no way around this?...
former_member598107
Participant
0 Likes

Hi Gilles,

Please check the below

The URL for the external web service works as expected in SoapUI or POSTMAN

Root Case: The Data Services REST web service datastore only supports the mediatypes of application/XML and application/JSON. When this header is missing or malformed, the server will automatically use application/octet-stream by default

Please refer to SAP Note 2404163 - Failure importing function in a REST web service datastore - Data Services.

Also refer Data Services Integrator Guide

https://help.sap.com/doc/PRODUCTION/ace9cae2f4cf408883eb0120b494f3dd/4.2.8/en-US/ds_42_integrate_en....

Regards

Arun Sasi

bpaz
Newcomer
0 Likes

Hi Arun,

Thank you for your comment.

I'm working with Gilles on this issue.

2404163 does not help - "use a supported mediatype" is useless resolution

For all another requests (GET,POST) we use mediaType="application/json" without any header parameter and it's works well. So I understand, that Data Services use application/json header by default and not application/octet-stream

If we use application/json mediatype, we get "Unsupported Media Type Error" from the API. Exactly like we get in Postman with this type in header.

Also this error we get, if we put mediaType="*/*" or mediaType="application/json; type=application/octet-stream" and header Content-Type parameter is empty.

Best Regards

Benjamin Paz

former_member598107
Participant
0 Likes

@benjamin

Looks like the type = application/octet-stream is not supported in BODS. I could not find this in any of the SAP Notes or DS Integrator guide.

dirk.venken Could you please confirm here

Regards

Arun Sasi