• NileshA
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

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

Hi,

I need to push bulk data back to salesforce in one of my applications. I am using OAuth to authenticate and then access organization data from my external application.
Fetching bulk data is fine as it happens in a single query. No governor limits exceeded for number of SOQLs, size of response is managed by using limit, sort.

Problem: I am facing governor limit issues in pushing data back to salesforce since I am updating each record individually using REST _HttpMethod How can I update data back in bulk programitcally? Is Bulk API the only solution? I want to avoid Bulk API as it deals with the Curl system call and file gneration to pass on data. Isn't there an option in the REST API?

Can any one suggest the best method to achieve this, so that I do not cross the governor limits.

Regards,
Nilesh

I need to write an Apex application which pushes data out of salesforce to an external application. The external application processes the records and needs to update them back to salesforce account.
I am using ruby for my external application. Since Ruby does not have great support for SOAP, I have used REST through HTTP Callout to push data out of salesforce. This comes with a limitation, salesforce allows only 10 CallOuts per action. Is there any other way? If not I will get SOAP working for me some how. But following is where I am stuck:

To pass data back to Salesforce, I will have to write global apex class with methods as ‘webService’. But since the WSDL generated is only for authenticated user, how will my external application get the session. Looking at the PHP example at http://blog.jeffdouglas.com/2009/04/05/using-php-to-call-an-apex-web-service/
I find that user name, password are required. But since my application is an apex application and any salesforce user can add and use it, how can I get session for each of the users using the app. I can’t have username, password of each of those.

I am new to Apex and not sure what are the best practices for pushing Data In and out of Salesforce through Apex. Also, not sure if above is actually feasible with Apex in first place.

Hi,

I need to run some Scheduled Jobs in my Apex application. I am able to Schedule the Job and can even see it under

Setup | Monitoring | Scheduled Jobs

Whenever the Schedule occurs, I can see the 'Started' column in the Interface updated accordingly, but nothing happens further. When I had some error in  code I got notified by email, so that works. But now I have no errors and its not executing.

Under 'Setup | Monitoring | Apex Jobs' I see the job Immediately after it is submitted. Strangely it shows the 'Completion Date' even before the schedule occurs and status as 'Completed'

I am using Http Callouts in my Job, and have defined the method with annotation

@future(callout=true)


If I call the method directly without using schedule, It does execute as expected.

Can any one help me debug this. How do I debug what's going wrong in the scheduler. I waited for almost 12hrs after the Job started, but it did not get executed. Also, does any one have an idea about how long does it take approximately for the Job to get executed after it starts, as it is dependent on the' Job queue activity'?

Regards,
Nilesh

 

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

Hi,

I need to push bulk data back to salesforce in one of my applications. I am using OAuth to authenticate and then access organization data from my external application.
Fetching bulk data is fine as it happens in a single query. No governor limits exceeded for number of SOQLs, size of response is managed by using limit, sort.

Problem: I am facing governor limit issues in pushing data back to salesforce since I am updating each record individually using REST _HttpMethod How can I update data back in bulk programitcally? Is Bulk API the only solution? I want to avoid Bulk API as it deals with the Curl system call and file gneration to pass on data. Isn't there an option in the REST API?

Can any one suggest the best method to achieve this, so that I do not cross the governor limits.

Regards,
Nilesh

I need to write an Apex application which pushes data out of salesforce to an external application. The external application processes the records and needs to update them back to salesforce account.
I am using ruby for my external application. Since Ruby does not have great support for SOAP, I have used REST through HTTP Callout to push data out of salesforce. This comes with a limitation, salesforce allows only 10 CallOuts per action. Is there any other way? If not I will get SOAP working for me some how. But following is where I am stuck:

To pass data back to Salesforce, I will have to write global apex class with methods as ‘webService’. But since the WSDL generated is only for authenticated user, how will my external application get the session. Looking at the PHP example at http://blog.jeffdouglas.com/2009/04/05/using-php-to-call-an-apex-web-service/
I find that user name, password are required. But since my application is an apex application and any salesforce user can add and use it, how can I get session for each of the users using the app. I can’t have username, password of each of those.

I am new to Apex and not sure what are the best practices for pushing Data In and out of Salesforce through Apex. Also, not sure if above is actually feasible with Apex in first place.

Hi,

I need to run some Scheduled Jobs in my Apex application. I am able to Schedule the Job and can even see it under

Setup | Monitoring | Scheduled Jobs

Whenever the Schedule occurs, I can see the 'Started' column in the Interface updated accordingly, but nothing happens further. When I had some error in  code I got notified by email, so that works. But now I have no errors and its not executing.

Under 'Setup | Monitoring | Apex Jobs' I see the job Immediately after it is submitted. Strangely it shows the 'Completion Date' even before the schedule occurs and status as 'Completed'

I am using Http Callouts in my Job, and have defined the method with annotation

@future(callout=true)


If I call the method directly without using schedule, It does execute as expected.

Can any one help me debug this. How do I debug what's going wrong in the scheduler. I waited for almost 12hrs after the Job started, but it did not get executed. Also, does any one have an idea about how long does it take approximately for the Job to get executed after it starts, as it is dependent on the' Job queue activity'?

Regards,
Nilesh

 

Can an OAuth access token be used instead of the session id for the Bulk API?

Thanks,

Roger