Ask Search:
Eloqua MarketingEloqua Marketing 

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must b

I'm able to interface with SFDC's API from my laptop but unable to from a server and recieving this error when trying to intialize SFDC's endpoint from the LoginResult.

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

I temporarily disabled Windows Firewall but that didn't help.   Do you have any ideas of why this wouldn't work from a server (Windows 2008) but works from a laptop running Windows 7.

Here's my code snippet in C#.  The error is generated trying to set proxy.Url from the LoginResult.serverUrl.  I verified the credentials are correct that I'm sending.

_url = System.Configuration.ConfigurationManager.AppSettings["SalesForceAPIURL"];
 				
string userName = System.Configuration.ConfigurationManager.AppSettings["SalesForceAPIUserName"];
string password = System.Configuration.ConfigurationManager.AppSettings["SalesForceAPIPassword"];

this.proxy = new SforceService();
this.proxy.Url = _url;		
 
LoginResult lr = proxy.login(userName, password);
this.proxy.Url = lr.serverUrl;


Thanks, Tim
Best Answer chosen by Moderator (salesforce.com) 
Eloqua MarketingEloqua Marketing
Adding the security token to my password and allowing our web server's IP address in SF fixed my issue.

Thanks

All Answers

Marco (werewolf) CasalainaMarco (werewolf) Casalaina
Your post got cut off there so it's hard to make out what the issue might be, but why are you setting that url up front anyway?  You should not be storing or using that _url variable at all.  Just follow the C# example as given on this page.
Eloqua MarketingEloqua Marketing
I'm setting the URL based on our environment. The test instance of SFDC has a different URL than production does.   I can connect to both the test and production instance of the API from my laptop great but can't on any of our servers.   Is there any type of IP restriction I should be aware of?  It seems like SFDC is unable to generate the serverUrl from the LoginResult object.
Marco (werewolf) CasalainaMarco (werewolf) Casalaina
OK, well that's a good point about the test URL.  Can you put a breakpoint on that line with the LoginResult and inspect into lr to see what it contains?  You should see a valid serverUrl in there, or maybe it'll be an indication that your login isn't working there (maybe you need to append the security token to your password?).
Eloqua MarketingEloqua Marketing
Adding the security token to my password and allowing our web server's IP address in SF fixed my issue.

Thanks
This was selected as the best answer
Mick KramerMick Kramer
Can somebody elaborate on "allowing our web server's IP address in SF"? I understood the part about the security token but am not clear on this part of the solution.

Thanks.
Marco (werewolf) CasalainaMarco (werewolf) Casalaina
@Mick Kramer He means he added his server's IP address as a trusted IP in Salesforce.com under Setup | Administration Setup | Security | Network Access.
Youssef KaramiYoussef Karami
How can I allow our web server's IP address in SF?
Ranjit JagtapRanjit Jagtap
I also getting same issue(Destination URL not reset). can u plz help "how can allow web service's IP address in SF"