I'm trying to send multipart/related
request through postman. But I'm getting error:
<soap:Reason>
<soap:Text xml:lang="en">Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]</soap:Text>
</soap:Reason>
Endpoint: POST https://sdummy.test.net/enterprise/soap?ServiceName=IntegrationManagementService
Headers I'm using:
Content-Type:multipart/related; start="<rootpart*[email protected]>"; type="application/xop+xml"; boundary="uuid:7661941e-06d9-4961-af10-db612c7ffcc4"; start-info="text/xml"
Soapaction:http://www.taleo.com/ws/integration/toolkit/2011/05/management/IntegrationManagementService#submitLargeDocument
Accept:text/xml, multipart/related, text/html, image/gif, image/jpeg, *;q=.2, */*; q=.2
User-Agent:Oracle JAX-WS 2.1.5
Transfer-Encoding:chunked
Host:sdummy.test.net
Payload:
--uuid:7661941e-06d9-4961-af10-db612c7ffcc4
Content-Id: <rootpart*[email protected]>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/03/addressing" xmlns:tns="http://www.taleo.com/ws/integration/toolkit/2011/05/management">
<SOAP-ENV:Header>
<wsa:MessageID>ps_sd_7701</wsa:MessageID>
<wsa:Action>http://www.taleo.com/ws/integration/toolkit/2005/07/action/import</wsa:Action>
<wsa:ReplyTo>
<wsa:Address>http://www.taleo.com/ws/integration/toolkit/2005/07/addressing/queue</wsa:Address>
</wsa:ReplyTo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsa:submitLargeDocument>
<wsa:Document>
<Include xmlns="http://www.w3.org/2004/08/xop/include" href="cid:[email protected]"/>
</wsa:Document>
</wsa:submitLargeDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--uuid:7661941e-06d9-4961-af10-db612c7ffcc4
Content-Id:<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: binary
<ImportEntities>
<Candidate>
<EmailAddress>[email protected]</EmailAddress>
</Candidate>
</ImportEntities>
--uuid:7661941e-06d9-4961-af10-db612c7ffcc4--
Postman Generated cURL command:
curl --location --request POST 'https://stghilton.taleo.net/enterprise/soap?ServiceName=IntegrationManagementService' \
--header 'Content-Type: multipart/related; start="<rootpart*[email protected]>"; type="application/xop+xml"; boundary="uuid:7661941e-06d9-4961-af10-db612c7ffcc4"; start-info="text/xml"' \
--header 'Soapaction: http://www.taleo.com/ws/integration/toolkit/2011/05/management/IntegrationManagementService#submitLargeDocument' \
--header 'Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *;q=.2, */*; q=.2' \
--header 'User-Agent: Oracle JAX-WS 2.1.5' \
--header 'Transfer-Encoding: chunked' \
--header 'Host: stghilton.taleo.net' \
--header 'Authorization: Basic UGhlbm9tOj80K2pTSlAz' \
--data-raw '--uuid:7661941e-06d9-4961-af10-db612c7ffcc4
Content-Id: <rootpart*[email protected]>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary
<?xml version='\''1.0'\'' encoding='\''UTF-8'\''?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/03/addressing" xmlns:tns="http://www.taleo.com/ws/integration/toolkit/2011/05/management">
<SOAP-ENV:Header>
<wsa:MessageID>ps_sd_7701</wsa:MessageID>
<wsa:Action>http://www.taleo.com/ws/integration/toolkit/2005/07/action/import</wsa:Action>
<wsa:ReplyTo>
<wsa:Address>http://www.taleo.com/ws/integration/toolkit/2005/07/addressing/queue</wsa:Address>
</wsa:ReplyTo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsa:submitLargeDocument>
<wsa:Document>
<Include xmlns="http://www.w3.org/2004/08/xop/include" href="cid:[email protected]"/>
</wsa:Document>
</wsa:submitLargeDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--uuid:7661941e-06d9-4961-af10-db612c7ffcc4
Content-Id:<[email protected]>
Content-Type: text/xml; charset=ISO-8859-1
Content-Transfer-Encoding: binary
<ImportEntities>
<Candidate>
<EmailAddress>[email protected]</EmailAddress>
</Candidate>
</ImportEntities>
--uuid:7661941e-06d9-4961-af10-db612c7ffcc4--'
Can someone help me with this please?
From a purely technical point of view the only error I can see is your handling of the multipart structure.
More precisely, you need to skip a line (blank line) between the headers of each part and their body, e.g change the 3 lines :
Content-Id: <rootpart*[email protected]>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary
<?xml version='\''1.0'\'' encoding='\''UTF-8'\''?>
To 4 lines :
Content-Id: <rootpart*[email protected]>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary
<?xml version='\''1.0'\'' encoding='\''UTF-8'\''?>
At each part, e.g. also here :
Content-Transfer-Encoding: binary
<ImportEntities>
To
Content-Transfer-Encoding: binary
<ImportEntities>
It is mandatory in multipart content to split the header from the body by a blank line.