Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

User is not authorized to use destination (package: ..., name: ...)

$
0
0

Hi All,

 

Perhaps someone has already tried to call a Web Service from HANA via .xshttpdest.

 

Here is the destination file: name = sapmmcS74.xshttpdest

 

host = "10.66.176.252";

port = 50013;

description = "sapmmc on S74";

useSSL = false;

pathPrefix = "/SAPControl.cgi";

authType = none;

useProxy = false;

proxyHost = "";

proxyPort = 0;

timeout = 0;

 

and the corresponding server-side javascript is:

//<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:SAPControl">

//<soapenv:Header/>

//<soapenv:Body>

// <urn:GetSystemInstanceList>

//    <timeout>0</timeout>

// </urn:GetSystemInstanceList>

//</soapenv:Body>

//</soapenv:Envelope>

 

 

try{

 

var soapenv = "";

soapenv = soapenv.concat("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:SAPControl\">");

soapenv = soapenv.concat("<soapenv:Header/>");

soapenv = soapenv.concat("<soapenv:Body>");

soapenv = soapenv.concat("<urn:GetSystemInstanceList>");

soapenv = soapenv.concat("<timeout>0</timeout>");

soapenv = soapenv.concat("</urn:GetSystemInstanceList>");

soapenv = soapenv.concat("</soapenv:Body>");

soapenv = soapenv.concat("</soapenv:Envelope>");

 

 

var dest = $.net.http.readDestination("services", "sapmmcS74");

 

 

var client = new $.net.http.Client();

var req = new $.web.WebRequest($.net.http.POST, soapenv);

client.request(req, dest);

 

var response = client.getResponse();

 

 

if(response.body){

  $.response.setBody(response.body.asString());

}

else {

  $.response.setBody( "error" );

}

 

$.response.status = response.status;

$.response.contentType = "text/xml; charset=utf-8";

 

 

}

catch(x){

  $.response.status = 500;

  $.response.setBody( x.message );

}

 

Both are in the same package/folder "services".

 

When I test the .xsjs I receive always the error: User is not authorized to use destination (package: services, name: sapmmcS74).

 

I assigned all possible authorities in HANA to my user: sap.hana.xs.admin.roles::HTTPDestAdministrator as well as package privileges etc. but the error is not resolved.

Any ideas?

 

Thanks,

Hristina


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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