Docusign连接设置

时间:2015-08-04 21:40:00

标签: docusignapi

我在Demo Docusign Connect中有以下设置以使用Soap API

URL to publish to  https://demo.docusign.net
Name DocusignConnect
Use Soap Interface (check box checked)

是否需要更多配置。我无法使用Soap客户端调用

连接到API服务

Docusign代码如下

public APIServiceSoap getAPI() {

        DocusignAPICredentials apiCreds = new DocusignAPICredentials();
        apiCreds.setAccountId(accountId);
        apiCreds.setUserId(username);
        apiCreds.setIntegratorsKey(integratorKey);
        apiCreds.setPassword(password);
        apiCreds.setUserEmail(email);
        apiCreds.setDocusignWebserviceEndpoint(credentialURL);

        DocusignWebserviceFactory wsFactory = new DocusignWebserviceFactory();
        wsFactory.setEmail(apiCreds.getUserEmail());
        wsFactory.setIntegratorsId(apiCreds.getIntegratorsKey());
        wsFactory.setUserId(apiCreds.getUserId());

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

文件DocuSignWebServiceFactory和DocuSignApiCredentials取自位于https://github.com/docusign/DocuSign-SOAP-SDK的Connect的Github示例示例 验证代码的简单测试

@Test
    public void testLogin() {

        APIServiceSoap serviceSoap = utils.getAPI();

        serviceSoap.voidEnvelope("dhfafgajf", "No Reason");
    }

我一直得到的错误就是这个

org.apache.cxf.interceptor.Fault: Could not write attachments.
    at org.apache.cxf.interceptor.AttachmentOutInterceptor.handleMessage(AttachmentOutInterceptor.java:74)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:502)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:267)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)
    at com.sun.proxy.$Proxy109.voidEnvelope(Unknown Source)
    at com.cargill.crm.docservices.docusign.workflow.LoginTest.testLogin(LoginTest.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:198)
    at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:274)
    at org.springframework.test.context.junit4.SpringMethodRoadie$2.run(SpringMethodRoadie.java:207)
    at org.springframework.test.context.junit4.SpringMethodRoadie.runBeforesThenTestThenAfters(SpringMethodRoadie.java:254)
    at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:234)
    at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:204)
    at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:146)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:151)
    at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:61)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:54)
    at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:33)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:45)
    at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:52)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.net.UnknownHostException: demo.docusign.net
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:200)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:951)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:174)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1296)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1252)
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:201)
    at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
    at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
    at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:60)
    at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:77)
    at org.apache.cxf.attachment.AttachmentSerializer.writeProlog(AttachmentSerializer.java:172)
    at org.apache.cxf.interceptor.AttachmentOutInterceptor.handleMessage(AttachmentOutInterceptor.java:72)
    ... 32 more

1 个答案:

答案 0 :(得分:1)

DocuSign connect致电您的应用。这种模式通常被称为&#34; web hook&#34;

您应该输入您的&#34;接收应用的网址&#34;进入Connect配置页面。您的网址需要可以从公共互联网访问,因为DocuSign.net平台将调用您的应用程序。

重新:&#34;我无法使用Soap客户端电话连接到API服务&#34;

应该是这样的。您没有连接到DocuSign Connect服务,它连接到您的应用程序。

希望这会有所帮助。在开发申请时,请提出其他问题。

<强>加

DocuSign有两种不同的SOAP API。第一个是SOAP API用于发送要签名的文档。此API还包含许多其他服务。其WSDL托管在demo.docusign.net/api/3.0/api.asmx

这是一个标准的SOAP服务。您的应用调用了API。

其他API为DocuSign Connect您调用的API。它是一个&#34; Web hook API。&#34;您的软件会调用此类API。相反,您使用Connect服务注册了一个URL,它会调用您。

当您创建DocuSign Connect配置并注册您的URL时,您还可以选择让DocuSign Connect将SOAP调用作为您的侦听器或更简单的HTTPS调用。

如果您选择SOAP,那么您的应用程序将充当SOAP服务,而WSDL将由您发布。(实际上,您无需为您的侦听器服务创建WSDL但如果你愿意,你可以。)

Re:我在代理

背后

这是一个问题。为了让DocuSign Connect服务能够呼叫您的应用程序,您的应用程序需要在公共互联网上可见。如果您的软件位于网关/防火墙/代理后面,那么您需要打开一个&#34;针孔&#34;所以DocuSign Connect可以联系你的听众应用程序。