cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Talbut <jtal...@spudsoft.co.uk>
Subject Does optional MTOM really work?
Date Mon, 11 Jun 2012 04:52:29 GMT
Hi,

I'm trying to get optional MTOM working with CXF 2.6.0, but when I send 
in a plain XML request I always get an MTOM response.

I have a test that has two client endpoints (one MTOM enabled and one 
not) and two server endpoints (one MTOM enabled and one not).
The server MTOM endpoint has a policy specified in the Spring file:
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xmlns:wsp="http://www.w3.org/2006/07/ws-policy"
xmlns:mtom="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" 

        xmlns:p="http://cxf.apache.org/policy"
...
   <jaxws:endpoint id="targetRealMtom" implementor="#realImplementation" 
address="http://0.0.0.0:10010/TestMtom" bus="testTracking" >
     <jaxws:properties>
       <entry key="mtom-enabled" value="true"/>
     </jaxws:properties>
     <jaxws:features>
       <p:policies>
         <wsp:Policy>
           <mtom:OptimizedMimeSerialization wsp:Optional="true" />
         </wsp:Policy>
       </p:policies>
     </jaxws:features>
   </jaxws:endpoint>

All four endpoints use the same WSDL file, so the only one that knows 
anything about the policy is the server MTOM endpoint.

What I need to happen is:
Client no MTOM = Server no MTOM => XML Request, XML Response
Client MTOM = Server no MTOM => MTOM Request, XML Response
Client MTOM = Server MTOM => MTOM Request, MTOM Response
Client no MTOM = Server MTOM => XML Request, XML Response
But in the last case I am always getting an MTOM respnose.

Is there a way to make this work?
It's important that the client without MTOM do nothing clever at all (in 
production it'll have clients using the old Microsoft SOAP Toolkit from 
ASP (not .Net).

Thanks.

Jim

Mime
View raw message