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
sandeep sankhlasandeep sankhla 

Facing issue while requesting from SOAP API

I am facing the below issue while fetching the layout for account using SOAP tool. Kindly let me know how to solve this error. I have succesfully login via SOAP tool got the session id but while describing the layout I am getting the below error:

 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
     
      <urn:SessionHeader>
         <urn:sessionId>Gau7XKaiaOertNGQf6UAkJiLTzNWDaW9TjrL6vq56kHRXC4yQpRj8_LLq3DZih2</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:describeLayout>
         <urn:sObjectType>Account</urn:sObjectType>
         <urn:layoutName>Account Layout</urn:layoutName>
         </urn:describeLayout>
   </soapenv:Body>
</soapenv:Envelope>
*************************************************************************
Error:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.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>

Please reply in case you have solution .
Best Answer chosen by sandeep sankhla
James LoghryJames Loghry
In addition to the sessionId in your login response, you'll also need the "serverUrl" element.  Take the serverUrl and plug it into the endpoint for your describeLayout request, and you should be all set.

All Answers

James LoghryJames Loghry
In addition to the sessionId in your login response, you'll also need the "serverUrl" element.  Take the serverUrl and plug it into the endpoint for your describeLayout request, and you should be all set.
This was selected as the best answer
bvramkumarbvramkumar
I was looking for similar and found answer here. Thanks James.
suggula rishikanthsuggula rishikanth
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00D2x00000324ZP!ARYAQFAkNo8jA.zkMf0jnucGvj2V8aajBwUP4V6D0PXiPu5UJArtiFXlbKVm8x0znrbEhRMSbwB4IjN3KUvtxuPp7EGjRjSb</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
         <urn:sObjects xsi:type="urn1:Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...">
         <Name>Bluebeards Grog House</Name>
         <Description>It is better than Blackbeards.</Description>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

--------------------------------------------------------------
error
----------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>sf:INVALID_TYPE</faultcode>
         <faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>
         <detail>
            <sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">
               <sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>
               <sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>
               <sf:row>-1</sf:row>
               <sf:column>-1</sf:column>
            </sf:InvalidSObjectFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
suggula rishikanthsuggula rishikanth
plss try to resolve this
Lakshmi Bharathi BattinaLakshmi Bharathi Battina
There is no need to use the number (00D2x00000324ZP!) and make sure that you use metadataserverurl present in login(request page) at the top of the page . for example 
this is the metadataserverurl https://playful-otter-pvinwa-dev-ed.my.salesforce.com at
top like https://playful-otter-pvinwa-dev-ed.my.salesforce.com/services/Soap/c/49.0/