Docusign 连接设置
Docusign Connect Settings
我在 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 的 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.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.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
DocuSign connect calls your app. This pattern is often called a "web hook"
您应该在连接配置页面中为您的 "receiving app" 输入 url。您的 url 需要可从 public 互联网访问,因为 DocuSign.net 平台将调用您的应用程序。
回复:"I am not able to connect to the API service using Soap Client calls"
本应如此。您没有连接到 DocuSign Connect 服务,它连接到您的应用程序。
希望这对您有所帮助。请在开发应用程序时提出其他问题。
已添加
DocuSign 有两个不同的 SOAP API。第一个是 SOAP API 用于发送要签名的文件。此 API 还包括许多其他服务。它的 WSDL 位于 demo.docusign.net/api/3.0/api.asmx
这是一个标准的 SOAP 服务。您的应用调用 API。
另一个API是DocuSign Connect。您调用的是 而不是 和 API。它是 "Web hook API." 您的软件 不会 调用此类 API。相反,您向 Connect 服务注册了一个 URL,然后 它会呼叫您。
当您创建 DocuSign Connect 配置并注册您的 url 时,您还可以选择让 DocuSign Connect 进行 SOAP 调用您的侦听器或更简单的 HTTPS 调用。
如果您选择 SOAP,那么您的应用程序将充当 SOAP 服务,而 WSDL 将由 您发布。(实际上,您无需制作用于您的侦听器服务的 WSDL。但如果您愿意,也可以。)
回复:我在代理后面
这是一个问题。为了让 DocuSign Connect 服务调用您的侦听器应用程序,您的应用程序需要在 public 互联网上可见。如果您的软件在 gateway/firewall/proxy 之后,那么您需要打开 "pinhole" 以便 DocuSign Connect 可以访问您的侦听器应用程序。
我在 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 的 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.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.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
DocuSign connect calls your app. This pattern is often called a "web hook"
您应该在连接配置页面中为您的 "receiving app" 输入 url。您的 url 需要可从 public 互联网访问,因为 DocuSign.net 平台将调用您的应用程序。
回复:"I am not able to connect to the API service using Soap Client calls"
本应如此。您没有连接到 DocuSign Connect 服务,它连接到您的应用程序。
希望这对您有所帮助。请在开发应用程序时提出其他问题。
已添加
DocuSign 有两个不同的 SOAP API。第一个是 SOAP API 用于发送要签名的文件。此 API 还包括许多其他服务。它的 WSDL 位于 demo.docusign.net/api/3.0/api.asmx
这是一个标准的 SOAP 服务。您的应用调用 API。
另一个API是DocuSign Connect。您调用的是 而不是 和 API。它是 "Web hook API." 您的软件 不会 调用此类 API。相反,您向 Connect 服务注册了一个 URL,然后 它会呼叫您。
当您创建 DocuSign Connect 配置并注册您的 url 时,您还可以选择让 DocuSign Connect 进行 SOAP 调用您的侦听器或更简单的 HTTPS 调用。
如果您选择 SOAP,那么您的应用程序将充当 SOAP 服务,而 WSDL 将由 您发布。(实际上,您无需制作用于您的侦听器服务的 WSDL。但如果您愿意,也可以。)
回复:我在代理后面
这是一个问题。为了让 DocuSign Connect 服务调用您的侦听器应用程序,您的应用程序需要在 public 互联网上可见。如果您的软件在 gateway/firewall/proxy 之后,那么您需要打开 "pinhole" 以便 DocuSign Connect 可以访问您的侦听器应用程序。