+ Start a Discussion
sekkisekki 

what should i do if i got this error "Destination URL not reset"?

I am  trying to upsert a salesforce by web service.

but I get the following error

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

 

Any ideas?

 

Detail Below

 
【Binding Operation Property】
<implementation xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" type="Invoke">
  <serverUri>※I wrote return message by login </serverUri>
  <soapaction>""</soapaction>
  <authenticationType>Anonymous</authenticationType>
  <userId>※ Iwrote userId</userId>
  <password>※ Iwrote password</password>
  <host>×.×.×.×</host>
  <port>80</port>
  <charset>UTF-8</charset>
</implementation>


【Soap Request】

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP:Header>
    <DebuggingHeader xmlns="urn:enterprise.soap.sforce.com">
      <debugLevel>none</debugLevel>
    </DebuggingHeader>
    <DisableFeedTrackingHeader xmlns="urn:enterprise.soap.sforce.com">
      <disableFeedTracking>0</disableFeedTracking>
    </DisableFeedTrackingHeader>
    <PackageVersionHeader xmlns="urn:enterprise.soap.sforce.com">
      <packageVersions>
        <majorNumber>0</majorNumber>
        <minorNumber>0</minorNumber>
        <namespace></namespace>
      </packageVersions>
    </PackageVersionHeader>
    <AssignmentRuleHeader xmlns="urn:enterprise.soap.sforce.com">
      <assignmentRuleId></assignmentRuleId>
      <useDefaultRule>0</useDefaultRule>
    </AssignmentRuleHeader>
    <EmailHeader xmlns="urn:enterprise.soap.sforce.com">
      <triggerAutoResponseEmail>0</triggerAutoResponseEmail>
      <triggerOtherEmail>0</triggerOtherEmail>
      <triggerUserEmail>0</triggerUserEmail>
    </EmailHeader>
    <SessionHeader xmlns="urn:enterprise.soap.sforce.com">
      <sessionId>※I wrote return message by login </sessionId>
    </SessionHeader>
    <AllOrNoneHeader xmlns="urn:enterprise.soap.sforce.com">
      <allOrNone>1</allOrNone>
    </AllOrNoneHeader>
    <AllowFieldTruncationHeader xmlns="urn:enterprise.soap.sforce.com">
      <allowFieldTruncation>1</allowFieldTruncation>
    </AllowFieldTruncationHeader>
    <MruHeader xmlns="urn:enterprise.soap.sforce.com">
      <updateMru>false</updateMru>
    </MruHeader>
  </SOAP:Header>
  <SOAP:Body>
    <upsert xmlns="urn:enterprise.soap.sforce.com">
      <externalIDFieldName>Id</externalIDFieldName>
      <sObjects xsi:type="Account">
  <Fax>03-1111-1111</Fax>
  <Name>AAA</Name>
  <Phone></Phone>
  <Id></Id>
      </sObjects>
    </upsert>
  </SOAP:Body>
</SOAP:Envelope>

 

 

【Response Message】

 <data>
 <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" >
<faultcode xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" >ns0:Server</faultcode>
<faultstring xml:lang="en-US" >UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService.</faultstring>
<faultactor>urn:enterprise.soap.sforce.com</faultactor>
 <detail>
 <cordys:FaultDetails xmlns:cordys="http://schemas.cordys.com/General/1.0/" >
 <cordys:LocalizableMessage xmlns:cordys="http://schemas.cordys.com/General/1.0/" >
<cordys:MessageCode xmlns:cordys="http://schemas.cordys.com/General/1.0/" >Cordys.UDDI.Messages.generalException</cordys:MessageCode>
<cordys:Insertion xmlns:cordys="http://schemas.cordys.com/General/1.0/" >UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService</cordys:Insertion>
</cordys:LocalizableMessage>
</cordys:FaultDetails>
<externalFaultCode>UNKNOWN_EXCEPTION</externalFaultCode>
 <sf:UnexpectedErrorFault xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 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>
</SOAP:Fault>
</data>
 
 
Thanks.
SuperfellSuperfell

the response from login includes a serverUrl property that should be used for subsequent requests, you're not doing that, and trying to send your request to the login service.

sekkisekki

Thanks Simon,

 

I already do login service.

and I  replace serverUrl when I do upsert .

 

Detail Procedure Below

①I do login

【response】

 <data>
 <loginResponse xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
 <result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<metadataServerUrl>https://ap0-api.salesforce.com/services/Soap/m/22.0/00D10000000H5X1</metadataServerUrl>
<passwordExpired>false</passwordExpired>
<sandbox>false</sandbox>
<serverUrl>https://ap0-api.salesforce.com/services/Soap/c/22.0/00D10000000H5X1</serverUrl>

 

②I do upsert

Binding Operation】

 <implementation xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" type="Invoke">
  <serviceuri>https://ap0-api.salesforce.com/services/Soap/m/22.0/00D10000000H5X1</serviceuri>←I replace
  <soapaction>""</soapaction>
  <authenticationType>Anonymous</authenticationType>
  <userId/>

  <password/>

  <host>×.×.×.×</host>
  <port>80</port>
  <charset>UTF-8</charset>
</implementation>

 

SuperfellSuperfell

