You need to sign in to do that
Don't have an account?
pamal
Email2Case: how can I specify the HTTP Proxy to be used ?
Trying to configure Email2Case for accessing sfdc via HTTPS through the corporate HTTP Proxy, I've added the following 4 java system properties definitions in email2case.bat: -Dhttps.proxySet=true -Dhttps.proxyHost=<proxy hostname> -Dhttps.proxyPort=<proxy port> -Dhttps.proxyType=4
This kind of setting works fine with any "regular Java application", but with Email2Case it simply doesn't work: a network trace shows that the proxy is not called at all - the call is attempted direclty on sfdc.com, so Email2Case simply ignores these 4 parameters.
Is there a way to specify the proxy to be used by Email2Case ?
This is related to how the axis client being used interprets the httpProxy settings. My understanding is that this is being addressed soon. However, as a workaround, you can alter the CommonsHTTPSender clas delivered with the distribution. Here is an example:
Code:
This solution works very well.
protected void login() throws ConnectionException {
try {
ConnectorConfig config = new ConnectorConfig();
//retrieve the proxy information from sfdc config file.
String proxyServer = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYSERVER);
String proxyPort = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYPORT);
String proxyUser = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYUSER);
String proxyPassword = SalesforceAgent.GLOBAL_CONFIG.get(ConfigParameters.pPROXY, ConfigParameters.pPROXYPASSWORD);
logger.info("retrieved http/https proxy settings:"+proxyServer+":"+proxyPort+" username:"+proxyUser);
if (proxyPassword!=null && "".equals(proxyPassword)==false){
logger.info("http/https proxy password will also be set.");
}
if (proxyServer!=null && "".equals(proxyServer) == false) {
Properties props = new Properties(System.getProperties());
// set http/https properties
props.put("http.proxySet", "true");
props.put("https.proxySet", "true");
props.put("http.proxyHost", proxyServer);
props.put("https.proxyHost", proxyServer);
config.setProxyHost(proxyServer);
if (proxyPort!=null && "".equals(proxyPort) == false){
props.put("http.proxyPort", proxyPort);
props.put("https.proxyPort", proxyPort);
config.setProxyPort(Integer.parseInt(proxyPort));
}
if (proxyUser!=null && "".equals(proxyUser) == false){
props.put("http.proxyUser", proxyUser);
props.put("https.proxyUser", proxyUser);
config.setProxyUsername(proxyUser);
}
if (proxyPassword!=null && "".equals(proxyPassword) == false){
props.put("http.proxyPassword", proxyPassword);
props.put("https.proxyPassword", proxyPassword);
config.setProxyPassword(proxyPassword);
}
Properties newprops = new Properties(props);
System.setProperties(newprops);
}
java.lang.IllegalArgumentException: Illegal character(s) in message header value: xxxxxxxxxx
at sun.net.www.protocol.http.HttpURLConnection.addRequestProperty(Unknown Source)
at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:86)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:72)
at com.sforce.soap.partner.wsc80.PartnerConnection.login(PartnerConnection.java:499)
at com.sforce.mail.GenericClient.login(GenericClient.java:308)
at com.sforce.mail.GenericClient.getConnection(GenericClient.java:178)
at com.sforce.mail.GenericClient.<init>(GenericClient.java:134)
at com.sforce.mail.ImapClient.<init>(ImapClient.java:40)
at com.sforce.mail.EmailService.loadService(EmailService.java:153)
at com.sforce.SalesforceAgent.main(SalesforceAgent.java:139)
2007-11-21 17:33:08,937 [main] INFO EmailToCase Agent Shut Down.
Message Edited by VinOK on 11-21-2007 10:14 AM
Were you able to ever get this resolved?
I want to use proxy host/port for email2case.