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
NileshANileshA 

Bulk API SOAP Error: The SOAP request must use SOAP 1.1..

Hi,

I am getting error "The SOAP request must use SOAP 1.1, did not recieve a SOAP 1.1 Envelope as the document root" when trying to create a job for Bulk API http://www.salesforce.com/us/developer/docs/api_asynchpre/api_bulk.pdf

I have used OAuth protocol for authenticating with Force.com, and am using the method mentioned here to make my call.

I have correctly passed all the information required as mentioned in the Bulk API doc. Like passing access_token for sessionID, replacing ! in sessionID with \!
Also, I am using the same .txt file containing the XML required to create a job.

Following is my sample command:

curl https://xxx.salesforce.com/services/Soap/u/24/xxxxxxxxx/job -H "X-SFDC-Session: xxxxxxx\!xxxxxxxxxxxxxxx.o.SerXZ" -H "Content-Type: text/xml; charset=UTF-8" -H "SOAPAction: Update" -d @contact_job.txt

 


Kindly note that I have done the following changes:
Content-Type to text/xml from Content-Type: application/xml
Added header SOAPAction: Update
after I was getting error messages asking for the changes.

Following is the content of my contact_job.txt:

<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
 <operation>upsert</operation>
 <object>Contact</object>
 <contentType>CSV</contentType>
</jobInfo>

 

I have tried both curl and direct Http POST, but same thing.
Has anyone faced a similar problem? Can anyone help he understand, resolve this error?

Regards,
Nilesh

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

The /services/Soap/u/24/xxx/job is not the correct URL for the bulk API, double check that.

All Answers

SuperfellSuperfell

The /services/Soap/u/24/xxx/job is not the correct URL for the bulk API, double check that.

This was selected as the best answer
NileshANileshA

Thanks Simon, I corrected the URL and it works now.

DA SILVA BrunoDA SILVA Bruno

Hi, 
I got the same issue but my URL is right. Can you take a look at this please ?
Here is the curl commande i use, xxx is my own information.
curl https://xxx.salesforce.com/services/async/40.0/job -H "X-SFDC-Session: xxx" -H "Content-Type: text/xml; charset=UTF-8" "SOAPAction: insert" -d @job.txt

And here is the job.txt file.
<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="<a target="_blank" href="http://www.force.com/2009/06/asyncapi/dataload" rel="nofollow">http://www.force.com/2009/06/asyncapi/dataload</a>">
<operation>upsert</operation>
   <object>Contact</object>
   <contentType>CSV</contentType>
</jobInfo>
Please, I need help.
Thanks