Ooblioob
14 years agoNew Contributor
Problems with <rootpart@soapui.org> in MTOM request
I'm trying to build a web service that accepts an MTOM/XOP message format, and I've been using SOAPUI to send the request message. I'm currently using the Axiom library to parse the request message on the server, but I keep getting an exception when it tries to process a message from SOAPUI.
I've tracked the issue down to the use of the <rootpart@soapui.org> as the start of the mime boundary, particularly the use of the '@'. If I change the @ symbol to anything else (using another tool to like Poster send a raw XML message), the message is parsed just fine. My questions are:
1) Is this something that can be configured in SOAPUI? Can I change the name of the mime boundary to some other value?
2) Should I worry about this situation when designing my web service? Is this something inconsistent with the W3 specification or is it valid for a web service client to send this character?
Your help/feedback is greatly appreciated!
I've attached the raw data request below:
Also, I've attached the snippet of code being used by the web service to process the XML (I understand this is a SOAPUI forum, not a java forum. Just in case you're curious or want to suggest an alternative...)
I've tracked the issue down to the use of the <rootpart@soapui.org> as the start of the mime boundary, particularly the use of the '@'. If I change the @ symbol to anything else (using another tool to like Poster send a raw XML message), the message is parsed just fine. My questions are:
1) Is this something that can be configured in SOAPUI? Can I change the name of the mime boundary to some other value?
2) Should I worry about this situation when designing my web service? Is this something inconsistent with the W3 specification or is it valid for a web service client to send this character?
Your help/feedback is greatly appreciated!
I've attached the raw data request below:
POST http://localhost:7001/gwm_web/ProcessAttachmentServlet HTTP/1.1
Accept-Encoding: gzip,deflate
SOAPAction: "http://www.starstandards.org/webservices/2005/10/transport/operations/ProcessMessage/v1_01/ProcessAttachment"
Content-Type: multipart/related; type="application/xop+xml"; start="<rootpart@soapui.org>"; start-info="text/xml"; boundary="----=_Part_21_16612493.1298927643574"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:7001
Content-Length: 3589
------=_Part_21_16612493.1298927643574
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart@soapui.org>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.starstandards.org/webservices/2005/10/transport">
<soapenv:Header>
<payloadManifest>
<manifest contentID="Content0" element="ProcessAttachment" namespaceURI="http://www.starstandards.org/STAR"/>
</payloadManifest>
</soapenv:Header>
<soapenv:Body>
<ProcessMessage>
<payload>
<content id="Content0">
<s:ProcessRepairOrder xsi:schemaLocation="http://www.gm.com/2006/GWM v1.01/GWM_TI_ProcessRepairOrder.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.starstandards.org/STAR" xmlns:gwm="http://www.gm.com/2006/GWM">
<s:ApplicationArea>
<s:Sender>
<s:Component>Sample Application</s:Component>
<s:Task>ProcessAttachment</s:Task>
<s:CreatorNameCode>Sample DMS</s:CreatorNameCode>
<s:SenderNameCode>XX</s:SenderNameCode>
<s:DealerNumber>114889</s:DealerNumber>
<s:DealerCountry>US</s:DealerCountry>
</s:Sender>
<s:CreationDateTime>2010-03-26T13:37:05Z</s:CreationDateTime>
<s:Destination>
<s:DestinationNameCode>Sample Destination</s:DestinationNameCode>
<s:DestinationURI/>
<s:DestinationSoftwareCode>Sample Software</s:DestinationSoftwareCode>
</s:Destination>
</s:ApplicationArea>
<s:DataArea xsi:type="gwm:DataAreaExtended">
<s:Process/>
<s:RepairOrder>
<s:Header xsi:type="gwm:RepairOrderHeaderExtended">
<s:DocumentId/>
</s:Header>
<s:Job xsi:type="gwm:JobExtended">
<s:JobNumber/>
<s:OperationId>Warranty Claim</s:OperationId>
<s:OperationName/>
<s:CodesAndComments/>
<s:Diagnostics/>
<s:WarrantyClaim xsi:type="gwm:WarrantyClaimExtended">
<s:OEMClaimNumber>002001692633</s:OEMClaimNumber>
<gwm:Attachment>
<gwm:File><inc:Include href="cid:Test.txt" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></gwm:File>
<gwm:Filename>ImportantImage.jpg</gwm:Filename>
</gwm:Attachment>
</s:WarrantyClaim>
<s:LaborActualHours>0.0</s:LaborActualHours>
<s:Technician/>
</s:Job>
</s:RepairOrder>
</s:DataArea>
</s:ProcessRepairOrder>
</content>
</payload>
</ProcessMessage>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_21_16612493.1298927643574
Content-Type: text/plain; charset=us-ascii; name=test.txt
Content-Transfer-Encoding: 7bit
Content-ID: <test.txt>
Content-Disposition: attachment; name="test.txt"; filename="test.txt"
This is a test for web services
------=_Part_21_16612493.1298927643574--
Also, I've attached the snippet of code being used by the web service to process the XML (I understand this is a SOAPUI forum, not a java forum. Just in case you're curious or want to suggest an alternative...)
InputStream is = request.getInputStream();
XMLInputFactory m_parserFactory = XMLInputFactory.newInstance();
OMFactory m_factory = new OMLinkedListImplFactory();
XMLStreamReader reader = m_parserFactory.createXMLStreamReader(is);
StAXOMBuilder builder = new StAXOMBuilder(m_factory, reader);
OMDocument doc = builder.getDocument();