0

我们正在尝试使用https://www.docusign.net/API/3.0/从 Docusing 访问网络服务 。我们在下面收到禁止访问消息。我们也无法从浏览器中访问 URL。

403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied. 

在执行代码期间,我们在执行以下方法时收到 UnknownHostException。最后一行代码在创建客户端时产生错误。我们已经验证了我们的凭据,一切似乎都井然有序。

public static APIServiceSoap getAPI(HttpServletRequest request) {
        HttpSession session = request.getSession();
        DocuSignAPICredentials apiCreds = new DocuSignAPICredentials();
        apiCreds.setAccountId(session.getAttribute(Utils.SESSION_ACCOUNT_ID)
                .toString());
        apiCreds.setUserId(session.getAttribute(Utils.SESSION_USER_ID)
                .toString());
        apiCreds.setIntegratorsKey(session.getAttribute(
                Utils.SESSION_INTEGRATORS_KEY).toString());
        apiCreds.setPassword(session.getAttribute(Utils.SESSION_PASSWORD)
                .toString());
        apiCreds.setUserEmail(session.getAttribute(Utils.SESSION_EMAIL)
                .toString());
        apiCreds.setDocusignWebserviceEndpoint(session.getAttribute(
                Utils.DOCUSIGN_WEBSERVICE_ENDPOINT).toString());
        DocusignWebserviceFactory wsFactory = new DocusignWebserviceFactory();
        wsFactory.setEmail(apiCreds.getUserEmail());
        wsFactory.setIntegratorsId(apiCreds.getIntegratorsKey());
        wsFactory.setUserId(apiCreds.getUserId());

 // Error when executing the next line

        return wsFactory.setupClient(apiCreds.getDocusignWebserviceEndpoint())
                .authorizeAPI(apiCreds); 
    }   



Caused by: java.net.UnknownHostException: demo.docusign.net
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:227)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
    at java.net.Socket.connect(Socket.java:539)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:170)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:407)

Please help me. Thanks.
4

1 回答 1

2

java.net.UnknownHostException表示无法确定主机的 IP 地址。您可能需要代理才能从 LAN 访问 Internet。

是一个链接,解释了如何使用您的 java 代码进行设置,但也许 Docusign API 提供了它。

于 2013-07-30T19:17:36.393 回答