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
subaasubaa 

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

Hi,

 

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

 

AxisFault
 faultCode: UNKNOWN_EXCEPTION
 faultSubcode:
 faultString: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
 faultActor:
 faultNode:
 faultDetail:
    {urn:fault.partner.soap.sforce.com}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>(BeanDeserializer.java:104)
    at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
    at com.sforce.soap.partner.fault.UnexpectedErrorFault.getDeserializer(UnexpectedErrorFault.java:84)
    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(BaseDeserializerFactory.java:154)
    at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
    at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
    at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
    at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
    at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.partner.SoapBindingStub.create(SoapBindingStub.java:2657)
    at org.teg.iagent.PartnerAgentProcessor.start(PartnerAgentProcessor.java:482)
    at org.teg.iagent.PartnerAgentProcessor.main(PartnerAgentProcessor.java:82)

 

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);
        xmlEle.appendChild(document.createTextNode(nodeValue));

        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.

 

Regards,

SuBaa

SuperfellSuperfell

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.

subaasubaa

Simon,

 

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.

 

Regards,

SuBaa

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>https://ap5.salesforce.com/services/Soap/c/40.0/some 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: https://trailhead.salesforce.com/modules/api_basics/units/api_basics_soap


 
Rebecca Hendricks 9Rebecca Hendricks 9
@Anupam

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
DebadyutiDebadyuti
Solution : Please update the endpoint url based on org base url .

In SOAP UI default endpoint url looks like : https://login.salesforce.com/services/Soap/c/42.0/0DF0I000000UJUe

User-added image
 
  •  Once you update 'login.salesforce.com' 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.
SFDC_biSFDC_bi
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 tab.like below and click on triangle button

https://---------------.my.salesforce.com/services/Soap/c/46.0/00D280000013BUW/0DF0K000000UKCg