Hi,
Thanks. That worked.
However, I still cannot get MTOM to work with jsr181 in this deployment.
I have enabled mtom on the jsr181 endpoint:
               <jsr181:endpoint
                 annotations="jsr181"
                 mtomEnabled="true"
                 service="test:DocumentManagementService"
                 endpoint="DocumentManagementService"
                 pojo="#documentManagementService">
              </jsr181:endpoint>

              <http:endpoint
                service="test:httpBinding"
                endpoint="DocumentManagementService"
                targetService="test:DocumentManagementService"
                role="consumer"
                locationURI="http://localhost/DocumentManagementService/";
                defaultMep="http://www.w3.org/2004/08/wsdl/in-out";
                soap="true">
              </http:endpoint>

I proxy this service and create a client using xfire and enable mtom on this
client.
I have 2 methods in this service:
1. DataSource GetDocument(String documentId)
The request that gets created is:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soap:Body><GetDocumentById
xmlns="http://webservices.sterling.com";><in0>abcd</in0></GetDocumentById></soap:Body></soap:Envelope>
------=_Part_0_12577309.1158352665757--

The response that comes back is:
<?xml version='1.0' encoding='UTF-8'?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><GetDocumentByIdResponse
xmlns="http://webservices.sterling.com";><out
xmlns:ns1="http://www.w3.org/2004/11/xmlmime"; ns1:mimeType="text"><Include
xmlns="http://www.w3.org/2004/08/xop/include";
href="cid:11583526659604-182379438@http://www.w3.org/2001/XMLSchema";
/></out></GetDocumentByIdResponse></soap:Body></soap:Envelope>

The client gives the error:
org.codehaus.xfire.fault.XFireFault: Could not find the attachment
cid:11583526659604-182379438@http://www.w3.org/2001/XMLSchema
        at
org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.readInclude(AbstractXOPType.java:62)

Looks like the attachment is missing from the response

2. PutDocument(byte[] document)
I send "Hello, World!" to it and the request that gets created is:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soap:Body><PutDocument
xmlns="http://webservices.sterling.com";><in0
xmlns:ns1="http://www.w3.org/2004/11/xmlmime";
ns1:mimeType="application/octet-stream"><Include
xmlns="http://www.w3.org/2004/08/xop/include";
href="cid:11583535659994444730680@http://www.w3.org/2001/XMLSchema";
/></in0></PutDocument></soap:Body></soap:Envelope>
------=_Part_0_2771331.1158353566015
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema>

Hello, World!
------=_Part_0_2771331.1158353566015--

The server gives this error:
java.lang.LinkageError: loader constraints violated when linking
javax/activation/DataHandler class
        at
org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:389)
        at
org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:71)
        at
org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:151)
        at
org.apache.servicemix.http.ManagedContextManager$MainProcessor.process(ManagedContextManager.java:116)
        at
org.apache.servicemix.http.HttpManagedServlet.service(HttpManagedServlet.java:85)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
        at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:595)

Please help.

-- 
View this message in context: 
http://www.nabble.com/jsr181-war-deployment-error-tf2274252.html#a6333211
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to