Its not working, there's only a single code path that generates that error, and its when you send a request that isn't login to www or test.salesforce.com. Get a capture of your actual http request.

sekkisekki

Thanks Simon. 

 

I wrote Actual Request below.

 

【request】-------------------------------------------------------------------------------------------------

 

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
 <SOAP:Header>
 <DebuggingHeader xmlns="urn:enterprise.soap.sforce.com" >
<debugLevel>none</debugLevel>
</DebuggingHeader>
 <DisableFeedTrackingHeader xmlns="urn:enterprise.soap.sforce.com" >
<disableFeedTracking>0</disableFeedTracking>
</DisableFeedTrackingHeader>
 <PackageVersionHeader xmlns="urn:enterprise.soap.sforce.com" >
 <packageVersions>
<majorNumber>0</majorNumber>
<minorNumber>0</minorNumber>
<namespace/>
</packageVersions>
</PackageVersionHeader>
 <AssignmentRuleHeader xmlns="urn:enterprise.soap.sforce.com" >
<assignmentRuleId/>
<useDefaultRule>0</useDefaultRule>
</AssignmentRuleHeader>
 <EmailHeader xmlns="urn:enterprise.soap.sforce.com" >
<triggerAutoResponseEmail>0</triggerAutoResponseEmail>
<triggerOtherEmail>0</triggerOtherEmail>
<triggerUserEmail>0</triggerUserEmail>
</EmailHeader>
 <SessionHeader xmlns="urn:enterprise.soap.sforce.com" >
<sessionId>×××</sessionId>←I wrote login response
</SessionHeader>
 <AllOrNoneHeader xmlns="urn:enterprise.soap.sforce.com" >
<allOrNone>1</allOrNone>
</AllOrNoneHeader>
 <AllowFieldTruncationHeader xmlns="urn:enterprise.soap.sforce.com" >
<allowFieldTruncation>1</allowFieldTruncation>
</AllowFieldTruncationHeader>
 <MruHeader xmlns="urn:enterprise.soap.sforce.com" >
<updateMru>false</updateMru>
</MruHeader>
 <header xmlns="http://schemas.cordys.com/General/1.0/" >
 <Logger xmlns="http://schemas.cordys.com/General/1.0/" >
<DC xmlns="http://schemas.cordys.com/General/1.0/" name="XForms" >/testtool/testtool.caf</DC>
<DC xmlns="http://schemas.cordys.com/General/1.0/" name="XForms" >/com/cordys/cusp/cusp.caf</DC>
<DC xmlns="http://schemas.cordys.com/General/1.0/" name="hopCount" >0</DC>
<DC xmlns="http://schemas.cordys.com/General/1.0/" name="correlationID" >000C29C8-AEB7-11E0-F9D6-E4AC4C24F586</DC>
</Logger>
</header>
 <i18n:international>
<locale>en-us</locale>
</i18n:international>
</SOAP:Header>
 <SOAP:Body>
 <upsert xmlns="urn:enterprise.soap.sforce.com" >
<externalIDFieldName>Id</externalIDFieldName>
 <sObjects xsi:type="Account" >
<Fax>03-1111-1111</Fax>
<Name>AAA</Name>
<Phone/>
<Id/>
</sObjects>
</upsert>
</SOAP:Body>
</SOAP:Envelope>

-----------------------------------------------------------------------------------------------------------

 

how should i do?To use a serverUrl property .

where I change request?

 

Thanks.

 

 

 

 

 

SuperfellSuperfell

the URL is a HTTP property not an soap payload property, you would need to review the docs for whatever tool you're using.

sekkisekki

Thanks Simon

 

I use tool that is Cordys Application.

 

Anyway I review the docs of Cordys.

 

If you get new information , please tell me.

 

Thanks.

kprkpr

Hi Simon,

 

We are getting a similar error when trying to make a REST API call to our org.

 

This is the architecture:

We have our own server which is configured to do SSO to our SFDC instance.

 

When user passes federation id to our server, we do SSO to our SFDC org and then pass on the access_token to the user.

Using the access token, user tries to make a REST API call to the SFDC org like this:

 

curl https://login.salesforce.com/services/data/v20.0/sobjects/Account/001d000000AE02F?fields=AccountNumber,BillingPostalCode -H "Content-Type: application/json" -H 'Authorization: OAuth 00Dd0000000cKfP!ASAAQGFk.8lNP3Q2QciuDMCAVygr5zBql_aAiNwSc4uzFbtskZEmnVIk2YHqih5eccVZ1k320nMg.hEDLzGAOgevMo37dU2L' -H "X-PrettyPrint:1"

 

It returns this error:

[ {
"message" : "Destination URL not reset. The URL returned from login must be set",
"errorCode" : "URL_NOT_RESET"
} ]

 

We have mydomain enabled in our SFDC org. Could this be an issue? 

 

Thanks

kpr

Nirav_ShahNirav_Shah
Hi @kpr,

Did you get an answer for this? I am also facing the same issue. 
[
    {
        "errorCode": "URL_NOT_RESET",
        "message": "Destination URL not reset. The URL returned from login must be set"
    }
]
And I also have mydomain enabled in SFDC org.

Thanks
Nirav