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
Ikram Momin 16Ikram Momin 16 

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

One of my customer is getting below error message while fetching accounts from the salesforce managed system. we prepare query from the java code and get Users from salesforce. url and serverl is passed from the configuration file.

value for the url and serverurl looks fine : 

url : https://test.salesforce.com/services/Soap/u/56.0

serverurl : 
https://test.testsforce.com/services/Soap/u/56.0/00D530000004f1r

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

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>UNKNOWN_EXCEPTION</faultcode><faultstring>UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService</faultstring><detail><sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault"><sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode><sf:exceptionMessage>Destination URL not reset. The URL returned from login must be set in the SforceService</sf:exceptionMessage></sf:UnexpectedErrorFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

SwethaSwetha (Salesforce Developers) 
HI Ikram,
After you do the login call using SOAP API, you get a loginresult. You need to set the endpoint to the serverurl from the loginresult . Please recheck if https://test.testsforce.com/services/Soap/u/56.0/00D530000004f1r is the appropriate URL

Related: https://salesforce.stackexchange.com/questions/97889/getting-error-as-destination-url-not-reset-the-url-returned-from-login-must-be

If this information helps, please mark the answer as best. Thank you