cancel
Showing results for 
Search instead for 
Did you mean: 

REST Service call in Studio

Former Member
0 Kudos

Hi,

I am trying to consume a web service call (from hybris) in a script file in Studio. I have created the communication arrangement, scenario and even tested the arrangement's connection ping and it was successful. My code as shown below:

var URLParameter : collectionof NameAndValue;

var headerParam : collectionof NameAndValue; //

var URLParameterEntry : NameAndValue;

//XX.XXX.XX.XXX:9001/ws410/rest/catalogs/powertoolsProductCatalog/catalogversions/Online/products/2116275

URLParameterEntry.Name = "products";

URLParameterEntry.Value = "2116275";

//URLParameter.Add(URLParameterEntry);

var httpResource = "powertoolsProductCatalog/catalogversions/Online/products/";

httpResource = httpResource + "2116275";

var httpMethod = "PUT";

var body = "<product code=\"2116275\"><catalogVersion version=\"Online\"><catalog id=\"powertoolsProductCatalog\"/></catalogVersion><name>Prashanth</name></product>";

var httpformat = "text/xml; charset=UTF-8";

var result =    WebServiceUtilities.ExecuteRESTService("CloudhybrisProdUpdate","CloudhybrisProdupdate",httpMethod,httpResource,URLParameter,headerParam,httpformat,body);

var position = result.Content;

var res = result.RequestURL;

var resp = result.HeaderParameters;

in this code, instead of PUT method, if I pass "GET", I am getting the response. However, for "PUT" the result variable is completely blank. Please can you help?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I have the same problem with the PUT method (I'm using the Could Application Studio 1505).

Have you solve this issue or is it a limitation of the SAP Reuse Librarie : WebSercieUtilities ?

I've test my program with the GET and POST method and it works. But when I test the PUT method with the UI Designer I have this error message : Invalid importing parameter http method.

The problem isn't on the remote web service plateforme side : I have verify the PUT method works thanks to a FireFox Add-on.

I have already read the related topic in the official doc and the3 link mentioned by Mithun Suthar but it didn't solve the problem.

It is essential for my dev to make it work with this PUT method.

Here is my code :

Regards,

Ludovic

Former Member
0 Kudos

Hi ,

I don't know more about this but try "POST" in place of "PUT".

Regards,

Mithun

Former Member
0 Kudos

Hi Mithun,

Unfortunately, POST doesnt help me. I had tried that too.

Former Member
0 Kudos

Hi,

Please refer the post below may be this will helpful to you:

Regards,

Mithun