Reputation: 243
I have the following settings in Demo Docusign Connect to use the Soap API
URL to publish to https://demo.docusign.net
Name DocusignConnect
Use Soap Interface (check box checked)
Is there more configuration required. I am not able to connect to the API service using Soap Client calls
The Docusign Code is as follows
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);
}
The file DocuSignWebServiceFactory and DocuSignApiCredentials are taken from the Github sample example of Connect located at https://github.com/docusign/DocuSign-SOAP-SDK Simple test to validate the code
@Test
public void testLogin() {
APIServiceSoap serviceSoap = utils.getAPI();
serviceSoap.voidEnvelope("dhfafgajf", "No Reason");
}
The Error I keep getting is this
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
Upvotes: 1
Views: 915
Reputation: 49104
DocuSign connect calls your app. This pattern is often called a "web hook"
You should enter the url for your "receiving app" into the Connect configuration page. Your url needs to be accessible from the public internet since the DocuSign.net platform will be calling your app.
Re: "I am not able to connect to the API service using Soap Client calls"
That's the way it should be. You don't connect to the DocuSign Connect service, it connects to your application.
Hope this helps. Please ask additional questions as you develop your application.
Added
DocuSign has two different SOAP APIs. The first is the SOAP API for sending documents to be signed. This API includes many other services too. Its WSDL is hosted at demo.docusign.net/api/3.0/api.asmx
This is a standard SOAP service. Your app calls the API.
The other API is DocuSign Connect. It is not an API that you call. It is a "Web hook API." Your software does not make calls to this type of API. Instead, you register a URL with the Connect service and it calls you.
When you create a DocuSign Connect configuration and register your url, you can also choose to have DocuSign Connect make a SOAP call your listener or a more plain HTTPS call.
If you choose SOAP, then your application acts as a SOAP service and the WSDL would be published by you. (In reality, there is no need for you to make a WSDL for your listener service. But you can if you want to.)
Re: I'm behind a proxy
This is an issue. In order for the DocuSign Connect service to call your listener application, your app needs to be visible on the public internet. If your software is behind a gateway/firewall/proxy then you need to open up a "pinhole" so DocuSign Connect can reach your listener application.
Upvotes: 1