+ Start a Discussion

SOAPAction HTTP header missing

Sorry, the previous two messages were sent out by accidental key stokes.  Here is the question again:
I recently migrated my Ajax scontrol to the new Winter '07 release and started to get the following error message when making queries to my company data in SFDC:
       {faultcode:'soapenv:Client', faultstring:'SOAPAction HTTP header missing',}
The query was simple as "select ... from ... where...".
I never saw this before even in the prerelease.  I don't think we need to set the SOAP header everytime we call the sforce.connection.query(...).  But why I am getting this error.  If anyone has similar experience and know how to get rid of this error, please respond.
Best Regards,
A code snippet might prove useful here.
  <script src="/soap/ajax/8.0/connection.js" type="text/javascript"></script>

             var soql = "select List_ID__c,Member_ID__c,Parent_Member_ID__c,HQ_Account_Name__c,HQ_Duns_ID__c,Sub_Account_Name__c,Subsidiary_Duns_ID__c,market_name__c,Account_Level__c,ownerId,Id from Test_RepAssignment__c where List_Id__c = '6'"; 
       var result = sforce.connection.query(soql,
The error happens both in Firefox and IE. In IE, the error message says "Object Error". Since I don't need to construct the SOAP message myself, this error looks weird. And also, I'm getting this error randomly, sometimes more often than other times. It's not like getting this error all the time, only once in a while. Thanks,
connection.js will set SOAPAction HTTP header for you.

Do you run the request via a proxy, and the proxy is stripping this HTTP header?
I cant think of any other reason for not including soapAction header in the request.

Thanks for the reply.  I'm not using proxy.  I've never seen this error before.  I just can't think of anything either.  The Ajax toolkit API call is so straightforward,and I can't imagine anything could go wrong.

I'm still getting the SOAPAction HTTP Header error.  I'm getting this error on different computers too.  Some of them are company machines behind firewall and some of them are just out there on the internet.  I posted a simplified version of my code before, but here is the complete version without modifying a single character:


 function srchAccounts_aa(form) {
  try {
   document.getElementById("divRunTime1").innerHTML = "";
   srchStartDate = new Date();

   var tmpout = "";
   var listId = trim(document.getElementById("listId_aa").value);
   var memberId = trim(document.getElementById("memberId_aa").value);
   var hqAccountName = trim(document.getElementById("hqAccountName_aa").value);
   var hqDunsId = trim(document.getElementById("hqDunsId_aa").value);
   var subAccountName = trim(document.getElementById("subAccountName_aa").value);
   var subDunsId = trim(document.getElementById("subDunsId_aa").value);
   var market = document.getElementById("market_aa").value; //a select control
   market = (market=="-- Choose One --")—"":market;
   var vSegment = trim(document.getElementById("vSegment_aa").value);
   vSegment = (vSegment=="-- Choose One --")–"":vSegment;
   var unassignedOnly = document.getElementById("unassignedOnly_aa").checked;
   var rhqOnly = document.getElementById("rhqOnly_aa").checked;

   var errMsg = "";
   if(listId.length==0 && memberId.length==0 && hqAccountName.length==0 && hqDunsId.length==0 && subDunsId.length==0 && subAccountName.length==0) {
    errMsg += "One of the following is required:\r\n" +
        "List ID, Member ID, HQ Account Name, HQ Duns ID, Subsidiary Account Name, Subsidiary Duns ID.";

   if(errMsg.length>0) {

   var aryDataIds = new Array("listId_aa", "memberId_aa", "hqDunsId_aa", "subDunsId_aa");
   var aryVdtIds = new Array("vdtListId_aa", "vdtMemberId_aa", "vdtHqDunsId_aa", "vdtSubDunsId_aa");

   if(!validateInput(aryDataIds, aryVdtIds))

   displayMsg("Please wait while searching accounts...","divRunTime1",false, false);

   var srchCrit1 = " ";
   srchCrit1 += (listId.length>0)˜" List_ID__c='" + listId + "' and " : " ";
   srchCrit1 += (memberId.length>0)™" Member_ID__c='" + memberId + "' and " : " ";
   srchCrit1 += (hqAccountName.length>0)?" HQ_Account_Name__c like '%" + hqAccountName + "%' and " : " ";
   srchCrit1 += (hqDunsId.length>0)?" HQ_Duns_Id__c like '%" + hqDunsId + "%' and " : " ";
   srchCrit1 += (subAccountName.length>0)?" Sub_Account_Name__c like '%" + subAccountName + "%' and " : " ";
   srchCrit1 += (subDunsId.length>0)?" Subsidiary_Duns_Id__c like '%" + subDunsId + "%' and " : " ";
   srchCrit1 += (market.length==0)?" ":" Market_Name__c='" + market + "' and ";
   srchCrit1 += (vSegment.length==0)?" ":" Vertical_Segment__c='" + vSegment + "' and ";
   srchCrit1 += (unassignedOnly)?" Name='Unassigned' and " : " ";
   srchCrit1 += " Delete__c=false and ";
   srchCrit1 += (rhqOnly)?" Account_Level__c='RHQ' " : " id<>null "; //:" id<>null "; (if this is the last line)

   var soql = "";

   if(_debug) {
    soql = "select Test_Account_Assignment__c,List_ID__c,Member_ID__c,Parent_Member_ID__c,HQ_Account_Name__c,HQ_Duns_ID__c,Sub_Account_Name__c,Subsidiary_Duns_ID__c,market_name__c,Vertical_Segment__c,Account_Level__c,name,ae_s_email__c,ownerId,Id from " + tab_assigned_rep_private + " where " + srchCrit1;
   else {
    soql = "select Test_Account_Assignment__c,List_ID__c,Member_ID__c,Parent_Member_ID__c,HQ_Account_Name__c,HQ_Duns_ID__c,Sub_Account_Name__c,Subsidiary_Duns_ID__c,market_name__c,Vertical_Segment__c,Account_Level__c,name,ae_s_email__c,ownerId,Id from " + tab_assigned_rep_private + " where " + srchCrit1;
   var qr = sforce.connection.query(soql,
  catch(e) {
   alert("Exception in srchAccounts_aa: " + e);


I'm looking forward to getting some advice on this.  This error is annoying.  The frequency of this error message is on the average of 1 out 10.  If I kept submitting the same request, I will get the error eventually. 



I have not seen this error before, so not sure what is going wrong here.

Anyway, here are couple of things to try out:

1. turn on the debug for Ajax Toolkit before making the api request:
    sforce.debug.trace = true;

2. Get the ethereal trace of the requests. You can download ethereal here:

Make sure you are doing http request while getting ethereal trace.

This may give some hints on what is going wrong.


Is there a known cause for this issue? I am having the same error message in an s-control.

Here's the code:


function processRequest() {

 if(confirm("Are you sure —\n\nContinuing will update all CS email Contacts.")) {
  // Start looping through all opportunities that are not closed / lost
  document.getElementById('save').value = "Processing";
  document.getElementById('save').disabled = true;
  timer= setInterval('checkDone()',1000);
  try {  
   document.getElementById('progress').style.display = 'inline';
      var result = sforce.connection.query("Select Id,Name from Account WHERE isDeleted=false", {
      onSuccess : success, onFailure : failure});
  catch(error) {
   alert("Error retrieving Accounts: "+error);
   return 0;

function success(result) {
  var it = new sforce.QueryResultIterator(result);
    var record = it.next();
 var result2 = sforce.connection.query("Select Id,Name from Services__c WHERE Account__c='"+record.Id+"'");     
 if(result2.size==1) {
  var recordsS = result2.getArray('records');
  var sid = recordsS[0].Id;
 } else if(result2.size>1) {
  adjustStatusErrors("Account "+record.Name+" has more than 1 Service. Contacts not updated.");

This call is generating the error :

var result = sforce.connection.query("Select Id,Name from Account WHERE isDeleted=false", {
    onSuccess : success, onFailure : failure});

The error only occurs after a large amount of accounts have been processed allready.

Are there anyupdates on this thread?

I am experiencing the same issue.

I am polling the API from a page to monitor for data changes. Typically users do not stay on a oage for too long and this error does not occur. Occasionally, if a page remains open for a longer period of time, after a number of query call I get this error. It seems to be relatively consistent - about the same number of queries are successful every time before the error happens.

Thank you.

Hello there,


I've got the same problem.


I want to access saleforce through soap request.


My first test was by using SOAP UI and everything works fine.


Now, I want to use my "real" platform, which is based on jboss.


I can only use XML Requests and a webservice adapter, which I can configure only with the ws.adress (https://login.salesforce.com:443/services/Soap/c/22.0) and, if i want the soap action.


This is my request:

<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
		<n1:login xmlns:n1="urn:partner.soap.sforce.com">
			<n1:password>here is my pw and token</n1:password>


And this is my result:


<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
			<faultstring>SOAPAction HTTP header missing</faultstring>



So what is wrong with my request. I copied it directly from SOAP UI.


Greetings lstrike

@Istrike did u got solution for this issue ,Me too facing the same issue