Skip to content

Commit

Permalink
TEIID-2597 fixing when the connection timeout is set
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Aug 1, 2013
1 parent 70ab09c commit acbe7ff
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -103,10 +103,6 @@ private void login(String username, String password, URL url, SalesForceManagedC

Bus bus = BusFactory.getThreadDefaultBus();
BusFactory.setThreadDefaultBus(mcf.getBus());
Map<String, Object> requestContext = ((BindingProvider)sfSoap).getRequestContext();
if (mcf.getConnectTimeout() != null) {
requestContext.put(CONNECTION_TIMEOUT, mcf.getConnectTimeout());
}
try {
sfService = new SforceService();
sh = new SessionHeader();
Expand All @@ -115,6 +111,10 @@ private void login(String username, String password, URL url, SalesForceManagedC
sfService.setHandlerResolver(new SalesforceHandlerResolver(sh));

sfSoap = sfService.getSoap();
Map<String, Object> requestContext = ((BindingProvider)sfSoap).getRequestContext();
if (mcf.getConnectTimeout() != null) {
requestContext.put(CONNECTION_TIMEOUT, mcf.getConnectTimeout());
}
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url.toExternalForm());
loginResult = sfSoap.login(username, password);

Expand All @@ -133,7 +133,7 @@ private void login(String username, String password, URL url, SalesForceManagedC
BusFactory.setThreadDefaultBus(bus);
}
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$
Map<String, Object> requestContext = ((BindingProvider)sfSoap).getRequestContext();
// Reset the SOAP endpoint to the returned server URL
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
// or maybe org.apache.cxf.message.Message.ENDPOINT_ADDRESS
Expand Down

0 comments on commit acbe7ff

Please sign in to comment.