Forum Discussion

kvradhika81's avatar
kvradhika81
New Contributor
15 years ago

Help - Providing multipart/mixed as request from SOAPUI Tool

I am trying to test my RESTful webservice method using SOAP-UI Tool.
The service method uses multipart/mixed mime-type as request.
I am unable to send a multipart/mixed request to the service using the tool.

I posted the issue to Nabble-Jersey forum. They confirmed this is a SOAP-UI Tool issue.
http://jersey.576304.n2.nabble.com/Help ... l#a5506131

Request your inputs on this issue.

Request:

--Boundary_1_27742346_1283484587534
Content-Type: application/xhtml+xml


<?xml version="1.0" encoding="UTF-8"?>
<HTML xmlns:iBubble="http://ntr.lxnx.org">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
..............
</META>
<BODY>
<doc iTag="test1">RYAN MICHAELS, an Individual, Plaintiff, vs. NANCY ZOSS, an Individual; and DOES 1 through 100, inclusive, Defendants ............
...............
.................
ahead<br/>and do<br/>it.<br/><br/></span></doc>
</BODY>
</HTML>


--Boundary_1_27742346_1283484587534
Content-Type: text/plain


Add_document.xml
--Boundary_1_27742346_1283484587534
Content-Type: text/plain


Sudheer
--Boundary_1_27742346_1283484587534
Content-Type: application/xml


<annotationList><annotation id="0b0e8631-a9ad-4045-8ddc-3841ec1058e1" startItag="test1" endItag="test1"><beginIndex>137</beginIndex><endIndex>172</endIndex></annotation></annotationList>
--Boundary_1_27742346_1283484587534--




Response received:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><error><date>2010-09-07T15:43:30.552+05:00</date><responseCode>500 Internal Server Error</responseCode><name>javax.ws.rs.WebApplicationException: org.jvnet.mimepull.MIMEParsingException: Missing start boundary</name><code>SysmanDefault:JAXRS:com.sun.jersey.multipart.impl.MultiPartReader.readFrom#203</code></error>


Here is the Service end stack trace after enabling LoggingFilters:

Sep 8, 2010 9:20:38 AM com.sun.jersey.api.container.filter.LoggingFilter filter
INFO: 2 * Server in-bound request
2 > POST http://localhost:8083/myService/annotation/add
2 > Content-Length: 205001
2 > Content-Type: multipart/mixed; charset=UTF-8
2 > Host: localhost:8083
2 > Connection: Keep-Alive
2 > User-Agent: Apache-HttpClient/4.0-beta2 (java 1.5)
2 >
--Boundary_1_27742346_1283484587534
Content-Type: application/xhtml+xml

<?xml version="1.0" encoding="UTF-8"?>
<HTML xmlns:my="http://ntr.mycompany.org">

></doc>
</BODY>
</HTML>

--Boundary_1_27742346_1283484587534
Content-Type: text/plain

Add_document.xml
--Boundary_1_27742346_1283484587534
Content-Type: text/plain

Sudheer
--Boundary_1_27742346_1283484587534
Content-Type: application/xml

<annotationList><annotation id="0b0e8631-a9ad-4045-8ddc-3841ec1058e1" startItag="test1" endItag="test1"><beginIndex>137</beginIndex><endIndex>172</endIndex></annotation></annotationList>
--Boundary_1_27742346_1283484587534--

09:20:38(09/08) INFO SmapiDebug : Could not find the Error Definition for errorId: com.mycompany.services.rest.ResourceInternalServerException, smLog: com.sun.jersey.multipart.impl.MultiPartReader, using default severity of INFORMATIONAL
09:20:38(09/08) ERROR com.sun.jersey.multipart.impl.MultiPartReader : errorId = com.mycompany.services.rest.ResourceInternalServerException, severity = INF, description = : Wed Sep 08 09:20:38 PKT 2010/500 Internal Server Error/javax.ws.rs.WebApplicationException: org.jvnet.mimepull.MIMEParsingException: Missing start boundary/SysmanDefault:JAXRS:com.sun.jersey.multipart.impl.MultiPartReader.readFrom#203
09:20:38(09/08) ERROR com.sun.jersey.multipart.impl.MultiPartReader : mycompany.sysman.logging.ErrorEvent com.mycompany.services.rest.ResourceInternalServerException Wed Sep 08 09:20:38 PKT 2010/500 Internal Server Error/javax.ws.rs.WebApplicationException: org.jvnet.mimepull.MIMEParsingException: Missing start boundary/SysmanDefault:JAXRS:com.sun.jersey.multipart.impl.MultiPartReader.readFrom#203
Sep 8, 2010 9:20:38 AM com.sun.jersey.api.container.filter.LoggingFilter$Adapter finish
INFO: 2 * Server out-bound response
2 < 500
2 < Content-Type: application/xml
2 <
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><error><date>2010-09-08T09:20:38.892+05:00</date><responseCode>500 Internal Server Error</responseCode><name>javax.ws.rs.WebApplicationException: org.jvnet.mimepull.MIMEParsingException: Missing start boundary</name><code>SysmanDefault:JAXRS:com.sun.jersey.multipart.impl.MultiPartReader.readFrom#203</code></error>
  • Thanks all.

    We are now able to send multipart/mixed request successfully from SOAP-UI/RESTClient to our RESTful Webservice.
    Other than the multipart request, the boundary value should as well be set in the Content-Type header as Content-Type ==> multipart/mixed;boundary=Boundary_1_30199356_1283930553295.
  • I am facing the same problem of I am facing an issue with soapUi while sending an attachment with a POST request it returning http 500 response .
    Could you help me out here ?

    Below is the request/ response

    POST http://hostname/resource/{iD}/attachment HTTP/1.1
    Accept-Encoding: gzip,deflate
    Accept: application/json, text/plain, */*
    Content-Type: multipart/form-data; boundary="----=_Part_9_26847248.1370448182785"
    MIME-Version: 1.0
    Content-Length: 5103
    Host: avenger.int.vb.loc
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


    ------=_Part_9_26847248.1370448182785
    Content-Type: image/jpeg; name=images.jpeg
    Content-Transfer-Encoding: binary
    Content-Disposition: form-data; name="thumbnail"; filename="images.jpeg"

    ˇÿˇ‡ JFIF ˇ€Ñ (! % !1!%)+... 783,7(-/,
    - - - -- --- - - - - -

    HTTP/1.1 500 Internal Server Error
    Content-Length: 5762
    Content-Type: application/json
    Server: Microsoft-HTTPAPI/2.0
    Date: Wed, 05 Jun 2013 16:03:01 GMT




    kvradhika81 wrote:
    Thanks all.

    We are now able to send multipart/mixed request successfully from SOAP-UI/RESTClient to our RESTful Webservice.
    Other than the multipart request, the boundary value should as well be set in the Content-Type header as Content-Type ==> multipart/mixed;boundary=Boundary_1_30199356_1283930553295.