function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SaurabhRawaneSaurabhRawane 

Connecting Salesforce using a proxy through a Java based Application

Hi,

Can any one help me connect to Salesforce using a Java Application when we have a internet connection which uses a proxy.
Some method names will be of great help.

Same way how Data Loader connects to when we specify proxy details in setting.


Thanks in Advance.
Rick.BanisterRick.Banister
System.setProperty("http.proxyHost", this.httpProxyHost);
System.setProperty("http.proxyPort", this.httpProxyPort);
System.setProperty("http.proxyUser", this.httpProxyUser);
System.setProperty("http.proxyPassword", this.proxyPassword);


You'll need conditional logic around each to not set the values if they are null.

Other interesting properties can be found at http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html, but the four properties mentioned above are typically all you need.

Please also note that commons-httpclient-3.0-rc2.jar or commons-httpclient-3.0-rc3.jar have bugs that are fixed in commons-httpclient-3.0-rc4.jar. The recent WSDLs will not work with the older versions of this but are fine with rc4. This presumes you are using Axis 1.4.


SaurabhRawaneSaurabhRawane
Thanks Rick for your help,

Can you tell me where do i set this properties,presently i am using partner wsdl and doing a simple login with help of code examples given by Salesforce.


Rick.BanisterRick.Banister
Set it anywhere in your code before you attempt to connect. It is a system property, so is passed to the Axis interface by that means rather than passed as a method parameter.