Hi Thilina,

thanks for your response. See my further comments inline below ...

Thilina Gunarathne wrote:
Hi,
msgContextL.getConfigurationContext().setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
This creates a correct MTOM message, however, finally the service
encounters an exception (something about Mime and writing) and is no
longer usable from then on.
What is the exception you are getting...
These are the messages I had received:

INFO: Server startup in 13625 ms
[ERROR] Servlet.service() for servlet AxisServlet threw exception
org.apache.axiom.om.OMException: Error while writing to the OutputStream.
at org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:102) at org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:154) at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:458) at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:68) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:294) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:211)
       at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:478)
at org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:403) at org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:366) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:154)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
       at java.lang.Thread.run(Thread.java:595)
Caused by: ClientAbortException:  java.io.IOException
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
       at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:83) at org.apache.axiom.om.impl.MIMEOutputUtils.writeMimeBoundary(MIMEOutputUtils.java:156) at org.apache.axiom.om.impl.MIMEOutputUtils.startWritingMime(MIMEOutputUtils.java:164) at org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:73)
       ... 23 more
Caused by: java.io.IOException
at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:700) at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:730) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:124) at org.apache.coyote.http11.InternalAprOutputBuffer.doWrite(InternalAprOutputBuffer.java:536)
       at org.apache.coyote.Response.doWrite(Response.java:560)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361)
       ... 32 more

I have updated the axiom jars to a recent snapshot because of the order of attachments issue (see AXIS2-3196 in which you were involved), otherwise it is Axis2-1.3.

Try the following...
    MessageContext inMessageContext = MessageContext.getCurrentMessageContext();
   OperationContext operationContext = inMessageContext.getOperationContext();
   MessageContext outMessageContext = operationContext

.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,
    Constants.VALUE_TRUE);
I did as you suggested but I still keep getting an exception (see stacktrace below). But in this case, the service can be used further. It is my impression that the data is started to be encoded correctly, but the binary blob is simply incomplete. I'm using a C# client based on WSE3, if that matters.

INFO: Server startup in 13157 ms
[ERROR]
org.apache.axis2.AxisFault
       at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:72) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:294) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:211)
       at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:478)
at org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:403) at org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:366) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:154)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
       at java.lang.Thread.run(Thread.java:595)
Caused by: com.ctc.wstx.exc.WstxIOException: null
       at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:139) at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:458) at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:68)
       ... 20 more
Caused by: ClientAbortException:  java.io.IOException
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
       at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
       at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:96)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
       at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
       ... 23 more
Caused by: java.io.IOException
at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:700) at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:730) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:124) at org.apache.coyote.http11.InternalAprOutputBuffer.doWrite(InternalAprOutputBuffer.java:536)
       at org.apache.coyote.Response.doWrite(Response.java:560)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361)
       ... 31 more


Thanks,
-Rainer

thanks,
Thilina
I also tried:

            MessageContext    msgContextL    =
MessageContext.getCurrentMessageContext();

msgContextL.getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
This does not work at all, I still get Base64 encoded text messages.

I would much appreciate if someone could tell me the correct way of
enforcing MTOM encoding programatically

Thanks,
-Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--

______________________________________________

*Dr. Rainer Menzner*
Principal Engineer, R&D

*L-1 Identity Solutions AG*
/Protecting and Securing Personal Identities and Assets/

Universitätsstr. 160
44801 Bochum, Germany
Telephone:      +49-234-9787-41
Facsimile:      +49-234-9787-77
Mobile:         0160 / 700 99 07
email:  [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


www.L1ID.com <http://www.l1id.com/>

This message is only for the use of the intended recipient and may contain information that is CONFIDENTIAL and PROPRIETARY to L-1 Identity Solutions. If you are not the intended recipient, please erase all copies of the message and its attachments and notify the sender immediately.

VORSTAND / EXECUTIVE BOARD Hartmuth von Maltzahn (Vors. / Chairman), Dr. Stefan Gehlen | AUFSICHTSRAT / SUPERVISORY BOARD James H. Moar (Vors. / Chairman) | GERICHTSSTAND / REGISTER COURT Amtsgericht Bochum, HRB 69 54 | UST-ID / VAT-REG.-NO. DE 813124378

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to