Open GoogleCodeExporter opened 9 years ago
One more issue that I forgot to mention is SSL tunneling, When using the proxy
auth to connect to an HTTP URL everything work fine. Only when the URL points
to an HTTPS I'm getting the error message.
Original comment by avi.han...@gmail.com
on 5 Dec 2010 at 12:13
This seems to work for me through a MS Proxy:
ConnectorConfig partnerConfig = new ConnectorConfig();
partnerConfig.setNtlmDomain("yourDomain");
partnerConfig.setProxy("yourProxy", 80);
partnerConfig.setProxyUsername("yourUsername");
partnerConfig.setProxyPassword("yourPassword");
partnerConfig.setAuthEndpoint("https://test.salesforce.com/services/Soap/u/21.0");
partnerConfig.setConnectionTimeout(60 * 1000);
partnerConnection = Connector.newConnection(partnerConfig);
partnerConnection.describeGlobal().getSobjects()
Original comment by oscarm...@gmail.com
on 3 Jun 2011 at 2:37
I have the same problem with a non-MS proxy, and there have been no comments to
this bug for over a year.
If the OP reads this, did you manage to solve it or found a work-around?
I'm using wsc-22-jdk-1-5.jar
Original comment by jose.cer...@gmail.com
on 14 Jun 2012 at 8:24
Well...
If you can get the TestProxy2 example to work - then try the ConnectorConfig
method:
public void setProxy(java.net.Proxy proxy) ;
You won't see this method in Salesforce's documentation.
If that doesn't work - check that machine running the Java code and ping
www.cnn.com.
If it can't ping that machine then it's likely that a firewall policy is
restricting access to the internet (and you have change the policy).
Original comment by mclean.b...@gmail.com
on 1 Aug 2013 at 12:13
Hi,
The suggestion of Mclean Blades seems to do the trick.
Thanks you very much.
Original comment by avi.han...@gmail.com
on 9 Sep 2013 at 8:45
Forgot to attach the code:
***********************************************************************
package test.ws;
import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.Proxy;
import com.sforce.soap.partner.*;
import com.sforce.soap.partner.sobject.*;
import com.sforce.ws.*;
public class simple {
public static void main(String[] args) {
ConnectorConfig config = new ConnectorConfig();
config.setUsername("myuser");
config.setPassword("myPass");
Authenticator.setDefault(new ProxyAuthenticator("proxyUser", "proxyPass"));
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.1.1.15", 8080));
config.setProxy(proxy);
config.setAuthEndpoint("https://www.salesforce.com/services/Soap/u/23.0");
PartnerConnection connection = null;
try {
connection = Connector.newConnection(config);
} catch (ConnectionException e) {
e.printStackTrace();
}
SObject account = new SObject();
account.setType("Account");
account.setField("Name", "My Account1");
try {
connection.create(new SObject[]{account});
} catch (ConnectionException e) {
e.printStackTrace();
}
}
}
***********************************************************************
**********************************************************************
package test.ws;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
class ProxyAuthenticator extends Authenticator {
private String user, password;
public ProxyAuthenticator(String user, String password) {
this.user = user;
this.password = password;
}
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user, password.toCharArray());
}
}
**************************************************************************
Original comment by avi.han...@gmail.com
on 9 Sep 2013 at 8:57
thank you
Original comment by bharatsl...@gmail.com
on 12 Jun 2014 at 1:30
Original issue reported on code.google.com by
avi.han...@gmail.com
on 5 Dec 2010 at 12:11