• akash gupta034856688323083473
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
Getting error 500 Internal server error (Soap Action Http header missing)  while fetching data using BulkApi.
Getting error 500 Internal server error (Soap Action Http header missing)  while fetching data using BulkApi.
Getting error 500 Internal server error (Soap Action Http header missing)  while fetching data using BulkApi.

Hi

I am new to Salesforce

I have a bulk api code in C# which reads data from sql server database and imports it to Salesforce.This code works fine in the Visual Studio 2008.

But my requirement is to call the code from Salesforce,so i am using Soap Api for it.

I have created a webservice in C# and in a function named getbulkdata() i have pasted my bulk api code there.

Now this code works fine in the Webservice test client i.e. it imports data from sql server to salesforce.

But now when i m calling the same code from Salesforce it gives me the following error:

 

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: Unable to connect to the remote server faultcode=a:InternalServiceFault faultactor=

Error is in expression '{!getSaveToObjectPage}'

 

 

 

 

The wsdl2Apex class getbulkdata() method is as below:

 

 public String Getbulkdata(String tablename,String databasename,String Objectname) {
            sqlServerConnector23.Getbulkdata_element request_x = new sqlServerConnector23.Getbulkdata_element();
            sqlServerConnector23.GetbulkdataResponse_element response_x;
            request_x.tablename = tablename;
            request_x.databasename = databasename;
            request_x.Objectname = Objectname;
            Map<String, sqlServerConnector23.GetbulkdataResponse_element> response_map_x = new Map<String, sqlServerConnector23.GetbulkdataResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IService1/Getbulkdata',
              'http://tempuri.org/',
              'Getbulkdata',
              'http://tempuri.org/',
              'GetbulkdataResponse',
              'sqlServerConnector23.GetbulkdataResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetbulkdataResult;
        }

 

The method is called from salesforce in the following way:

 

 public PageReference getSaveToObjectPage() {
     sqlArray23.ArrayOfstring a = new sqlArray23.ArrayOfstring();
     sqlServerConnector23.BasicHttpBinding_IService1 stub = new sqlServerConnector23.BasicHttpBinding_IService1();
     String operation='insert';
     stub.timeout_x = 120000; 
     
       
    String Message= stub.Getbulkdata(tablename,databasename,obj name);
   
           PageReference newpage = new PageReference('/apex/SqlServer2005Login_Import6');
            newpage.setRedirect(false); 
              return newpage;  
     
     }

 

 Can some one please tell me y am i getting the Soap Fault unable to connect to remote server.

As the same code is working fine in webservice (WCF) Test Client.

 

 

Thanks in advance.

Please let me know if you require anythg more like the bulk api code or something else.