Skip to Content
avatar image
Former Member

Unable to use Hana xshttp Destination for hana productive account

Hi, I am trying to create a xshttpdestination file to run a xsjs file for my enterprise application. From xs-js I am trying to hit the destination configured in hana cloud platform which again is redirected towards the cloud connector to connect the on-premise Abap system. My account is:- us1.hana.ondemand.com.

I have entered proxyhost=localhost and proxyport=20003 as well. But whenever I run the xsjs file, it gives me the error:- "Unable to extract request URI: URI must contain a host: /bad-request" . Could you guys please help.

I have also attached the xsjs file as well as the xshttp destination file .xshttpdest.png

xsjs.png

xsjs.png (32.6 kB)
xshttpdest.png (23.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 04, 2017 at 02:44 PM

    Dear Hirak,

    I've just tested with the following NPL.xshttpdest:

    host = "u1604snw75.virtual";
    port = 44300; 
    pathPrefix = "";
    authType = none;
    useSSL = false;
    timeout = 30000;
    useProxy = true;
    proxyHost = "localhost";
    proxyPort = 20003;
    

    and this ping.xsjs file:

    var destination_package = "de.linuxdozent.cloudconnector";
    var destination_name = "NPL";
    
    try {
        var dest = $.net.http.readDestination(destination_package, destination_name);
        var client = new $.net.http.Client();
        var req = new $.web.WebRequest($.net.http.GET, "/sap/public/ping"); 
        client.request(req, dest);
        var response = client.getResponse();  
        
        $.response.contentType = "text/plain";
        $.response.setBody(response.body.asString());
        $.response.status = $.net.http.OK;
    } catch (e) {
           $.response.contentType = "text/plain";
           $.response.setBody(e.message);
    }
    

    and got

    <html><body>Server reached.</body></html>

    as a result. I would suggest that you try to reach that point. If you can't it's a case for an SAP Support Message.

    Best regards
    Gregor

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 05, 2017 at 06:43 PM

    Hi Mr. Gregor,

    I have created a destination in HCP, the screenshot for the same is attached. Also attached is the screenshot of Cloud Connector and the xshttpdest along with the error faced.
    Fig 1:- HCP Destination



    Fig2:-Cloud Connector Configuration:-

    Fig 3:- xshttpdest file(done same as the one mentioned by you):-

    Fig 4:- Issue :-

    Can you please check and let me know if there is any mistake from my end ?

    Thanks and Regards.

    Hirak

    Add comment
    10|10000 characters needed characters exceeded