If you enable MTOM for the service, it will always respond with an MTOM 
response.  

However, if you know none of the responses need MTOM, then I would not enable 
MTOM.  CXF will always (even if MTOM is not enabled) process requests that come 
in as MTOM.   The MTOM enabled stuff is just for whether it will generate MTOM 
messages or not.  Thus, by disabling it, you can get the requests fine, but not 
generate MTOM responses.

Dan



> On Nov 6, 2014, at 11:31 AM, ranvesha20 <[email protected]> wrote:
> 
> Hi - I am using CXF endpoint and enabled MTOM for that. It is working as
> expected for request (content-type  is application/xop+xml, which is
> expected) . But for the response also I am getting content-type as
> application/xop+xml .Is there a way to set content-type as
> application/soap+xml for the response? 
> 
> Below are the details.
> 
> CXF service in spring 
> 
> <cxf:cxfEndpoint id="webserviceEndpoint" address="/bulkupload"
> serviceClass="com.demo.DemoService">
> <cxf:inInterceptors>
> <ref bean="authenticationInterceptor"/>
> </cxf:inInterceptors>
> <cxf:properties>
> <entry key="mtom-enabled" value="true" />
> </cxf:properties>
> </cxf:cxfEndpoint>
> 
> And I defined interface like below 
> 
> @MTOM(enabled = true, threshold = 0)
> @BindingType(value = SOAPBinding.SOAP12HTTP_MTOM_BINDING)
> @WebService(name = "DemoService")
> public interface DemoService{
> 
>    /**
>     * This method exposes a web service end point to upload a zip file at a
> url
>     * http://<<hostname>>:8181/bulkupload
>     * 
>     * @param ClinicalDocumentRequest
>     *            Expects an Object of ClinicalDocumentRequest type
>     *            {@link ClinicalDocumentRequest }
>     * @return Returns an Object of ClinicalDocumentResponse type
>     *         {@link ClinicalDocumentResponse }
>     */
>    @WebMethod
>    @WebResult(name = "ClinicalDocumentResponse")
>    @RequestWrapper(localName = "BulkUploadRequest", className =
> "com.demo.DemoServiceRequest")
>    @ResponseWrapper(localName = "BulkUploadResponse", className =
> "com.demo.DemoServiceResponse")
>    ClinicalDocumentResponse uploadZipFile(
>            @WebParam(name = "ClinicalDocumentRequest")
> ClinicalDocumentRequest ClinicalDocumentRequest);
> }
> 
> Thanks,
> Ranvesha.
> 
> 
> 
> 
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/How-to-set-Content-type-for-the-response-in-CXF-Endpoint-tp5750792.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to