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
apexuserapexuser 

Error while creating contact from SOAPUI

Hi Folks,

              I am using SOAPUI tool test salesforce wsdl and able test login successfully from SOAPUI tool, now i want to create contact or any object  from SOAPUI so to create a object we need to pass 3 values:seesionId,URL,object(parameters), my i/p xml file is as follows:

 

<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>Ypvyk.2X0HR6tw3mXLByAabOyG5DtZYXSN78N5l_Jg2tFGAQcJ9P0FqJ</urn:sessionId>
      </urn:SessionHeader>
      <urn:CallOptions>
  
      </urn:CallOptions>

   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
         <!--Zero or more repetitions:-->
         <urn:sObjects>
         <urn:type>Contact</urn1:type>
  <lastName>EXAMPLE</lastName>
  <firstName>EXAMPLE</firstName>
      </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

 

 

but i got following error which is:

 

<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>

 

How to set the destination URL? do i need to set in calloptions if so do i need to set "ServerUrl" or "metadataServerUrl"? and finally how to set the values in calloptions.

 

Any sample examples available like how to pass data in xml format in salesforce?

 

Thanks,

SFUser.

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
Its the HTTP URL, its not in the XML request.

All Answers

SuperfellSuperfell
You are sending the http request to www.salesforce.com/... when it should be going to the URL returned in the serverUrl element of the response from the login call.
Ken2009Ken2009
What is the element in the request where you set the serverURL? I only see a sessionID element and not anything for the serverURL in the XML created by SOAPUI.
SuperfellSuperfell
Its the HTTP URL, its not in the XML request.
This was selected as the best answer
susiewhitesusiewhite

How do I change the server end point?  I see the serverUrl value but not what to do with it.  I am using php nusoap examples.