You need to sign in to do that
Don't have an account?

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
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.
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
Getting this error message while trying to complete SOAP API unit in Trailhead. Need assistance.
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.
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
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.
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
for others, take service url from Login response, and use that url to make subsequent requests
In SOAP UI default endpoint url looks like : https://login.salesforce.com/services/Soap/c/42.0/0DF0I000000UJUe
Copy serviceUrl from login page and change in create request's address bar. Hope it will you.
https://---------------.my.salesforce.com/services/Soap/c/46.0/00D280000013BUW/0DF0K000000UKCg