• cheekychops
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
i am trying to invoke the Web Service API using CXF's DynamicClientFactory, without success.

My stack trace is as follows:

14-Nov-2008 16:12:35 org.apache.cxf.endpoint.dynamic.DynamicClientFactory outputDebug
INFO: Created classes: com.sforce.soap.enterprise.AssignmentRuleHeader, com.sforce.soap.enterprise.ChildRelationship, com.sforce.soap.enterprise.ConvertLead, com.sforce.soap.enterprise.ConvertLeadResponse ...<snip>
Testsuite: com.cmc.crmbridge.services.salesforce.TestDynamicSalesForceWebServiceClient
14-Nov-2008 16:12:40 com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient logon
INFO: main Logging on to webservice as user smithcolina@hotmail.com
14-Nov-2008 16:12:41 org.apache.cxf.transport.https.SSLUtils getCiphersuites
INFO: The cipher suites have not been configured, falling back to cipher suite filters.
14-Nov-2008 16:12:41 org.apache.cxf.transport.https.SSLUtils getCiphersuites
INFO: The cipher suite filters have not been configured, falling back to default filters.
14-Nov-2008 16:12:41 org.apache.cxf.transport.https.SSLUtils getCiphersFromList
INFO: The cipher suites have been set to SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_KRB5_WITH_RC4_128_SHA, TLS_KRB5_WITH_RC4_128_MD5, TLS_KRB5_WITH_3DES_EDE_CBC_SHA, TLS_KRB5_WITH_3DES_EDE_CBC_MD5, TLS_KRB5_WITH_DES_CBC_SHA, TLS_KRB5_WITH_DES_CBC_MD5, TLS_KRB5_EXPORT_WITH_RC4_40_SHA, TLS_KRB5_EXPORT_WITH_RC4_40_MD5, TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5. 
14-Nov-2008 16:12:41 org.apache.cxf.transport.http.HTTPConduit prepare
INFO: AutoRedirect is turned on.
14-Nov-2008 16:12:41 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:136)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:76)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:57)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:200)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:220)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:206)
        at com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient.invoke(DynamicSalesForceWebServiceClient.java:511)
        at com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient.logon(DynamicSalesForceWebServiceClient.java:217)
        at com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient.ping(DynamicSalesForceWebServiceClient.java:315)
        at com.cmc.crmbridge.services.salesforce.TestDynamicSalesForceWebServiceClient.testPing(TestDynamicSalesForceWebServiceClient.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)
Caused by: javax.xml.stream.XMLStreamException: java.net.SocketException: Unconnected sockets not implemented
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartElement(XMLStreamWriterImpl.java:1335)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:95)
        ... 27 more
Caused by: java.net.SocketException: Unconnected sockets not implemented
        at javax.net.SocketFactory.createSocket(SocketFactory.java:97)
        at sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:360)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:145)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:271)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:328)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:731)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:834)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1830)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1792)
        at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:59)
        at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:83)
        at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:58)
        at com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter.write(UTF8OutputStreamWriter.java:94)
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.openStartTag(XMLStreamWriterImpl.java:1559)
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartElement(XMLStreamWriterImpl.java:1294)
        ... 28 more

I have tried configuring CXF's httpConduit thus, but it did not help:

Code:
  <http:conduit name="*.http-conduit">
      <http:tlsClientParameters secureSocketProtocol="SSL">
   </http:tlsClientParameters>
   <http:authorization>
      <sec:UserName>smithcolina@hotmail.com</sec:UserName>
      <sec:Password>punchup1</sec:Password>
   </http:authorization>
      <http:client AutoRedirect="true" Connection="Keep-Alive" AllowChunking="false" />
   </http:conduit>

Any suggestions?

i am trying to invoke the Web Service API using CXF's DynamicClientFactory, without success.

My stack trace is as follows:

