1
votes

Axis2 by default is send a multipart response even when there are no attachments

Why is axis2 sending a multipart response & how to ask it to send a "application/xml" or "application/soap+xml" how to get rid of multipart? In the axis2.xml I have

In the response I see HTTP/1.1 200 OK Date: Fri, 17 Feb 2017 01:07:08 GMT Transfer-Encoding: chunked Content-Type: multipart/related; boundary="MIMEBoundary_87162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b"; type="application/xop+xml"; start="<[email protected]>"; start-info="text/xml"

--MIMEBoundary_87162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: <[email protected]>

200<?xml version="1.0" encoding="UTF-8"?> <List_Wrapper> <_bp>

<_comments><_comment><content>Again a new comment this is a text type bp comment need to see this in the text json 1</content><published_date>2017-01-18T21:07:15</published_date><published_by>cyril furtado</published_by><company>Chevron Inc.</company></_comment></_comments></_bp> </List_Wrapper> --MIMEBoundary_87162747c87b279f7caa4e1ab573d5d864a878de7fae1a0b-

1

1 Answers

0
votes

I too faced similar issue for AXIS 2 quite recently , so thought to answer this.

AXIS 2 by default support attachment processing globally, which might not be needed for all types of services. To resolve this issue I disabled MTOM processing globally by modifying axis2.xml file -

<parameter name="enableMTOM">false</parameter>

This capability can now be enabled on need basis per service basis by enabling this property via respective services.xml file