0

I am struggling in connecting wso2esb with Salesforce.

  1. Configure the proxy settings followed by Configuring PROXY settings in WSO2 ESB 4.8.1.

Axis2.xml

  1. Export Salesforce security certificate and import it into KeyStore, certificate keystore

  2. Download and enable Salesforce connector, enable connector connector

  3. Make a simple API to test Salesforce API

I run into an issue (SOAPProcessingException),

enter image description here

enter image description here

enter image description here

Community
  • 1
  • 1
Sean Sun
  • 496
  • 1
  • 4
  • 14

2 Answers2

0

Because of the "timeout connecting to..." message, it looks for me like you're not reaching salesforce. Are you sure you're connection isn't blocked by your proxy?

I've done the same with ESB 4.8.1 and there it works. the only thing I had to do, is to set the proxy authentication before connecting to salesforce. therefor I had to set the following two properties before I make the sale3sforce call.

<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="Proxy-Authorization" expression="fn:concat('Basic ', base64Encode('userName:password'))" scope="transport"/>

<property name="POST_TO_URI" value="true" scope="axis2" type="STRING"></property>

Maybe it helps, otherwise please share you're proxy config.

Martin Hald
  • 676
  • 4
  • 11
  • Thanks your advice, I also suspect there is something wrong with proxy. I add proxy configuration for connector that is shared on the above, but still have the same issue. – Sean Sun Jul 07 '16 at 21:10
  • Can you share your proxy configuration? You also might get a hint what might be wrong if you enable th wire logging. Therefor go to Configure->Logging and set org.apache.synapse.transport.http.wire to debug. Then you should be able to see what you receive from your proxy and if you're reaching salesforce. – Martin Hald Jul 08 '16 at 14:01
  • I just found that the credentials are not passed at all from output console. Do u have any ideas to solve it? thanks – Sean Sun Jul 12 '16 at 03:29
  • I think its caused because you set the proxy for org.apache.synapse.transport.passthru.PassThroughHttpSender and not for org.apache.synapse.transport.passthru.PassThroughHttpSSLSender. You0re connecting to salesforce using https. – Martin Hald Jul 12 '16 at 08:42
  • No lucky I added the https proxy setting as showed in picture. – Sean Sun Jul 13 '16 at 03:31
  • Not sure if you've set it, but please verify that your transportSender config looks like this. I cannot see proxy host and port config in your axis2.xml. – Martin Hald Jul 13 '16 at 07:06
0

Not sure if you've set it, but please verify that your transportSender config looks like this. I cannot see proxy host and port config in your axis2.xml.

    <transportSender name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender">
    <parameter name="non-blocking" locked="false">true</parameter>
    <parameter name="keystore" locked="false">
        <KeyStore>
            <Location>repository/resources/security/wso2carbon.jks</Location>
            <Type>JKS</Type>
            <Password>password</Password>
            <KeyPassword>password</KeyPassword>
        </KeyStore>
    </parameter>
    <parameter name="truststore" locked="false">
        <TrustStore>
            <Location>repository/resources/security/client-truststore.jks</Location>
            <Type>JKS</Type>
            <Password>password</Password>
        </TrustStore>
    </parameter>
    <parameter name="warnOnHTTP500" locked="false">*</parameter>
    <parameter name="http.proxyHost" locked="false">companyproxyhost</parameter>
    <parameter name="http.proxyPort" locked="false">companyproxyport</parameter>
    <parameter name="http.nonProxyHosts" locked="false">localhost|\*.local</parameter>
    <parameter name="HostnameVerifier">AllowAll</parameter>**
</transportSender>
Martin Hald
  • 676
  • 4
  • 11
  • Hi martin, thanks your help. I added the proxy server and updated the image in question. I just found the http request can pass the proxy, but https cannot. I have no idea anything else I should do. – Sean Sun Jul 13 '16 at 20:22
  • That's weird, with the proxy config above it worked for me over our company proxy. If you cannot see something when the wire log is enabled, I think you have to talk to your proxy administrator to get an understanding why it's not working. – Martin Hald Jul 14 '16 at 10:07
  • The issue is caused by WSO2 ESB currently not support NTLMV2. There are two ways to cope with: 1) Overwrite JCIFS_NTLMScheme: http://stackoverflow.com/questions/33885605/automatic-ntlm-authentication-for-wso2-esb; 2) using new Httpclient (version >= 4) which support NTLMV2, http://stackoverflow.com/questions/6962047/apache-httpclient-4-1-proxy-authentication. – Sean Sun Jul 21 '16 at 03:14