0
繼位於 https://github.com/docusign/DocuSign-SOAP-SDK代理中的DocuSign憑據API
試圖實施憑證API的DocuSign SDK的例子,代碼的東西下面
public LoginResult getCredentialAPI() {
CredentialSoap credApi = new CredentialFactory().getCredential(credentialURL);
LoginResult result = credApi.login("[" + integratorKey + "]" + username, password, true);
return result;
}
上市我得到一個連接超時錯誤,原因是我必須使用代理連接設置來建立連接,我在哪裏添加代理連接的服務器URL和端口。下面列出了Credential Factory類
public class CredentialFactory {
/**
* Builds the API interface in order to use the Docusign Credential API.
*
* @param webserviceEndpoint the endpoint for the credential webservice
* @return the credential api stub
*/
public CredentialSoap getCredential(String webserviceEndpoint) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
setupService(factory, webserviceEndpoint);
CredentialSoap credentialProxy = (CredentialSoap) factory.create();
return credentialProxy;
}
/**
* Set service class and webservice url.
*
* @param factory
* @param webserviceEndpoint the endpoint for the credential webservice
*/
protected void setupService(JaxWsProxyFactoryBean factory, String webserviceEndpoint) {
factory.setServiceClass(CredentialSoap.class);
factory.setAddress(webserviceEndpoint);
}
}