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

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



I got the below error, when I create Lead record from Java application using Partner WSDL web service call.


 faultString: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
    {}UnexpectedErrorFault:<ns1:exceptionCode>UNKNOWN_EXCEPTION</ns1:exceptionCode><ns1:exceptionMessage>Destination URL not reset. The URL returned from login must be set in the SforceService</ns1:exceptionMessage>

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.apache.axis.encoding.ser.BeanDeserializer.<init>(
    at org.apache.axis.encoding.ser.BeanDeserializer.<init>(
    at com.sforce.soap.partner.fault.UnexpectedErrorFault.getDeserializer(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(
    at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(
    at org.apache.axis.encoding.DeserializationContext.getDeserializer(
    at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(
    at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(
    at org.apache.axis.encoding.DeserializationContext.startElement(
    at Source)
    at Source)
    at$ Source)
    at Source)
    at Source)
    at Source)
    at Source)
    at Source)
    at Source)
    at Source)
    at$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(
    at org.apache.axis.Message.getSOAPEnvelope(
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(
    at org.apache.axis.transport.http.HTTPSender.invoke(
    at org.apache.axis.strategies.InvocationStrategy.visit(
    at org.apache.axis.SimpleChain.doVisiting(
    at org.apache.axis.SimpleChain.invoke(
    at org.apache.axis.client.AxisClient.invoke(
    at org.apache.axis.client.Call.invokeEngine(
    at org.apache.axis.client.Call.invoke(
    at org.apache.axis.client.Call.invoke(
    at org.apache.axis.client.Call.invoke(
    at org.apache.axis.client.Call.invoke(
    at com.sforce.soap.partner.SoapBindingStub.create(
    at org.teg.iagent.PartnerAgentProcessor.start(
    at org.teg.iagent.PartnerAgentProcessor.main(


and, below is my code to set field values, which I retrieved from a POJO object.


    public MessageElement createNewXmlElement(String Name, String nodeValue) throws Exception {

        MessageElement msgElement;
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = documentBuilder.newDocument();
        Element xmlEle = document.createElement(Name);

        msgElement = new MessageElement(xmlEle);

        return msgElement;


I found similar issue in the forum and I am sure, I never called getUserinfo method before the session created. Can anyone help me out from this issue.





You're sending your request to the wrong URL, part of the response from login is a new serverUrl that you need to send the subsequent requests to, see the getting started section of the API docs for more info.




Thanks for your reply.


I gone through the code again and found that my load properties (which has login credentials) function call was commented. And it is working fine then after, I uncomment that part of code. That is why, the proper URL was not retrieved.




Chetan KapaniaChetan Kapania
User-added image

Getting this error message while trying to complete SOAP API unit in Trailhead. Need assistance.
Anupam Joshi 5Anupam Joshi 5

Hi Chetan, 

You just need to change the URL you're sending the request to.

You must have recieved it in the server response for "login" request.

like this , <serverUrl> packageNumber</serverUrl>

Just replace the URL with this server URL.

Arockia MervinArockia Mervin
Hi Chetan,

Get the valid server end point URL and Session Id from from LOGIN operation. For detail info check Trailhead URL:

Rebecca Hendricks 9Rebecca Hendricks 9

Where should we put the <serverURL> tag? I've tried it at just about every level, and can't seem to get the error to go away. I've also created a new request, and don't see that tag anywhere to "overwrite" with my information.
Ashish Narang 14Ashish Narang 14
@Rebecca Hendricks 9
serverUrl is not suppose to be put as tag in request xml, we need to update url in address bar, e.g. check url in following screenshot

User-added image 

for others, take service url from Login response, and use that url to make subsequent requests
Solution : Please update the endpoint url based on org base url .

In SOAP UI default endpoint url looks like :

User-added image
  •  Once you update '' based on your org base url and the issue should be resolved.
ren fei dongren fei dong
@Ashish Narang 14  it worked for me after I update url in address bar and also I removed the pack version at the end of url just follow the instruction in article.
User-added image

Copy serviceUrl from login page and change in create request's address bar. Hope it will you.
Polayya reddyPolayya reddy
You need to copy <Serverurl> <serverurl>  there above the sessionid and pass the url in SOAPUI URL  on the top below and click on triangle button