on 01-22-2018 8:58 PM
Hi,
I have created xshttpdest and xsjs file. My requirement is to read the service from the xsjs file. While running the xsjs file one extra "/" is added in the service url after hostname from where i want to get the data and the xsjs file is giving below error {"ERROR":"HttpClient.request: request failed: response from xxxxxxx/:80/sap/opu/odata/iwpgw/TASKPROCESSING;v=2/TaskCollection('83')/Description is pending...please retrieve it first with getResponse()"}
I want to create this url xxxxxxx:80/sap/opu/odata/iwpgw/TASKPROCESSING;v=2/TaskCollection('83')/Description "hostname:port/pathprefix" Please let me know how to remove "/" after hostname. Destination code: host ="xxxxxxx"; port =80; description ="ABAP Gateway test"; pathPrefix="sap/opu/odata/iwpgw/TASKPROCESSING;v=2/TaskCollection('83')/Description"; authType =basic; timeout =0; xsjs code try{ //Reading the destination properties destination = $.net.http.readDestination("test12.Services","dest00"); //Creating HTTP Client client = new $.net.http.Client(); //Creating Request request = new $.web.WebRequest($.net.http.GET,"?$format=json"); client.request(request,destination); $.response.setBody(client.getResponse().body.asString()); } catch(errorObj){ $.response.setBody(JSON.stringify({ ERROR : errorObj.message })); }User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.