on 2019 Apr 12 10:23 AM
Hello colleagues.
I'm having trouble with creating and using a Proxy Bridge .
I use this instruction: https://help.sap.com/viewer/b0cc1109d03c4dc299c215871eed8c42/Cloud/en-US/ed1c6732d4214c68846ab9813b9...
After deploying app in SCP I try open this link, but have error.
What could be the problem and what I am doing wrong?
Thanks in advance for the answers)
Project tree:
Servlet code:
package proxy;
import com.sap.ecm.api.AbstractCmisProxyServlet;
public class CMISProxyServlet extends AbstractCmisProxyServlet {
private static final long serialVersionUID = 1L;
@Override
protected boolean supportAtomPubBinding() {
return false;
}
@Override
protected boolean supportBrowserBinding() {
return true;
}
public CMISProxyServlet() {
super();
}
@Override
protected String getRepositoryUniqueName() {
return "DocRep";
}
@Override
// For applications in production, use a secure location to store the secret key.
protected String getRepositoryKey() {
return "1234567890abc";
}
}
web.xml code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; id="WebApp_ID" version="3.0">
<display-name>cmisproxy</display-name>
<servlet>
<servlet-name>cmisproxy</servlet-name>
<servlet-class>proxy.CMISProxyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>cmisproxy</servlet-name>
<url-pattern>/cmis/*</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>Proxy</web-resource-name>
<url-pattern>/cmis/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>EcmDeveloper</role-name>
</auth-constraint>
</security-constraint>
</web-app>
Request clarification before answering.
Hi Kirill,
Did you add the role EcmDeveloper to your user?
Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ivan,
Currently, i have created the Proxy Bridge. But now facing error 400-
https://cmisproxy(subaccount).us3.hana.ondemand.com/cmisproxy/cmis/json
Error Message: {"exception":"permissionDenied","message":"Config entry with unique name XXXXXXXX(Document RepositoryName) is not allowed to be accessed"}
Can you please guide us on the same.
Thanks,
Chakravarti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ivan.mirisola , thanks for the answer. Added a role, now everything works.
But now I have another problem. I want use my ProxyBridge in XSJS app. I create .xshttpdest, but when I make a request, I have this problem, what could be wrong?
My .xshttpdest:
description = "Connection to Proxy Bridge App";
host = "https://cmisproxy******.hana.ondemand.com";
port = 443;
pathPrefix = "/cmisproxy/cmis/json";
proxyType = http;
proxyHost = "proxy";
proxyPort = 8080;
authType = basic;
useSSL = true;
timeout = 0;
sslAuth = anonymous;
My xsjs code:
function getData()
{
try
{
var Dest = $.net.http.readDestination('********.******.xsjs.v01', 'documentservice');
var Request = new $.web.WebRequest($.net.http.GET, '/cmisproxy/cmis/json');
Request.headers.set("Authorization",'Basic ****************');
var client = new $.net.http.Client();
client.request(Request, Dest);
var response = client.getResponse();
var data = response.body.asString();
var parse_data = JSON.parse(data);
return parse_data;
}
catch (e)
{
return e;
}
}
getData();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kirill,
Perhaps you should thing of posting this doubt on a new question as it is a different issue now.
Regardless, I see here the error 400 - which could be something related to SSL handshake (missing certificate in the HANA trust store) or even that you have pathPrefix in both your destination and the request object itself.
Best regards,
Ivan
User | Count |
---|---|
52 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.