Quantcast
Channel: SCN : Popular Discussions - SAP Cloud Applications Studio
Viewing all articles
Browse latest Browse all 1333

REST Service call in Studio

$
0
0

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?


Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>