Sample SOAP Messages-create


This topic provides the following sample SOAP messages:

Sample Request Message-create Call-Enterprise API

POST /services/Soap/c/5.0 HTTP/1.0  

Content-Type: text/xml; charset=utf-8  
Accept: application/soap+xml, application/dime, multipart/related, text/*  
User-Agent: Axis/1.1  
Host: na1.salesforce.com  
Cache-Control: no-cache  
Pragma: no-cache  

SOAPAction: ""  
Content-Length: 2200   
 
<?xml version="1.0" encoding="UTF-8"?> 

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance">  
      <soapenv:Header>   

         <ns1:SessionHeader soapenv:mustUnderstand="0" 
xmlns:ns1="urn:enterprise.soap.sforce.com">    
            <ns2:sessionId 
xmlns:ns2="urn:enterprise.soap.sforce.com">WgMUbbkPm_jXlNKOSU</ns2:sessionId>   

         </ns1:SessionHeader>  
      </soapenv:Header>  
      <soapenv:Body>   
         <create xmlns="urn:enterprise.soap.sforce.com">    

            <sObjects xsi:type="ns3:Account" 
xmlns:ns3="urn:sobject.enterprise.soap.sforce.com">     
               <ns3:AccountNumber>0000000</ns3:AccountNumber>     
               <ns3:BillingCity>Wichita</ns3:BillingCity>     

               <ns3:BillingCountry>US</ns3:BillingCountry>     
               <ns3:BillingPostalCode>87901</ns3:BillingPostalCode>     
               <ns3:BillingState>KA</ns3:BillingState>     

               <ns3:BillingStreet>4322 Haystack Boulevard</ns3:BillingStreet>     
               <ns3:Description>World class hay makers.</ns3:Description>     
               <ns3:Fax>555.555.5555</ns3:Fax>     

               <ns3:Industry>Farming</ns3:Industry>     
               <ns3:Name>Golden Straw</ns3:Name>     
               <ns3:NumberOfEmployees>40</ns3:NumberOfEmployees>     

               <ns3:Ownership>Privately Held</ns3:Ownership>     
               <ns3:Phone>666.666.6666</ns3:Phone>     
               <ns3:Website>www.oz.com</ns3:Website>    

            </sObjects>    
         </create>  
      </soapenv:Body> 
   </soapenv:Envelope> 

Sample Response Message-create Call-Enterprise API

HTTP/1.0 200 OK  
Server: sfdc  
Content-Type: text/xml; charset=utf-8  
Date: Wed, 07 Jul 2004 18:01:21 GMT   

 
<?xml version="1.0" encoding="UTF-8"?> 
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance">  

      <soapenv:Body>   
         <createResponse xmlns="urn:enterprise.soap.sforce.com">    
            <result>     
               <errors xsi:nil="true"/>     

               <id>00130000002K9TnAAK</id>     
               <success>true</success>    
            </result>    

         </createResponse>  
      </soapenv:Body> 
   </soapenv:Envelope> 

Sample Request Message-create Call-Partner API

POST https://na1.salesforce.com/services/Soap/u/5.0 HTTP/1.1  
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 
1.1.4322.573)  
Content-Type: text/xml; charset=utf-8  
SOAPAction: ""  
Content-Length: 2056  

Expect: 100-continue  
Host: na1.salesforce.com   
 
<?xml version="1.0" encoding="utf-8"?> 
   <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://
www.w3.org/2001/XMLSchema"> 
      <soap:Header> 
         <SessionHeader xmlns="urn:partner.soap.sforce.com"> 
            <sessionId>4I1yNabX__jXlNKOSU</sessionId> 

         </SessionHeader> 
      </soap:Header> 
      <soap:Body> 
         <create xmlns="urn:partner.soap.sforce.com"> 

            <sObjects> 
               <type xmlns="urn:sobject.partner.soap.sforce.com">Account</type> 
               <Id xsi:nil="true" xmlns="urn:sobject.partner.soap.sforce.com" /> 

               <AccountNumber xmlns="">0000000</AccountNumber> 
               <BillingCity xmlns="">Wichita</BillingCity> 
               <BillingCountry xmlns="">US</BillingCountry> 

               <BillingState xmlns="">KA</BillingState> 
               <BillingStreet xmlns="">4322 Haystack Boulevard</BillingStreet> 
               <BillingPostalCode xmlns="">87901</BillingPostalCode> 

               <Description xmlns="">World class hay makers.</Description> 
               <Fax xmlns="">555.555.5555</Fax> 
               <Industry xmlns="">Farming</Industry> 

               <Name xmlns="">Golden Straw</Name> 
               <NumberOfEmployees xmlns="">40</NumberOfEmployees> 
               <Ownership xmlns="">Privately Held</Ownership> 

               <Phone xmlns="">666.666.6666</Phone> 
               <Website xmlns="">www.oz.com</Website> 
            </sObjects> 
            <sObjects> 

               <type xmlns="urn:sobject.partner.soap.sforce.com">Account</type> 
               <Id xsi:nil="true" xmlns="urn:sobject.partner.soap.sforce.com" /> 

               <AccountNumber xmlns="">0000000</AccountNumber> 
               <BillingCity xmlns="">Wichita</BillingCity> 
               <BillingCountry xmlns="">US</BillingCountry> 

               <BillingState xmlns="">KA</BillingState> 
               <BillingStreet xmlns="">4322 Haystack Boulevard</BillingStreet> 
               <BillingPostalCode xmlns="">87901</BillingPostalCode> 

               <Description xmlns="">World class hay makers.</Description> 
               <Fax xmlns="">555.555.5555</Fax> 
               <Industry xmlns="">Farming</Industry> 

               <Name xmlns="">Golden Straw</Name> 
               <NumberOfEmployees xmlns="">40</NumberOfEmployees> 
               <Ownership xmlns="">Privately Held</Ownership> 

               <Phone xmlns="">666.666.6666</Phone> 
               <Website xmlns="">www.oz.com</Website> 
            </sObjects> 
         </create> 

      </soap:Body> 
   </soap:Envelope> 

Sample Response Message-create Call-Partner API

HTTP/1.1 200 OK  

Server: sfdc  
Content-Type: text/xml; charset=utf-8  
Transfer-Encoding: chunked  
Date: Wed, 07 Jul 2004 16:39:39 GMT   
  
<?xml version="1.0" encoding="UTF-8"?> 

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance">  
      <soapenv:Body>   

         <createResponse xmlns="urn:partner.soap.sforce.com">    
            <result>     
               <errors xsi:nil="true"/>     

               <id>00130000002K9QgAAK</id>     
               <success>true</success>    
            </result>    

            <result>     
               <errors xsi:nil="true"/>     
               <id>00130000002K9QhAAK</id>     

               <success>true</success>    
            </result>   
         </createResponse>  

      </soapenv:Body> 
   </soapenv:Envelope> 

© Copyright 2000-2005 SalesForce.com, Inc.
All rights reserved · Various trademarks held by their respective owners.