14-Nov-2008 16:12:35 org.apache.cxf.endpoint.dynamic.DynamicClientFactory outputDebug
INFO: Created classes: com.sforce.soap.enterprise.AssignmentRuleHeader, com.sforce.soap.enterprise.ChildRelationship, com.sforce.soap.enterprise.ConvertLead, com.sforce.soap.enterprise.ConvertLeadResponse ...<snip>
Testsuite: com.cmc.crmbridge.services.salesforce.TestDynamicSalesForceWebServiceClient
14-Nov-2008 16:12:40 com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient logon
INFO: main Logging on to webservice as user smithcolina@hotmail.com
14-Nov-2008 16:12:41 org.apache.cxf.transport.https.SSLUtils getCiphersuites
INFO: The cipher suites have not been configured, falling back to cipher suite filters.
14-Nov-2008 16:12:41 org.apache.cxf.transport.https.SSLUtils getCiphersuites
INFO: The cipher suite filters have not been configured, falling back to default filters.
14-Nov-2008 16:12:41 org.apache.cxf.transport.https.SSLUtils getCiphersFromList
INFO: The cipher suites have been set to SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_KRB5_WITH_RC4_128_SHA, TLS_KRB5_WITH_RC4_128_MD5, TLS_KRB5_WITH_3DES_EDE_CBC_SHA, TLS_KRB5_WITH_3DES_EDE_CBC_MD5, TLS_KRB5_WITH_DES_CBC_SHA, TLS_KRB5_WITH_DES_CBC_MD5, TLS_KRB5_EXPORT_WITH_RC4_40_SHA, TLS_KRB5_EXPORT_WITH_RC4_40_MD5, TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5. 
14-Nov-2008 16:12:41 org.apache.cxf.transport.http.HTTPConduit prepare
INFO: AutoRedirect is turned on.
14-Nov-2008 16:12:41 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:136)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:76)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:57)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:200)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:220)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:206)
        at com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient.invoke(DynamicSalesForceWebServiceClient.java:511)
        at com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient.logon(DynamicSalesForceWebServiceClient.java:217)
        at com.cmc.crmbridge.services.salesforce.DynamicSalesForceWebServiceClient.ping(DynamicSalesForceWebServiceClient.java:315)
        at com.cmc.crmbridge.services.salesforce.TestDynamicSalesForceWebServiceClient.testPing(TestDynamicSalesForceWebServiceClient.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)
Caused by: javax.xml.stream.XMLStreamException: java.net.SocketException: Unconnected sockets not implemented
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartElement(XMLStreamWriterImpl.java:1335)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:95)
        ... 27 more
Caused by: java.net.SocketException: Unconnected sockets not implemented
        at javax.net.SocketFactory.createSocket(SocketFactory.java:97)
        at sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:360)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:145)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:271)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:328)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:731)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:834)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1830)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1792)
        at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:59)
        at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:83)
        at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:58)
        at com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter.write(UTF8OutputStreamWriter.java:94)
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.openStartTag(XMLStreamWriterImpl.java:1559)
        at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartElement(XMLStreamWriterImpl.java:1294)
        ... 28 more

I have tried configuring CXF's httpConduit thus, but it did not help:

Code:
  <http:conduit name="*.http-conduit">
      <http:tlsClientParameters secureSocketProtocol="SSL">
   </http:tlsClientParameters>
   <http:authorization>
      <sec:UserName>smithcolina@hotmail.com</sec:UserName>
      <sec:Password>punchup1</sec:Password>
   </http:authorization>
      <http:client AutoRedirect="true" Connection="Keep-Alive" AllowChunking="false" />
   </http:conduit>

Any suggestions?

Hi,
 

I downloaded the salesforce client certificate from salesforce website, but when I use keytool to import this certificate to keystore. the error message comes as below.

keytool -import -alias sforce -file sfdc_client.cert -keystore trust.keystore
Enter keystore password:  tangquan
keytool error: java.lang.Exception: Input not an X.509 certificate

but it is successful with the verisign public certificate. the salesforce certificate ends with cert file extension, but verisign's ends with cer file extension. It will be helpful if you guys provide information on this.