AnsweredAssumed Answered

Uploading BPMN via Process Services API

Question asked by art-bjss on Jun 15, 2017

I'm trying to use the "Import a BPMN 2.0 XML file" REST endpoint, but the server keeps responding with

 

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryrO5BtIH75MSAhJPH' not supported

This happens when using curl, e.g.

 

 curl -X POST \
--header 'Accept: application/json' \
--header 'Authorization: Basic YWRtaW5AYXBwLmFjdGl2aXRpLmNvbTphZG1pbg==' \
--form 'file=bpmn-file.xml' \
'http://localhost:8080/activiti-app/api/enterprise/process-models/import'

 

I've also tried other HTTP clients such as the API explorer at http://localhost:8080/activiti-app/api-explorer.html and Spring's RestTemplate. The same error occurs.

 

Here's a snippet of an HTTP trace

 

POST http://localhost:8080/activiti-app/api/enterprise/process-models/import HTTP/1.1
Host: localhost:8080
User-Agent: curl/7.53.0
Connection: Keep-Alive
Accept: application/json
Authorization: Basic YWRtaW5AYXBwLmFjdGl2aXRpLmNvbTphZG1pbg==
Content-Length: 4972
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------538d8cdd7d21fab7

--------------------------538d8cdd7d21fab7
Content-Disposition: form-data; name="file"; filename="bpmn-file.xml"
Content-Type: application/xml

<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns=http://www.omg.org/spec/BPMN/20100524/MODEL
            --- snip the rest of the request ---
HTTP/1.1 500
-- snip response headers ---
Connection: close

94
{"message":"Internal server error","exception":"Content type 'multipart/form-data;boundary=------------------------538d8cdd7d21fab7' not supported"}
0

Outcomes