Bulk API with PK Chunking enabled throws ISE if contentType is application/xml, add support for application/xml
Last updated 2017-10-14 ·Reference W-2697854 ·Reported By 19 users
Summary
Bulk API query jobs with PK Chunking header fail, if the contentType is application/xml.
Error Message:
PKChunking failed. InvalidBatch : Wrong content-type for batch (text/csv), job is of type: application/xml "
Repro
1) Create bulk job with PK Chunking header set
/services/async/32.0/job
Header:
X-SFDC-Session: 00Dxx0000001gGm!ARIAQPoksee72qlXNIgBuKKXb6NqFyb75DY2.mt9l.qL5FF967GzxbI5yPj4GMDbuliksDFy_ekfu.SldgTcygHNnEbGjPBY
Sforce-Enable-PKChunking: chunkSize=1;
Content-Type: application/xml; charset=UTF-8
Body:
<?xml version="1.0" encoding="UTF-8"?><jobInfo
xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<operation>query</operation>
<object>Account</object>
<contentType>XML</contentType>
</jobInfo>
Result -> Bulk job created, e.g, 750xx000000000G
2) Create batch for created job
/services/async/32.0/job/750xx000000000G/batch
Header:
X-SFDC-Session: 00Dxx0000001gGm!ARIAQPoksee72qlXNIgBuKKXb6NqFyb75DY2.mt9l.qL5FF967GzxbI5yPj4GMDbuliksDFy_ekfu.SldgTcygHNnEbGjPBY
Content-Type: application/xml; charset=UTF-8
Body:
select name from account limit 2
Result -> Batch created with error "InternalServerError : PKChunking failed. InvalidBatch : Wrong content-type for batch (text/csv), job is of type: application/xml "
Workaround
Set content-type for batch as text/csv
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.