You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thilina Gunarathne <cs...@gmail.com> on 2007/05/01 05:48:52 UTC
Re: Help with SwA
Messsage traces please..:)
On 5/1/07, Jorge Fernandez <in...@yahoo.es> wrote:
> Hi Thilina,
>
> You were right. The problem was in TCPMon. Without using TCPMon, I don't
> even have the problem sending big files. Thanks a lot.
>
> I have one more question now that this problem was fixed: Is there any
> sample of MOTM or SwA where the attachment is not a file?? I have to send
> large arrays, for example of short and sending them in xml increases the
> size of the message as it has to generate the tags for each element. So I
> would like to send them as attachments.
>
> Could anyone tell me how can I do it?
>
> I was given some advise and I'm trying to convert the array of short in a
> byte array doing this. I would appreciate some help on this:
>
> short[] data=new short[100];
> for (short i=0;i<data.length;i++)
> data[i]=i;
> byte[] byte_data = new byte[data.length * 2];
> for(int i=0; i < data.length; i++){
> byte_data[2*i] = (byte) ((data[i] >>> 8) & 0xFF);
> byte_data[2*i + 1] = (byte) ((data[i] >>> 0) & 0xFF);
> }
>
> // Populating the code generated beans
> GetAttachmentResponse response=new GetAttachmentResponse();
> DataHandler dataHandler = new
> DataHandler(byte_data,"application/octet-stream");
> BinaryData binaryData =new BinaryData();
> binaryData.setBase64Binary(dataHandler);
> binaryData.setContentType(dataHandler.getContentType());
> response.setBinaryData(binaryData);
>
> The problem is in the method toEnvelope setting the child for the body.
>
> I'm getting the following exception:
>
> java.lang.RuntimeException: org.apache.axiom.om.OMException: Referenced
> Attachment not found in the MIME Message.
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> at
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5296)
> at
> client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
> at client.ClientUtilities.mtomTest(ClientUtilities.java:476)
> at client.Client.main(Client.java:69)
> Caused by: org.apache.axiom.om.OMException: Referenced Attachment not found
> in the MIME Message.
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> at
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java:103)
> at
> medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
> at
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
> at
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
> ... 3 more
>
> And with TCPMon I can see the fault as an attachment.
>
> Thanks and regards,
>
> Jorge Fernández
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
The compatibility of Axis 1.4 and JAX-WS when sending attachments
Posted by WANG Chi <Ch...@gemalto.com>.
Hi all,
I use Axis 1.4 as the SOAP server and JAX-WS as the client, and I want to transfer attachments between them.
I use WS-ISwA.xsd in WSDL
<import namespace="http://ws-i.org/profiles/basic/1.1/xsd" schemaLocation="WS-ISwA.xsd"/>
...
<element name="targetFileName" type="wsi:swaRef" />
But when I use WSDL2Java to generate the stub, the wsi:swaRef is mapped to org.apache.axis.types.URI and when use
wsimport to generate the JAX-WS stub, the wsi:swaRef is mapped to DataHandler. So how to configure axis so it mappes
wsi:swaRef to DataHandler too? Or there is another way to transfer attachements between these two libs. Thanks a lot
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with SwA
Posted by Thilina Gunarathne <cs...@gmail.com>.
> Thanks. The following line you suggested solved my problem.
>outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
Great...
> I am curious about the meanings and effects of the following two lines:
> outMessageContext.setDoingSwA(true);
> outMessageContext.setServerSide(true);
These are used by our transport layers to track some properties..
Irrespective of there value, they get overridden at the transport
layers..
I badly wanted to remove those things, since they mislead the users.
Actually I tried to do that once and found too many implications,
which made me run out of time to finish it...
It would be great if you can log a JIRA about those two..
Thanks,
Thilina
>
>
> Regards,
> Xinjun
>
>
>
> On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > I use some proprietary information. From the request url my custom
> message
> > > receiver can decide which service should be invoked.
> > I mean how you specify that a request message needs to be directed to
> > your custom message receiver. May be you are using a custom deployer
> > to bypass the services.xml.
> >
> > Thinking about plain Axis2, you need to have a AxisService deployed by
> > some name and then it needs to contain information about the message
> > receiver. Then when a message arrives for that particular service,
> > Axis2 forwards that message to your message receiver... If you have a
> > AxisService object like that, then you can add the following key value
> > pair as a parameter to that AxisService object.
> > Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> >
> > Thanks,
> > Thilina
> >
> > >
> > > Regards,
> > > Xinjun
> > >
> > >
> > > On 5/26/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > try this...
> > > >
> > >
> outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
> > > >
> > > > > I don't have service.xml. I write a custom MessageReceiver to
> process
> > > the
> > > > > request and response MessageContext
> > > > Curious to know how you are specifying your custom message receiver to
> > > > the services...
> > > >
> > > > Thanks,
> > > > Thilina
> > > > > how you are mentiong
> > > > >. In this way, is the way you suggested
> > > > > still workable?
> > > > >
> > > > > Regards,
> > > > > Xinjun
> > > > >
> > > > >
> > > > > On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > > > > The following is the code snippet where I try to enable SwA only
> for
> > > one
> > > > > > > service.
> > > > > > >
> > > > > > > /** in axis2.xml, enableSwA is set to false **/
> > > > > > Please add the enableSwA parameter to your services.xml to enable
> SwA
> > > > > > only for that service. Also you can add it under a respective
> > > > > > operation element in the services.xml to enable SwA only for that
> > > > > > particular operation..
> > > > > >
> > > > > > > The out.setDoingSwA(true) seems not take effect.
> > > > > > Unfortunately this is not working and misleading.. This method was
> > > > > > used only in the transport layers.
> > > > > >
> > > > > > You may try doing the following..
> > > > > >
> > > > >
> > >
> out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> > > > > );
> > > > > >
> > > > > > thanks,
> > > > > > Thilina
> > > > > > >
> > > > > > >
> > > > > > > Could you suggest how to solve the problem? I am using Axis2
> 1.2.
> > > > > > >
> > > > > > >
> > > > > > > Regards,
> > > > > > > Xinjun
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 5/1/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > > > > > > >
> > > > > DataHandler(byte_data,"application/octet-stream");
> > > > > > > > You may use the ByteArrayDataSource for this purpose..
> > > Alternatively
> > > > > > > > you can try using "binary" instead of the
> > > > > > > > "application/octet-stream"...
> > > > > > > >
> > > > > > > > HTH,
> > > > > > > > Thilina
> > > > > > > > > > BinaryData binaryData =new BinaryData();
> > > > > > > > > > binaryData.setBase64Binary(dataHandler);
> > > > > > > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > > > > > > response.setBinaryData(binaryData);
> > > > > > > > > >
> > > > > > > > > > The problem is in the method toEnvelope setting the child
> for
> > > the
> > > > > > > body.
> > > > > > > > > >
> > > > > > > > > > I'm getting the following exception:
> > > > > > > > > >
> > > > > > > > > > java.lang.RuntimeException:
> org.apache.axiom.om.OMException:
> > > > > > > Referenced
> > > > > > > > > > Attachment not found in the MIME Message.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > ContentID:
> > > > >
> 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > > client.Medici_LinkSOAP12PortStub.fromOM
> > > > > > > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > > client.Medici_LinkSOAP12PortStub.getAttachment
> (Medici_LinkSOAP12PortStub.java:4103)
> > > > > > > > > > at client.ClientUtilities.mtomTest (ClientUtilities.java
> :476)
> > > > > > > > > > at client.Client.main(Client.java:69)
> > > > > > > > > > Caused by: org.apache.axiom.om.OMException: Referenced
> > > Attachment
> > > > > not
> > > > > > > > > found
> > > > > > > > > > in the MIME Message.
> > > > > > > > > >
> > > > > > > > > ContentID:
> > > > > > >
> > > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler
> (MTOMStAXSOAPModelBuilder.java
> > > :103)
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > > medici_link.xmime.xsd.BinaryData$Factory.parse(
> > > > > BinaryData.java:429)
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(
> GetAttachmentResponse.java:342)
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5024)
> > > > > > > > > > ... 3 more
> > > > > > > > > >
> > > > > > > > > > And with TCPMon I can see the fault as an attachment.
> > > > > > > > > >
> > > > > > > > > > Thanks and regards,
> > > > > > > > > >
> > > > > > > > > > Jorge Fernández
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > > > http://thilinag.blogspot.com
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > > > For additional commands, e-mail:
> axis-user-help@ws.apache.org
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ________________________________
> > > > > > > > >
> > > > > > > > > LLama Gratis a cualquier PC del Mundo.
> > > > > > > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > > > > > > http://es.voice.yahoo.com
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > HTTP/1.1 200 OK
> > > > > > > > > Server: Apache-Coyote/1.1
> > > > > > > > > Content-Type: multipart/related;
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > > > > > > type="application/xop+xml";
> > > > > > > > >
> > > > > > >
> > > > >
> > > start="<
> 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > > > > > > >";
> > > > > > > > > start-info="application/soap+xml";
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > > > > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > > > > > > application/xop+xml; charset=UTF-8;
> > > > > > > > >
> > > > >
> type="application/soap+xml"Content-Transfer-Encoding:
> > > > > > > > > binaryContent-ID:
> > > > > > > > > <
> > > > > > >
> > > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org >
> > > > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > > > <soapenv:Envelope
> > > > > > > > > xmlns:wsa="
> > > http://www.w3.org/2005/08/addressing"
> > > > > > > > >
> > > > > > >
> > > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope
> > > > > ">
> > > > > > > > > <soapenv:Header>
> > > > > > > > > <wsa:ReplyTo>
> > > > > > > > >
> > > > > > > > >
> > > > > > > <wsa:Address>
> > > > >
> http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > > > > > > <wsa:ReferenceParameters>
> > > > > > > > > <axis2:ServiceGroupId
> > > > > > > > >
> > > > > > > xmlns:axis2="
> > > > >
> > >
> http://ws.apache.org/namespaces/axis2">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > > > > > > </wsa:ReferenceParameters>
> > > > > > > > > </wsa:ReplyTo>
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > > > > > > >
> > > > > > > <wsa:Action>urn:getAttachment</wsa:Action>
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > > > </soapenv:Header>
> > > > > > > > > <soapenv:Body>
> > > > > > > > > <ns3:getAttachmentResponse
> > > > > > > > >
> xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > > > > > > <ns3:binaryData
> > > > > > > > > xmlns:s1="
> http://www.w3.org/2005/05/xmlmime"
> > > > > > > > > s1:contentType="application/octet-stream">
> > > > > > > > > <xop:Include
> > > > > > > > > href="cid:
> > > > > > >
> > > 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > > > > > > xmlns:xop="
> > > http://www.w3.org/2004/08/xop/include"
> > > > > />
> > > > > > > > > </ns3:binaryData>
> > > > > > > > > </ns3:getAttachmentResponse>
> > > > > > > > > </soapenv:Body>
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > > > > > > 10c1
> > > > > > > > >
> > > > >
> --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > > > > > > type="application/soap+xml"
> > > > > > > > > Content-Transfer-Encoding: binary
> > > > > > > > > Content-ID:
> > > > > > > > >
> > > > > > > > > <
> > > > > > >
> > > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > > > <soapenv:Envelope
> > > > > > > > > xmlns:wsa="
> > > http://www.w3.org/2005/08/addressing "
> > > > > > > > >
> > > > > > > xmlns:soapenv="
> > > > > http://www.w3.org/2003/05/soap-envelope">
> > > > > > > > > <soapenv:Header>
> > > > > > > > >
> > > > > > > > >
> > > > > > > <wsa:Action>
> > > > >
> > >
> http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > > > </soapenv:Header>
> > > > > > > > > <soapenv:Body>
> > > > > > > > > <soapenv:Fault>
> > > > > > > > > <soapenv:Code>
> > > > > > > > >
> > > > > > > > >
> <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > > > > > > </soapenv:Code>
> > > > > > > > > <soapenv:Reason>
> > > > > > > > > <soapenv:Text
> > > > > > > xml:lang="en-US">Error while
> > > > > > > > > writing to the OutputStream.</soapenv:Text>
> > > > > > > > > </soapenv:Reason>
> > > > > > > > > <soapenv:Detail>
> > > > > > > > >
> > > > > > > <Exception>org.apache.axis2.AxisFault: Error
> > > > > > > > > while writing to the OutputStream.
 at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:290)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> > > > > :116)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > > javax.servlet.http.HttpServlet.service
> > > (HttpServlet.java:709)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > javax.servlet.http.HttpServlet.service
> > > > > (HttpServlet.java:802)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > > > > (ApplicationFilterChain.java:252)
> > > > > > > > > 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.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:869)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > > > > > > (PoolTcpEndpoint.java:527)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > > > > > > (ThreadPool.java:684)
> > > > > > > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > > > > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > > > > > > OutputStream.
 at
> > > > > > > > >
> > > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > > > > > > (MIMEOutputUtils.java:72)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:123)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > > > > > (OMNodeImpl.java:419)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo
> > > (SOAPMessageFormatter.java:55)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > > > > > > ( CommonsHTTPTransportSender.java :275)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> > > > > ( CommonsHTTPTransportSender.java :203)
> > > > > > > > > at
> > > > > > > > > org.apache.axis2.engine.AxisEngine.send
> > > > > > > (AxisEngine.java:452)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > > > ( AbstractInOutSyncMessageReceiver.java:48)
> > > > > > > > > at
> > > > > > > > > org.apache.axis2.engine.AxisEngine.receive
> > > > > > > (AxisEngine.java:144)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java
> > > :279)
> > > > > > > > > ... 17 more
Caused by:
> > > > > > > > >
> javax.activation.UnsupportedDataTypeException :
> > > no
> > > > > > > object
> > > > > > > > > DCH for MIME type application/octet-stream
> > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > > javax.activation.ObjectDataContentHandler.writeTo
> (DataHandler.java:885)
> > > > > > > > > at
> > > > > > > > > javax.activation.DataHandler.writeTo
> > > > > > > (DataHandler.java:316)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart
> > > > > (MIMEOutputUtils.java:128)
> > > > > > > > > at
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:65)
> > > > > > > > > ... 26 more
> > > > > > > > > </Exception>
> > > > > > > > > </soapenv:Detail>
> > > > > > > > > </soapenv:Fault>
> > > > > > > > > </soapenv:Body>
> > > > > > > > > </soapenv:Envelope>
> > > > > > > > > 38
> > > > > > > > >
> > > > > > > > >
> > > > >
> --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > > > 2
> > > > > > > > > --
> > > > > > > > > 0
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > > > http://thilinag.blogspot.com
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail:
> > > > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > http://thilinag.blogspot.com
> > > > > >
> > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with SwA
Posted by Xinjun Chen <xj...@gmail.com>.
Hi Thilina,
Thanks. The following line you suggested solved my problem.
outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
I am curious about the meanings and effects of the following two lines:
outMessageContext.setDoingSwA(true);
outMessageContext.setServerSide(true);
Regards,
Xinjun
On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > I use some proprietary information. From the request url my custom
> message
> > receiver can decide which service should be invoked.
> I mean how you specify that a request message needs to be directed to
> your custom message receiver. May be you are using a custom deployer
> to bypass the services.xml.
>
> Thinking about plain Axis2, you need to have a AxisService deployed by
> some name and then it needs to contain information about the message
> receiver. Then when a message arrives for that particular service,
> Axis2 forwards that message to your message receiver... If you have a
> AxisService object like that, then you can add the following key value
> pair as a parameter to that AxisService object.
> Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
>
> Thanks,
> Thilina
>
> >
> > Regards,
> > Xinjun
> >
> >
> > On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > try this...
> > >
> > outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_TRUE);
> > >
> > > > I don't have service.xml. I write a custom MessageReceiver to
> process
> > the
> > > > request and response MessageContext
> > > Curious to know how you are specifying your custom message receiver to
> > > the services...
> > >
> > > Thanks,
> > > Thilina
> > > > how you are mentiong
> > > >. In this way, is the way you suggested
> > > > still workable?
> > > >
> > > > Regards,
> > > > Xinjun
> > > >
> > > >
> > > > On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > > > The following is the code snippet where I try to enable SwA only
> for
> > one
> > > > > > service.
> > > > > >
> > > > > > /** in axis2.xml, enableSwA is set to false **/
> > > > > Please add the enableSwA parameter to your services.xml to enable
> SwA
> > > > > only for that service. Also you can add it under a respective
> > > > > operation element in the services.xml to enable SwA only for that
> > > > > particular operation..
> > > > >
> > > > > > The out.setDoingSwA(true) seems not take effect.
> > > > > Unfortunately this is not working and misleading.. This method was
> > > > > used only in the transport layers.
> > > > >
> > > > > You may try doing the following..
> > > > >
> > > >
> > out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> > > > );
> > > > >
> > > > > thanks,
> > > > > Thilina
> > > > > >
> > > > > >
> > > > > > Could you suggest how to solve the problem? I am using Axis2 1.2
> .
> > > > > >
> > > > > >
> > > > > > Regards,
> > > > > > Xinjun
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 5/1/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > > > > > >
> > > > DataHandler(byte_data,"application/octet-stream");
> > > > > > > You may use the ByteArrayDataSource for this purpose..
> > Alternatively
> > > > > > > you can try using "binary" instead of the
> > > > > > > "application/octet-stream"...
> > > > > > >
> > > > > > > HTH,
> > > > > > > Thilina
> > > > > > > > > BinaryData binaryData =new BinaryData();
> > > > > > > > > binaryData.setBase64Binary(dataHandler);
> > > > > > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > > > > > response.setBinaryData(binaryData);
> > > > > > > > >
> > > > > > > > > The problem is in the method toEnvelope setting the child
> for
> > the
> > > > > > body.
> > > > > > > > >
> > > > > > > > > I'm getting the following exception:
> > > > > > > > >
> > > > > > > > > java.lang.RuntimeException:
> org.apache.axiom.om.OMException:
> > > > > > Referenced
> > > > > > > > > Attachment not found in the MIME Message.
> > > > > > > > >
> > > > > > > >
> > > > > > ContentID:
> > > > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > > at
> > > > > > > > >
> > > > > > > > client.Medici_LinkSOAP12PortStub.fromOM
> > > > > > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.getAttachment
> (Medici_LinkSOAP12PortStub.java:4103)
> > > > > > > > > at client.ClientUtilities.mtomTest (ClientUtilities.java:476)
> > > > > > > > > at client.Client.main(Client.java:69)
> > > > > > > > > Caused by: org.apache.axiom.om.OMException: Referenced
> > Attachment
> > > > not
> > > > > > > > found
> > > > > > > > > in the MIME Message.
> > > > > > > > >
> > > > > > > > ContentID:
> > > > > >
> > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler
> (MTOMStAXSOAPModelBuilder.java
> > :103)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > > medici_link.xmime.xsd.BinaryData$Factory.parse(
> > > > BinaryData.java:429)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(
> GetAttachmentResponse.java:342)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5024)
> > > > > > > > > ... 3 more
> > > > > > > > >
> > > > > > > > > And with TCPMon I can see the fault as an attachment.
> > > > > > > > >
> > > > > > > > > Thanks and regards,
> > > > > > > > >
> > > > > > > > > Jorge Fernández
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > > http://thilinag.blogspot.com
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail:
> > > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > > For additional commands, e-mail:
> axis-user-help@ws.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ________________________________
> > > > > > > >
> > > > > > > > LLama Gratis a cualquier PC del Mundo.
> > > > > > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > > > > > http://es.voice.yahoo.com
> > > > > > > >
> > > > > > > >
> > > > > > > > HTTP/1.1 200 OK
> > > > > > > > Server: Apache-Coyote/1.1
> > > > > > > > Content-Type: multipart/related;
> > > > > > > >
> > > > > >
> > > >
> > boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > > > > > type="application/xop+xml";
> > > > > > > >
> > > > > >
> > > >
> > start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > > > > > >";
> > > > > > > > start-info="application/soap+xml";
> > > > > > > >
> > > > > >
> > > >
> > action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > > > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > > > > > >
> > > > > >
> > > >
> >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > > > > > application/xop+xml; charset=UTF-8;
> > > > > > > >
> > > > type="application/soap+xml"Content-Transfer-Encoding:
> > > > > > > > binaryContent-ID:
> > > > > > > > <
> > > > > >
> > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org >
> > > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > > <soapenv:Envelope
> > > > > > > > xmlns:wsa="
> > http://www.w3.org/2005/08/addressing"
> > > > > > > >
> > > > > >
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope
> > > > ">
> > > > > > > > <soapenv:Header>
> > > > > > > > <wsa:ReplyTo>
> > > > > > > >
> > > > > > > >
> > > > > > <wsa:Address>
> > > > http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > > > > > <wsa:ReferenceParameters>
> > > > > > > > <axis2:ServiceGroupId
> > > > > > > >
> > > > > > xmlns:axis2="
> > > >
> > http://ws.apache.org/namespaces/axis2
> ">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > > > > > </wsa:ReferenceParameters>
> > > > > > > > </wsa:ReplyTo>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > > > > > >
> > > > > > <wsa:Action>urn:getAttachment</wsa:Action>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > > </soapenv:Header>
> > > > > > > > <soapenv:Body>
> > > > > > > > <ns3:getAttachmentResponse
> > > > > > > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > > > > > <ns3:binaryData
> > > > > > > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > > > > > > s1:contentType="application/octet-stream">
> > > > > > > > <xop:Include
> > > > > > > > href="cid:
> > > > > >
> > 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > > > > > xmlns:xop="
> > http://www.w3.org/2004/08/xop/include"
> > > > />
> > > > > > > > </ns3:binaryData>
> > > > > > > > </ns3:getAttachmentResponse>
> > > > > > > > </soapenv:Body>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > > > > > 10c1
> > > > > > > >
> > > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > > > > > type="application/soap+xml"
> > > > > > > > Content-Transfer-Encoding: binary
> > > > > > > > Content-ID:
> > > > > > > >
> > > > > > > > <
> > > > > >
> > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > > <soapenv:Envelope
> > > > > > > > xmlns:wsa="
> > http://www.w3.org/2005/08/addressing"
> > > > > > > >
> > > > > > xmlns:soapenv="
> > > > http://www.w3.org/2003/05/soap-envelope">
> > > > > > > > <soapenv:Header>
> > > > > > > >
> > > > > > > >
> > > > > > <wsa:Action>
> > > >
> > http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > > </soapenv:Header>
> > > > > > > > <soapenv:Body>
> > > > > > > > <soapenv:Fault>
> > > > > > > > <soapenv:Code>
> > > > > > > >
> > > > > > > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > > > > > </soapenv:Code>
> > > > > > > > <soapenv:Reason>
> > > > > > > > <soapenv:Text
> > > > > > xml:lang="en-US">Error while
> > > > > > > > writing to the OutputStream.</soapenv:Text>
> > > > > > > > </soapenv:Reason>
> > > > > > > > <soapenv:Detail>
> > > > > > > >
> > > > > > <Exception>org.apache.axis2.AxisFault: Error
> > > > > > > > while writing to the OutputStream.
 at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:290)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> > > > :116)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > > javax.servlet.http.HttpServlet.service
> > (HttpServlet.java:709)
> > > > > > > > at
> > > > > > > >
> > > > > > javax.servlet.http.HttpServlet.service
> > > > (HttpServlet.java:802)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > > > (ApplicationFilterChain.java:252)
> > > > > > > > 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.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
> :869)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > > > > > (PoolTcpEndpoint.java:527)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > > > > > (ThreadPool.java:684)
> > > > > > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > > > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > > > > > OutputStream.
 at
> > > > > > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > > > > > (MIMEOutputUtils.java:72)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(
> MTOMXMLStreamWriter.java:123)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > > > > (OMNodeImpl.java:419)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo
> > (SOAPMessageFormatter.java:55)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > > > > > ( CommonsHTTPTransportSender.java:275)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> > > > (CommonsHTTPTransportSender.java :203)
> > > > > > > > at
> > > > > > > > org.apache.axis2.engine.AxisEngine.send
> > > > > > (AxisEngine.java:452)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > > (AbstractInOutSyncMessageReceiver.java:48)
> > > > > > > > at
> > > > > > > > org.apache.axis2.engine.AxisEngine.receive
> > > > > > (AxisEngine.java:144)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java
> > :279)
> > > > > > > > ... 17 more
Caused by:
> > > > > > > > javax.activation.UnsupportedDataTypeException :
> > no
> > > > > > object
> > > > > > > > DCH for MIME type application/octet-stream
> > > > at
> > > > > > > >
> > > > > >
> > > >
> > javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java
> :885)
> > > > > > > > at
> > > > > > > > javax.activation.DataHandler.writeTo
> > > > > > (DataHandler.java:316)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart
> > > > (MIMEOutputUtils.java:128)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java
> :65)
> > > > > > > > ... 26 more
> > > > > > > > </Exception>
> > > > > > > > </soapenv:Detail>
> > > > > > > > </soapenv:Fault>
> > > > > > > > </soapenv:Body>
> > > > > > > > </soapenv:Envelope>
> > > > > > > > 38
> > > > > > > >
> > > > > > > >
> > > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > > 2
> > > > > > > > --
> > > > > > > > 0
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > > http://thilinag.blogspot.com
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thilina Gunarathne - http://www.wso2.com -
> > http://thilinag.blogspot.com
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Help with SwA
Posted by Xinjun Chen <xj...@gmail.com>.
Hi Thilina,
Thanks. The following line you suggested solved my problem.
outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
I am curious about the meanings and effects of the following two lines:
outMessageContext.setDoingSwA(true);
outMessageContext.setServerSide(true);
Regards,
Xinjun
On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > I use some proprietary information. From the request url my custom
> message
> > receiver can decide which service should be invoked.
> I mean how you specify that a request message needs to be directed to
> your custom message receiver. May be you are using a custom deployer
> to bypass the services.xml.
>
> Thinking about plain Axis2, you need to have a AxisService deployed by
> some name and then it needs to contain information about the message
> receiver. Then when a message arrives for that particular service,
> Axis2 forwards that message to your message receiver... If you have a
> AxisService object like that, then you can add the following key value
> pair as a parameter to that AxisService object.
> Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
>
> Thanks,
> Thilina
>
> >
> > Regards,
> > Xinjun
> >
> >
> > On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > try this...
> > >
> > outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_TRUE);
> > >
> > > > I don't have service.xml. I write a custom MessageReceiver to
> process
> > the
> > > > request and response MessageContext
> > > Curious to know how you are specifying your custom message receiver to
> > > the services...
> > >
> > > Thanks,
> > > Thilina
> > > > how you are mentiong
> > > >. In this way, is the way you suggested
> > > > still workable?
> > > >
> > > > Regards,
> > > > Xinjun
> > > >
> > > >
> > > > On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > > > The following is the code snippet where I try to enable SwA only
> for
> > one
> > > > > > service.
> > > > > >
> > > > > > /** in axis2.xml, enableSwA is set to false **/
> > > > > Please add the enableSwA parameter to your services.xml to enable
> SwA
> > > > > only for that service. Also you can add it under a respective
> > > > > operation element in the services.xml to enable SwA only for that
> > > > > particular operation..
> > > > >
> > > > > > The out.setDoingSwA(true) seems not take effect.
> > > > > Unfortunately this is not working and misleading.. This method was
> > > > > used only in the transport layers.
> > > > >
> > > > > You may try doing the following..
> > > > >
> > > >
> > out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> > > > );
> > > > >
> > > > > thanks,
> > > > > Thilina
> > > > > >
> > > > > >
> > > > > > Could you suggest how to solve the problem? I am using Axis2 1.2
> .
> > > > > >
> > > > > >
> > > > > > Regards,
> > > > > > Xinjun
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 5/1/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > > > > > >
> > > > DataHandler(byte_data,"application/octet-stream");
> > > > > > > You may use the ByteArrayDataSource for this purpose..
> > Alternatively
> > > > > > > you can try using "binary" instead of the
> > > > > > > "application/octet-stream"...
> > > > > > >
> > > > > > > HTH,
> > > > > > > Thilina
> > > > > > > > > BinaryData binaryData =new BinaryData();
> > > > > > > > > binaryData.setBase64Binary(dataHandler);
> > > > > > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > > > > > response.setBinaryData(binaryData);
> > > > > > > > >
> > > > > > > > > The problem is in the method toEnvelope setting the child
> for
> > the
> > > > > > body.
> > > > > > > > >
> > > > > > > > > I'm getting the following exception:
> > > > > > > > >
> > > > > > > > > java.lang.RuntimeException:
> org.apache.axiom.om.OMException:
> > > > > > Referenced
> > > > > > > > > Attachment not found in the MIME Message.
> > > > > > > > >
> > > > > > > >
> > > > > > ContentID:
> > > > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > > at
> > > > > > > > >
> > > > > > > > client.Medici_LinkSOAP12PortStub.fromOM
> > > > > > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.getAttachment
> (Medici_LinkSOAP12PortStub.java:4103)
> > > > > > > > > at client.ClientUtilities.mtomTest (ClientUtilities.java:476)
> > > > > > > > > at client.Client.main(Client.java:69)
> > > > > > > > > Caused by: org.apache.axiom.om.OMException: Referenced
> > Attachment
> > > > not
> > > > > > > > found
> > > > > > > > > in the MIME Message.
> > > > > > > > >
> > > > > > > > ContentID:
> > > > > >
> > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler
> (MTOMStAXSOAPModelBuilder.java
> > :103)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > > medici_link.xmime.xsd.BinaryData$Factory.parse(
> > > > BinaryData.java:429)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(
> GetAttachmentResponse.java:342)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5024)
> > > > > > > > > ... 3 more
> > > > > > > > >
> > > > > > > > > And with TCPMon I can see the fault as an attachment.
> > > > > > > > >
> > > > > > > > > Thanks and regards,
> > > > > > > > >
> > > > > > > > > Jorge Fernández
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > > http://thilinag.blogspot.com
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail:
> > > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > > For additional commands, e-mail:
> axis-user-help@ws.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ________________________________
> > > > > > > >
> > > > > > > > LLama Gratis a cualquier PC del Mundo.
> > > > > > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > > > > > http://es.voice.yahoo.com
> > > > > > > >
> > > > > > > >
> > > > > > > > HTTP/1.1 200 OK
> > > > > > > > Server: Apache-Coyote/1.1
> > > > > > > > Content-Type: multipart/related;
> > > > > > > >
> > > > > >
> > > >
> > boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > > > > > type="application/xop+xml";
> > > > > > > >
> > > > > >
> > > >
> > start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > > > > > >";
> > > > > > > > start-info="application/soap+xml";
> > > > > > > >
> > > > > >
> > > >
> > action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > > > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > > > > > >
> > > > > >
> > > >
> >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > > > > > application/xop+xml; charset=UTF-8;
> > > > > > > >
> > > > type="application/soap+xml"Content-Transfer-Encoding:
> > > > > > > > binaryContent-ID:
> > > > > > > > <
> > > > > >
> > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org >
> > > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > > <soapenv:Envelope
> > > > > > > > xmlns:wsa="
> > http://www.w3.org/2005/08/addressing"
> > > > > > > >
> > > > > >
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope
> > > > ">
> > > > > > > > <soapenv:Header>
> > > > > > > > <wsa:ReplyTo>
> > > > > > > >
> > > > > > > >
> > > > > > <wsa:Address>
> > > > http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > > > > > <wsa:ReferenceParameters>
> > > > > > > > <axis2:ServiceGroupId
> > > > > > > >
> > > > > > xmlns:axis2="
> > > >
> > http://ws.apache.org/namespaces/axis2
> ">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > > > > > </wsa:ReferenceParameters>
> > > > > > > > </wsa:ReplyTo>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > > > > > >
> > > > > > <wsa:Action>urn:getAttachment</wsa:Action>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > > </soapenv:Header>
> > > > > > > > <soapenv:Body>
> > > > > > > > <ns3:getAttachmentResponse
> > > > > > > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > > > > > <ns3:binaryData
> > > > > > > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > > > > > > s1:contentType="application/octet-stream">
> > > > > > > > <xop:Include
> > > > > > > > href="cid:
> > > > > >
> > 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > > > > > xmlns:xop="
> > http://www.w3.org/2004/08/xop/include"
> > > > />
> > > > > > > > </ns3:binaryData>
> > > > > > > > </ns3:getAttachmentResponse>
> > > > > > > > </soapenv:Body>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > > > > > 10c1
> > > > > > > >
> > > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > > > > > type="application/soap+xml"
> > > > > > > > Content-Transfer-Encoding: binary
> > > > > > > > Content-ID:
> > > > > > > >
> > > > > > > > <
> > > > > >
> > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > > <soapenv:Envelope
> > > > > > > > xmlns:wsa="
> > http://www.w3.org/2005/08/addressing"
> > > > > > > >
> > > > > > xmlns:soapenv="
> > > > http://www.w3.org/2003/05/soap-envelope">
> > > > > > > > <soapenv:Header>
> > > > > > > >
> > > > > > > >
> > > > > > <wsa:Action>
> > > >
> > http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > > </soapenv:Header>
> > > > > > > > <soapenv:Body>
> > > > > > > > <soapenv:Fault>
> > > > > > > > <soapenv:Code>
> > > > > > > >
> > > > > > > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > > > > > </soapenv:Code>
> > > > > > > > <soapenv:Reason>
> > > > > > > > <soapenv:Text
> > > > > > xml:lang="en-US">Error while
> > > > > > > > writing to the OutputStream.</soapenv:Text>
> > > > > > > > </soapenv:Reason>
> > > > > > > > <soapenv:Detail>
> > > > > > > >
> > > > > > <Exception>org.apache.axis2.AxisFault: Error
> > > > > > > > while writing to the OutputStream.
 at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:290)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> > > > :116)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > > javax.servlet.http.HttpServlet.service
> > (HttpServlet.java:709)
> > > > > > > > at
> > > > > > > >
> > > > > > javax.servlet.http.HttpServlet.service
> > > > (HttpServlet.java:802)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > > > (ApplicationFilterChain.java:252)
> > > > > > > > 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.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
> :869)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > > > > > (PoolTcpEndpoint.java:527)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > > > > > (ThreadPool.java:684)
> > > > > > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > > > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > > > > > OutputStream.
 at
> > > > > > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > > > > > (MIMEOutputUtils.java:72)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(
> MTOMXMLStreamWriter.java:123)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > > > > (OMNodeImpl.java:419)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo
> > (SOAPMessageFormatter.java:55)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > > > > > ( CommonsHTTPTransportSender.java:275)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> > > > (CommonsHTTPTransportSender.java :203)
> > > > > > > > at
> > > > > > > > org.apache.axis2.engine.AxisEngine.send
> > > > > > (AxisEngine.java:452)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > > (AbstractInOutSyncMessageReceiver.java:48)
> > > > > > > > at
> > > > > > > > org.apache.axis2.engine.AxisEngine.receive
> > > > > > (AxisEngine.java:144)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java
> > :279)
> > > > > > > > ... 17 more
Caused by:
> > > > > > > > javax.activation.UnsupportedDataTypeException :
> > no
> > > > > > object
> > > > > > > > DCH for MIME type application/octet-stream
> > > > at
> > > > > > > >
> > > > > >
> > > >
> > javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java
> :885)
> > > > > > > > at
> > > > > > > > javax.activation.DataHandler.writeTo
> > > > > > (DataHandler.java:316)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart
> > > > (MIMEOutputUtils.java:128)
> > > > > > > > at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java
> :65)
> > > > > > > > ... 26 more
> > > > > > > > </Exception>
> > > > > > > > </soapenv:Detail>
> > > > > > > > </soapenv:Fault>
> > > > > > > > </soapenv:Body>
> > > > > > > > </soapenv:Envelope>
> > > > > > > > 38
> > > > > > > >
> > > > > > > >
> > > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > > 2
> > > > > > > > --
> > > > > > > > 0
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > > http://thilinag.blogspot.com
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thilina Gunarathne - http://www.wso2.com -
> > http://thilinag.blogspot.com
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Help with SwA
Posted by Thilina Gunarathne <cs...@gmail.com>.
> I use some proprietary information. From the request url my custom message
> receiver can decide which service should be invoked.
I mean how you specify that a request message needs to be directed to
your custom message receiver. May be you are using a custom deployer
to bypass the services.xml.
Thinking about plain Axis2, you need to have a AxisService deployed by
some name and then it needs to contain information about the message
receiver. Then when a message arrives for that particular service,
Axis2 forwards that message to your message receiver... If you have a
AxisService object like that, then you can add the following key value
pair as a parameter to that AxisService object.
Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
Thanks,
Thilina
>
> Regards,
> Xinjun
>
>
> On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > try this...
> >
> outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
> >
> > > I don't have service.xml. I write a custom MessageReceiver to process
> the
> > > request and response MessageContext
> > Curious to know how you are specifying your custom message receiver to
> > the services...
> >
> > Thanks,
> > Thilina
> > > how you are mentiong
> > >. In this way, is the way you suggested
> > > still workable?
> > >
> > > Regards,
> > > Xinjun
> > >
> > >
> > > On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > > The following is the code snippet where I try to enable SwA only for
> one
> > > > > service.
> > > > >
> > > > > /** in axis2.xml, enableSwA is set to false **/
> > > > Please add the enableSwA parameter to your services.xml to enable SwA
> > > > only for that service. Also you can add it under a respective
> > > > operation element in the services.xml to enable SwA only for that
> > > > particular operation..
> > > >
> > > > > The out.setDoingSwA(true) seems not take effect.
> > > > Unfortunately this is not working and misleading.. This method was
> > > > used only in the transport layers.
> > > >
> > > > You may try doing the following..
> > > >
> > >
> out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> > > );
> > > >
> > > > thanks,
> > > > Thilina
> > > > >
> > > > >
> > > > > Could you suggest how to solve the problem? I am using Axis2 1.2.
> > > > >
> > > > >
> > > > > Regards,
> > > > > Xinjun
> > > > >
> > > > >
> > > > >
> > > > > On 5/1/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > > > > >
> > > DataHandler(byte_data,"application/octet-stream");
> > > > > > You may use the ByteArrayDataSource for this purpose..
> Alternatively
> > > > > > you can try using "binary" instead of the
> > > > > > "application/octet-stream"...
> > > > > >
> > > > > > HTH,
> > > > > > Thilina
> > > > > > > > BinaryData binaryData =new BinaryData();
> > > > > > > > binaryData.setBase64Binary(dataHandler);
> > > > > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > > > > response.setBinaryData(binaryData);
> > > > > > > >
> > > > > > > > The problem is in the method toEnvelope setting the child for
> the
> > > > > body.
> > > > > > > >
> > > > > > > > I'm getting the following exception:
> > > > > > > >
> > > > > > > > java.lang.RuntimeException: org.apache.axiom.om.OMException:
> > > > > Referenced
> > > > > > > > Attachment not found in the MIME Message.
> > > > > > > >
> > > > > > >
> > > > > ContentID:
> > > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > at
> > > > > > > >
> > > > > > > client.Medici_LinkSOAP12PortStub.fromOM
> > > > > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > > > > at
> > > > > > > >
> > > > > > >
> > > > >
> > >
> client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
> > > > > > > > at client.ClientUtilities.mtomTest (ClientUtilities.java :476)
> > > > > > > > at client.Client.main(Client.java:69)
> > > > > > > > Caused by: org.apache.axiom.om.OMException: Referenced
> Attachment
> > > not
> > > > > > > found
> > > > > > > > in the MIME Message.
> > > > > > > >
> > > > > > > ContentID:
> > > > >
> 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > > at
> > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java
> :103)
> > > > > > > > at
> > > > > > > >
> > > > > > >
> > > > > medici_link.xmime.xsd.BinaryData$Factory.parse(
> > > BinaryData.java:429)
> > > > > > > > at
> > > > > > > >
> > > > > > >
> > > > >
> > >
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
> > > > > > > > at
> > > > > > > >
> > > > > > >
> > > > >
> > >
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
> > > > > > > > ... 3 more
> > > > > > > >
> > > > > > > > And with TCPMon I can see the fault as an attachment.
> > > > > > > >
> > > > > > > > Thanks and regards,
> > > > > > > >
> > > > > > > > Jorge Fernández
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > http://thilinag.blogspot.com
> > > > > > >
> > > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ________________________________
> > > > > > >
> > > > > > > LLama Gratis a cualquier PC del Mundo.
> > > > > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > > > > http://es.voice.yahoo.com
> > > > > > >
> > > > > > >
> > > > > > > HTTP/1.1 200 OK
> > > > > > > Server: Apache-Coyote/1.1
> > > > > > > Content-Type: multipart/related;
> > > > > > >
> > > > >
> > >
> boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > > > > type="application/xop+xml";
> > > > > > >
> > > > >
> > >
> start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > > > > >";
> > > > > > > start-info="application/soap+xml";
> > > > > > >
> > > > >
> > >
> action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > > > > >
> > > > >
> > >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > > > > application/xop+xml; charset=UTF-8;
> > > > > > >
> > > type="application/soap+xml"Content-Transfer-Encoding:
> > > > > > > binaryContent-ID:
> > > > > > > <
> > > > >
> 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org >
> > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > <soapenv:Envelope
> > > > > > > xmlns:wsa="
> http://www.w3.org/2005/08/addressing"
> > > > > > >
> > > > >
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope
> > > ">
> > > > > > > <soapenv:Header>
> > > > > > > <wsa:ReplyTo>
> > > > > > >
> > > > > > >
> > > > > <wsa:Address>
> > > http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > > > > <wsa:ReferenceParameters>
> > > > > > > <axis2:ServiceGroupId
> > > > > > >
> > > > > xmlns:axis2="
> > >
> http://ws.apache.org/namespaces/axis2">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > > > > </wsa:ReferenceParameters>
> > > > > > > </wsa:ReplyTo>
> > > > > > >
> > > > > > >
> > > > >
> > >
> <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > > > > >
> > > > > <wsa:Action>urn:getAttachment</wsa:Action>
> > > > > > >
> > > > > > >
> > > > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > </soapenv:Header>
> > > > > > > <soapenv:Body>
> > > > > > > <ns3:getAttachmentResponse
> > > > > > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > > > > <ns3:binaryData
> > > > > > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > > > > > s1:contentType="application/octet-stream">
> > > > > > > <xop:Include
> > > > > > > href="cid:
> > > > >
> 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > > > > xmlns:xop="
> http://www.w3.org/2004/08/xop/include"
> > > />
> > > > > > > </ns3:binaryData>
> > > > > > > </ns3:getAttachmentResponse>
> > > > > > > </soapenv:Body>
> > > > > > >
> > > > > > >
> > > > >
> > >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > > > > 10c1
> > > > > > >
> > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > > > > type="application/soap+xml"
> > > > > > > Content-Transfer-Encoding: binary
> > > > > > > Content-ID:
> > > > > > >
> > > > > > > <
> > > > >
> 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > > <soapenv:Envelope
> > > > > > > xmlns:wsa="
> http://www.w3.org/2005/08/addressing"
> > > > > > >
> > > > > xmlns:soapenv="
> > > http://www.w3.org/2003/05/soap-envelope">
> > > > > > > <soapenv:Header>
> > > > > > >
> > > > > > >
> > > > > <wsa:Action>
> > >
> http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > > > > >
> > > > > > >
> > > > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > > </soapenv:Header>
> > > > > > > <soapenv:Body>
> > > > > > > <soapenv:Fault>
> > > > > > > <soapenv:Code>
> > > > > > >
> > > > > > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > > > > </soapenv:Code>
> > > > > > > <soapenv:Reason>
> > > > > > > <soapenv:Text
> > > > > xml:lang="en-US">Error while
> > > > > > > writing to the OutputStream.</soapenv:Text>
> > > > > > > </soapenv:Reason>
> > > > > > > <soapenv:Detail>
> > > > > > >
> > > > > <Exception>org.apache.axis2.AxisFault: Error
> > > > > > > while writing to the OutputStream.
 at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:290)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> > > :116)
> > > > > > > at
> > > > > > >
> > > > >
> > > javax.servlet.http.HttpServlet.service
> (HttpServlet.java:709)
> > > > > > > at
> > > > > > >
> > > > > javax.servlet.http.HttpServlet.service
> > > (HttpServlet.java:802)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > > (ApplicationFilterChain.java:252)
> > > > > > > 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.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:869)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > > > > (PoolTcpEndpoint.java:527)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > > > > (ThreadPool.java:684)
> > > > > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > > > > OutputStream.
 at
> > > > > > >
> org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > > > > (MIMEOutputUtils.java:72)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:123)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > > > (OMNodeImpl.java:419)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo
> (SOAPMessageFormatter.java:55)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > > > > ( CommonsHTTPTransportSender.java:275)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> > > (CommonsHTTPTransportSender.java :203)
> > > > > > > at
> > > > > > > org.apache.axis2.engine.AxisEngine.send
> > > > > (AxisEngine.java:452)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > (AbstractInOutSyncMessageReceiver.java:48)
> > > > > > > at
> > > > > > > org.apache.axis2.engine.AxisEngine.receive
> > > > > (AxisEngine.java:144)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java
> :279)
> > > > > > > ... 17 more
Caused by:
> > > > > > > javax.activation.UnsupportedDataTypeException :
> no
> > > > > object
> > > > > > > DCH for MIME type application/octet-stream
> > > at
> > > > > > >
> > > > >
> > >
> javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:885)
> > > > > > > at
> > > > > > > javax.activation.DataHandler.writeTo
> > > > > (DataHandler.java:316)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > > > > at
> > > > > > >
> > > > >
> org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart
> > > (MIMEOutputUtils.java:128)
> > > > > > > at
> > > > > > >
> > > > >
> > >
> org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:65)
> > > > > > > ... 26 more
> > > > > > > </Exception>
> > > > > > > </soapenv:Detail>
> > > > > > > </soapenv:Fault>
> > > > > > > </soapenv:Body>
> > > > > > > </soapenv:Envelope>
> > > > > > > 38
> > > > > > >
> > > > > > >
> > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > > 2
> > > > > > > --
> > > > > > > 0
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Thilina Gunarathne - http://www.wso2.com -
> > > http://thilinag.blogspot.com
> > > > > >
> > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > > axis-user-unsubscribe@ws.apache.org
> > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with SwA
Posted by Xinjun Chen <xj...@gmail.com>.
I use some proprietary information. From the request url my custom message
receiver can decide which service should be invoked.
Regards,
Xinjun
On 5/26/07, Thilina Gunarathne <cs...@gmail.com> wrote:
>
> try this...
> outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_TRUE);
>
> > I don't have service.xml. I write a custom MessageReceiver to process
> the
> > request and response MessageContext
> Curious to know how you are specifying your custom message receiver to
> the services...
>
> Thanks,
> Thilina
> > how you are mentiong
> >. In this way, is the way you suggested
> > still workable?
> >
> > Regards,
> > Xinjun
> >
> >
> > On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > The following is the code snippet where I try to enable SwA only for
> one
> > > > service.
> > > >
> > > > /** in axis2.xml, enableSwA is set to false **/
> > > Please add the enableSwA parameter to your services.xml to enable SwA
> > > only for that service. Also you can add it under a respective
> > > operation element in the services.xml to enable SwA only for that
> > > particular operation..
> > >
> > > > The out.setDoingSwA(true) seems not take effect.
> > > Unfortunately this is not working and misleading.. This method was
> > > used only in the transport layers.
> > >
> > > You may try doing the following..
> > >
> > out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> > );
> > >
> > > thanks,
> > > Thilina
> > > >
> > > >
> > > > Could you suggest how to solve the problem? I am using Axis2 1.2.
> > > >
> > > >
> > > > Regards,
> > > > Xinjun
> > > >
> > > >
> > > >
> > > > On 5/1/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > > > >
> > DataHandler(byte_data,"application/octet-stream");
> > > > > You may use the ByteArrayDataSource for this purpose..
> Alternatively
> > > > > you can try using "binary" instead of the
> > > > > "application/octet-stream"...
> > > > >
> > > > > HTH,
> > > > > Thilina
> > > > > > > BinaryData binaryData =new BinaryData();
> > > > > > > binaryData.setBase64Binary(dataHandler);
> > > > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > > > response.setBinaryData(binaryData);
> > > > > > >
> > > > > > > The problem is in the method toEnvelope setting the child for
> the
> > > > body.
> > > > > > >
> > > > > > > I'm getting the following exception:
> > > > > > >
> > > > > > > java.lang.RuntimeException: org.apache.axiom.om.OMException:
> > > > Referenced
> > > > > > > Attachment not found in the MIME Message.
> > > > > > >
> > > > > >
> > > > ContentID:
> > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > at
> > > > > > >
> > > > > > client.Medici_LinkSOAP12PortStub.fromOM
> > > > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > > > at
> > > > > > >
> > > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.getAttachment
> (Medici_LinkSOAP12PortStub.java:4103)
> > > > > > > at client.ClientUtilities.mtomTest(ClientUtilities.java :476)
> > > > > > > at client.Client.main(Client.java:69)
> > > > > > > Caused by: org.apache.axiom.om.OMException: Referenced
> Attachment
> > not
> > > > > > found
> > > > > > > in the MIME Message.
> > > > > > >
> > > > > > ContentID:
> > > > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > > at
> > > > > > >
> > > > > >
> > > >
> >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler
> (MTOMStAXSOAPModelBuilder.java:103)
> > > > > > > at
> > > > > > >
> > > > > >
> > > > medici_link.xmime.xsd.BinaryData$Factory.parse(
> > BinaryData.java:429)
> > > > > > > at
> > > > > > >
> > > > > >
> > > >
> > medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(
> GetAttachmentResponse.java:342)
> > > > > > > at
> > > > > > >
> > > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5024)
> > > > > > > ... 3 more
> > > > > > >
> > > > > > > And with TCPMon I can see the fault as an attachment.
> > > > > > >
> > > > > > > Thanks and regards,
> > > > > > >
> > > > > > > Jorge Fernández
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Thilina Gunarathne - http://www.wso2.com -
> > http://thilinag.blogspot.com
> > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > axis-user-unsubscribe@ws.apache.org
> > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > >
> > > > > > LLama Gratis a cualquier PC del Mundo.
> > > > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > > > http://es.voice.yahoo.com
> > > > > >
> > > > > >
> > > > > > HTTP/1.1 200 OK
> > > > > > Server: Apache-Coyote/1.1
> > > > > > Content-Type: multipart/related;
> > > > > >
> > > >
> > boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > > > type="application/xop+xml";
> > > > > >
> > > >
> > start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > > > >";
> > > > > > start-info="application/soap+xml";
> > > > > >
> > > >
> > action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > > > >
> > > >
> >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > > > application/xop+xml; charset=UTF-8;
> > > > > >
> > type="application/soap+xml"Content-Transfer-Encoding:
> > > > > > binaryContent-ID:
> > > > > > <
> > > > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org>
> > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > <soapenv:Envelope
> > > > > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > > > > >
> > > > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope
> > ">
> > > > > > <soapenv:Header>
> > > > > > <wsa:ReplyTo>
> > > > > >
> > > > > >
> > > > <wsa:Address>
> > http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > > > <wsa:ReferenceParameters>
> > > > > > <axis2:ServiceGroupId
> > > > > >
> > > > xmlns:axis2="
> > http://ws.apache.org/namespaces/axis2
> ">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > > > </wsa:ReferenceParameters>
> > > > > > </wsa:ReplyTo>
> > > > > >
> > > > > >
> > > >
> > <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > > > >
> > > > <wsa:Action>urn:getAttachment</wsa:Action>
> > > > > >
> > > > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > </soapenv:Header>
> > > > > > <soapenv:Body>
> > > > > > <ns3:getAttachmentResponse
> > > > > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > > > <ns3:binaryData
> > > > > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > > > > s1:contentType="application/octet-stream">
> > > > > > <xop:Include
> > > > > > href="cid:
> > > > 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > > > xmlns:xop=" http://www.w3.org/2004/08/xop/include"
> > />
> > > > > > </ns3:binaryData>
> > > > > > </ns3:getAttachmentResponse>
> > > > > > </soapenv:Body>
> > > > > >
> > > > > >
> > > >
> >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > > > 10c1
> > > > > >
> > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > > > type="application/soap+xml"
> > > > > > Content-Transfer-Encoding: binary
> > > > > > Content-ID:
> > > > > >
> > > > > > <
> > > > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > > <soapenv:Envelope
> > > > > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > > > > >
> > > > xmlns:soapenv="
> > http://www.w3.org/2003/05/soap-envelope">
> > > > > > <soapenv:Header>
> > > > > >
> > > > > >
> > > > <wsa:Action>
> > http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > > > >
> > > > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > > </soapenv:Header>
> > > > > > <soapenv:Body>
> > > > > > <soapenv:Fault>
> > > > > > <soapenv:Code>
> > > > > >
> > > > > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > > > </soapenv:Code>
> > > > > > <soapenv:Reason>
> > > > > > <soapenv:Text
> > > > xml:lang="en-US">Error while
> > > > > > writing to the OutputStream.</soapenv:Text>
> > > > > > </soapenv:Reason>
> > > > > > <soapenv:Detail>
> > > > > >
> > > > <Exception>org.apache.axis2.AxisFault: Error
> > > > > > while writing to the OutputStream.
 at
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:290)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> > :116)
> > > > > > at
> > > > > >
> > > >
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > > > > > at
> > > > > >
> > > > javax.servlet.http.HttpServlet.service
> > (HttpServlet.java:802)
> > > > > > at
> > > > > >
> > > >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > (ApplicationFilterChain.java:252)
> > > > > > 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.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
> :869)
> > > > > > at
> > > > > >
> > > >
> >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> > > > > > at
> > > > > >
> > > >
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > > > (PoolTcpEndpoint.java:527)
> > > > > > at
> > > > > >
> > > >
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> > > > > > at
> > > > > >
> > > >
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > > > (ThreadPool.java:684)
> > > > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > > > OutputStream.
 at
> > > > > > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > > > (MIMEOutputUtils.java:72)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(
> MTOMXMLStreamWriter.java:123)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > > (OMNodeImpl.java:419)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(
> SOAPMessageFormatter.java:55)
> > > > > > at
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > > > (CommonsHTTPTransportSender.java:275)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> > (CommonsHTTPTransportSender.java:203)
> > > > > > at
> > > > > > org.apache.axis2.engine.AxisEngine.send
> > > > (AxisEngine.java:452)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > (AbstractInOutSyncMessageReceiver.java:48)
> > > > > > at
> > > > > > org.apache.axis2.engine.AxisEngine.receive
> > > > (AxisEngine.java:144)
> > > > > > at
> > > > > >
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:279)
> > > > > > ... 17 more
Caused by:
> > > > > > javax.activation.UnsupportedDataTypeException : no
> > > > object
> > > > > > DCH for MIME type application/octet-stream
> > at
> > > > > >
> > > >
> > javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java
> :885)
> > > > > > at
> > > > > > javax.activation.DataHandler.writeTo
> > > > (DataHandler.java:316)
> > > > > > at
> > > > > >
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > > > at
> > > > > >
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > > > at
> > > > > >
> > > > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart
> > (MIMEOutputUtils.java:128)
> > > > > > at
> > > > > >
> > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java
> :65)
> > > > > > ... 26 more
> > > > > > </Exception>
> > > > > > </soapenv:Detail>
> > > > > > </soapenv:Fault>
> > > > > > </soapenv:Body>
> > > > > > </soapenv:Envelope>
> > > > > > 38
> > > > > >
> > > > > >
> > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > > 2
> > > > > > --
> > > > > > 0
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thilina Gunarathne - http://www.wso2.com -
> > http://thilinag.blogspot.com
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Help with SwA
Posted by Thilina Gunarathne <cs...@gmail.com>.
try this...
outMessageContext.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
> I don't have service.xml. I write a custom MessageReceiver to process the
> request and response MessageContext
Curious to know how you are specifying your custom message receiver to
the services...
Thanks,
Thilina
> how you are mentiong
>. In this way, is the way you suggested
> still workable?
>
> Regards,
> Xinjun
>
>
> On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > The following is the code snippet where I try to enable SwA only for one
> > > service.
> > >
> > > /** in axis2.xml, enableSwA is set to false **/
> > Please add the enableSwA parameter to your services.xml to enable SwA
> > only for that service. Also you can add it under a respective
> > operation element in the services.xml to enable SwA only for that
> > particular operation..
> >
> > > The out.setDoingSwA(true) seems not take effect.
> > Unfortunately this is not working and misleading.. This method was
> > used only in the transport layers.
> >
> > You may try doing the following..
> >
> out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE
> );
> >
> > thanks,
> > Thilina
> > >
> > >
> > > Could you suggest how to solve the problem? I am using Axis2 1.2.
> > >
> > >
> > > Regards,
> > > Xinjun
> > >
> > >
> > >
> > > On 5/1/07, Thilina Gunarathne < csethil@gmail.com> wrote:
> > > > > >
> DataHandler(byte_data,"application/octet-stream");
> > > > You may use the ByteArrayDataSource for this purpose.. Alternatively
> > > > you can try using "binary" instead of the
> > > > "application/octet-stream"...
> > > >
> > > > HTH,
> > > > Thilina
> > > > > > BinaryData binaryData =new BinaryData();
> > > > > > binaryData.setBase64Binary(dataHandler);
> > > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > > response.setBinaryData(binaryData);
> > > > > >
> > > > > > The problem is in the method toEnvelope setting the child for the
> > > body.
> > > > > >
> > > > > > I'm getting the following exception:
> > > > > >
> > > > > > java.lang.RuntimeException: org.apache.axiom.om.OMException:
> > > Referenced
> > > > > > Attachment not found in the MIME Message.
> > > > > >
> > > > >
> > > ContentID:
> 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > at
> > > > > >
> > > > > client.Medici_LinkSOAP12PortStub.fromOM
> > > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > > at
> > > > > >
> > > > >
> > >
> client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
> > > > > > at client.ClientUtilities.mtomTest(ClientUtilities.java :476)
> > > > > > at client.Client.main(Client.java:69)
> > > > > > Caused by: org.apache.axiom.om.OMException: Referenced Attachment
> not
> > > > > found
> > > > > > in the MIME Message.
> > > > > >
> > > > > ContentID:
> > > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > > at
> > > > > >
> > > > >
> > >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java:103)
> > > > > > at
> > > > > >
> > > > >
> > > medici_link.xmime.xsd.BinaryData$Factory.parse(
> BinaryData.java:429)
> > > > > > at
> > > > > >
> > > > >
> > >
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
> > > > > > at
> > > > > >
> > > > >
> > >
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
> > > > > > ... 3 more
> > > > > >
> > > > > > And with TCPMon I can see the fault as an attachment.
> > > > > >
> > > > > > Thanks and regards,
> > > > > >
> > > > > > Jorge Fernández
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > >
> > > > > LLama Gratis a cualquier PC del Mundo.
> > > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > > http://es.voice.yahoo.com
> > > > >
> > > > >
> > > > > HTTP/1.1 200 OK
> > > > > Server: Apache-Coyote/1.1
> > > > > Content-Type: multipart/related;
> > > > >
> > >
> boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > > type="application/xop+xml";
> > > > >
> > >
> start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > > >";
> > > > > start-info="application/soap+xml";
> > > > >
> > >
> action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > > >
> > >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > > application/xop+xml; charset=UTF-8;
> > > > >
> type="application/soap+xml"Content-Transfer-Encoding:
> > > > > binaryContent-ID:
> > > > > <
> > > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org>
> > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > <soapenv:Envelope
> > > > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > > > >
> > > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope
> ">
> > > > > <soapenv:Header>
> > > > > <wsa:ReplyTo>
> > > > >
> > > > >
> > > <wsa:Address>
> http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > > <wsa:ReferenceParameters>
> > > > > <axis2:ServiceGroupId
> > > > >
> > > xmlns:axis2="
> http://ws.apache.org/namespaces/axis2">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > > </wsa:ReferenceParameters>
> > > > > </wsa:ReplyTo>
> > > > >
> > > > >
> > >
> <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > > >
> > > <wsa:Action>urn:getAttachment</wsa:Action>
> > > > >
> > > > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > </soapenv:Header>
> > > > > <soapenv:Body>
> > > > > <ns3:getAttachmentResponse
> > > > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > > <ns3:binaryData
> > > > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > > > s1:contentType="application/octet-stream">
> > > > > <xop:Include
> > > > > href="cid:
> > > 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > > xmlns:xop=" http://www.w3.org/2004/08/xop/include"
> />
> > > > > </ns3:binaryData>
> > > > > </ns3:getAttachmentResponse>
> > > > > </soapenv:Body>
> > > > >
> > > > >
> > >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > > 10c1
> > > > >
> --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > > type="application/soap+xml"
> > > > > Content-Transfer-Encoding: binary
> > > > > Content-ID:
> > > > >
> > > > > <
> > > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > > <soapenv:Envelope
> > > > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > > > >
> > > xmlns:soapenv="
> http://www.w3.org/2003/05/soap-envelope">
> > > > > <soapenv:Header>
> > > > >
> > > > >
> > > <wsa:Action>
> http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > > >
> > > > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > > </soapenv:Header>
> > > > > <soapenv:Body>
> > > > > <soapenv:Fault>
> > > > > <soapenv:Code>
> > > > >
> > > > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > > </soapenv:Code>
> > > > > <soapenv:Reason>
> > > > > <soapenv:Text
> > > xml:lang="en-US">Error while
> > > > > writing to the OutputStream.</soapenv:Text>
> > > > > </soapenv:Reason>
> > > > > <soapenv:Detail>
> > > > >
> > > <Exception>org.apache.axis2.AxisFault: Error
> > > > > while writing to the OutputStream.
 at
> > > > >
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:290)
> > > > > at
> > > > >
> > >
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> :116)
> > > > > at
> > > > >
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > > > > at
> > > > >
> > > javax.servlet.http.HttpServlet.service
> (HttpServlet.java:802)
> > > > > at
> > > > >
> > >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > (ApplicationFilterChain.java:252)
> > > > > 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.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:869)
> > > > > at
> > > > >
> > >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> > > > > at
> > > > >
> > >
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > > (PoolTcpEndpoint.java:527)
> > > > > at
> > > > >
> > >
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> > > > > at
> > > > >
> > >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > > (ThreadPool.java:684)
> > > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > > OutputStream.
 at
> > > > > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > > (MIMEOutputUtils.java:72)
> > > > > at
> > > > >
> > >
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:123)
> > > > > at
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > (OMNodeImpl.java:419)
> > > > > at
> > > > >
> > >
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:55)
> > > > > at
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > > (CommonsHTTPTransportSender.java:275)
> > > > > at
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> (CommonsHTTPTransportSender.java:203)
> > > > > at
> > > > > org.apache.axis2.engine.AxisEngine.send
> > > (AxisEngine.java:452)
> > > > > at
> > > > >
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> (AbstractInOutSyncMessageReceiver.java:48)
> > > > > at
> > > > > org.apache.axis2.engine.AxisEngine.receive
> > > (AxisEngine.java:144)
> > > > > at
> > > > >
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
> > > > > ... 17 more
Caused by:
> > > > > javax.activation.UnsupportedDataTypeException : no
> > > object
> > > > > DCH for MIME type application/octet-stream
> at
> > > > >
> > >
> javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:885)
> > > > > at
> > > > > javax.activation.DataHandler.writeTo
> > > (DataHandler.java:316)
> > > > > at
> > > > >
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > > at
> > > > >
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > > at
> > > > >
> > > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart
> (MIMEOutputUtils.java:128)
> > > > > at
> > > > >
> > >
> org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:65)
> > > > > ... 26 more
> > > > > </Exception>
> > > > > </soapenv:Detail>
> > > > > </soapenv:Fault>
> > > > > </soapenv:Body>
> > > > > </soapenv:Envelope>
> > > > > 38
> > > > >
> > > > >
> --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > > 2
> > > > > --
> > > > > 0
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with SwA
Posted by Xinjun Chen <xj...@gmail.com>.
I don't have service.xml. I write a custom MessageReceiver to process the
request and response MessageContext. In this way, is the way you suggested
still workable?
Regards,
Xinjun
On 5/25/07, Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > The following is the code snippet where I try to enable SwA only for one
> > service.
> >
> > /** in axis2.xml, enableSwA is set to false **/
> Please add the enableSwA parameter to your services.xml to enable SwA
> only for that service. Also you can add it under a respective
> operation element in the services.xml to enable SwA only for that
> particular operation..
>
> > The out.setDoingSwA(true) seems not take effect.
> Unfortunately this is not working and misleading.. This method was
> used only in the transport layers.
>
> You may try doing the following..
> out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
>
> thanks,
> Thilina
> >
> >
> > Could you suggest how to solve the problem? I am using Axis2 1.2.
> >
> >
> > Regards,
> > Xinjun
> >
> >
> >
> > On 5/1/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > > DataHandler(byte_data,"application/octet-stream");
> > > You may use the ByteArrayDataSource for this purpose.. Alternatively
> > > you can try using "binary" instead of the
> > > "application/octet-stream"...
> > >
> > > HTH,
> > > Thilina
> > > > > BinaryData binaryData =new BinaryData();
> > > > > binaryData.setBase64Binary(dataHandler);
> > > > > binaryData.setContentType(dataHandler.getContentType());
> > > > > response.setBinaryData(binaryData);
> > > > >
> > > > > The problem is in the method toEnvelope setting the child for the
> > body.
> > > > >
> > > > > I'm getting the following exception:
> > > > >
> > > > > java.lang.RuntimeException: org.apache.axiom.om.OMException:
> > Referenced
> > > > > Attachment not found in the MIME Message.
> > > > >
> > > >
> > ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > at
> > > > >
> > > > client.Medici_LinkSOAP12PortStub.fromOM
> > (Medici_LinkSOAP12PortStub.java:5296)
> > > > > at
> > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.getAttachment
> (Medici_LinkSOAP12PortStub.java:4103)
> > > > > at client.ClientUtilities.mtomTest(ClientUtilities.java :476)
> > > > > at client.Client.main(Client.java:69)
> > > > > Caused by: org.apache.axiom.om.OMException: Referenced Attachment
> not
> > > > found
> > > > > in the MIME Message.
> > > > >
> > > > ContentID:
> > 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > > at
> > > > >
> > > >
> >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler
> (MTOMStAXSOAPModelBuilder.java:103)
> > > > > at
> > > > >
> > > >
> > medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
> > > > > at
> > > > >
> > > >
> > medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(
> GetAttachmentResponse.java:342)
> > > > > at
> > > > >
> > > >
> > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5024)
> > > > > ... 3 more
> > > > >
> > > > > And with TCPMon I can see the fault as an attachment.
> > > > >
> > > > > Thanks and regards,
> > > > >
> > > > > Jorge Fernández
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > > >
> > > >
> > > > ________________________________
> > > >
> > > > LLama Gratis a cualquier PC del Mundo.
> > > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > > http://es.voice.yahoo.com
> > > >
> > > >
> > > > HTTP/1.1 200 OK
> > > > Server: Apache-Coyote/1.1
> > > > Content-Type: multipart/related;
> > > >
> > boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > > type="application/xop+xml";
> > > >
> > start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> > >";
> > > > start-info="application/soap+xml";
> > > >
> > action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > > chunkedDate: Tue, 01 May 2007 10:40:54
> > > >
> >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > > application/xop+xml; charset=UTF-8;
> > > > type="application/soap+xml"Content-Transfer-Encoding:
> > > > binaryContent-ID:
> > > > <
> > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org>
> > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > <soapenv:Envelope
> > > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > > >
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> > > > <soapenv:Header>
> > > > <wsa:ReplyTo>
> > > >
> > > >
> > <wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > > <wsa:ReferenceParameters>
> > > > <axis2:ServiceGroupId
> > > >
> > xmlns:axis2="http://ws.apache.org/namespaces/axis2
> ">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > > </wsa:ReferenceParameters>
> > > > </wsa:ReplyTo>
> > > >
> > > >
> > <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > > >
> > <wsa:Action>urn:getAttachment</wsa:Action>
> > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > </soapenv:Header>
> > > > <soapenv:Body>
> > > > <ns3:getAttachmentResponse
> > > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > > <ns3:binaryData
> > > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > > s1:contentType="application/octet-stream">
> > > > <xop:Include
> > > > href="cid:
> > 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > > xmlns:xop="http://www.w3.org/2004/08/xop/include" />
> > > > </ns3:binaryData>
> > > > </ns3:getAttachmentResponse>
> > > > </soapenv:Body>
> > > >
> > > >
> >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > > 10c1
> > > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > Content-Type: application/xop+xml; charset=UTF-8;
> > > > type="application/soap+xml"
> > > > Content-Transfer-Encoding: binary
> > > > Content-ID:
> > > >
> > > > <
> > 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > > <?xml version='1.0' encoding='UTF-8'?>
> > > > <soapenv:Envelope
> > > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > > >
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> > > > <soapenv:Header>
> > > >
> > > >
> > <wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > > >
> > > >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > > </soapenv:Header>
> > > > <soapenv:Body>
> > > > <soapenv:Fault>
> > > > <soapenv:Code>
> > > >
> > > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > > </soapenv:Code>
> > > > <soapenv:Reason>
> > > > <soapenv:Text
> > xml:lang="en-US">Error while
> > > > writing to the OutputStream.</soapenv:Text>
> > > > </soapenv:Reason>
> > > > <soapenv:Detail>
> > > >
> > <Exception>org.apache.axis2.AxisFault: Error
> > > > while writing to the OutputStream.
 at
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:290)
> > > > at
> > > >
> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> :116)
> > > > at
> > > >
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > > > at
> > > >
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > > > at
> > > >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:252)
> > > > 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.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
> :869)
> > > > at
> > > >
> >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> > > > at
> > > >
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> > (PoolTcpEndpoint.java:527)
> > > > at
> > > >
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> > > > at
> > > >
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> > (ThreadPool.java:684)
> > > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > > org.apache.axiom.om.OMException: Error while writing to the
> > > > OutputStream.
 at
> > > > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> > (MIMEOutputUtils.java:72)
> > > > at
> > > >
> > org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(
> MTOMXMLStreamWriter.java:123)
> > > > at
> > > >
> > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > (OMNodeImpl.java:419)
> > > > at
> > > >
> > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(
> SOAPMessageFormatter.java:55)
> > > > at
> > > >
> >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> > (CommonsHTTPTransportSender.java:275)
> > > > at
> > > >
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> CommonsHTTPTransportSender.java:203)
> > > > at
> > > > org.apache.axis2.engine.AxisEngine.send
> > (AxisEngine.java:452)
> > > > at
> > > >
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(
> AbstractInOutSyncMessageReceiver.java:48)
> > > > at
> > > > org.apache.axis2.engine.AxisEngine.receive
> > (AxisEngine.java:144)
> > > > at
> > > >
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:279)
> > > > ... 17 more
Caused by:
> > > > javax.activation.UnsupportedDataTypeException : no
> > object
> > > > DCH for MIME type application/octet-stream
 at
> > > >
> > javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java
> :885)
> > > > at
> > > > javax.activation.DataHandler.writeTo
> > (DataHandler.java:316)
> > > > at
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > > at
> > > >
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > > at
> > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart(
> MIMEOutputUtils.java:128)
> > > > at
> > > >
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java
> :65)
> > > > ... 26 more
> > > > </Exception>
> > > > </soapenv:Detail>
> > > > </soapenv:Fault>
> > > > </soapenv:Body>
> > > > </soapenv:Envelope>
> > > > 38
> > > >
> > > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > > 2
> > > > --
> > > > 0
> > > >
> > > >
> > >
> > >
> > > --
> > > Thilina Gunarathne - http://www.wso2.com -
> http://thilinag.blogspot.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Help with SwA
Posted by Thilina Gunarathne <cs...@gmail.com>.
> The following is the code snippet where I try to enable SwA only for one
> service.
>
> /** in axis2.xml, enableSwA is set to false **/
Please add the enableSwA parameter to your services.xml to enable SwA
only for that service. Also you can add it under a respective
operation element in the services.xml to enable SwA only for that
particular operation..
> The out.setDoingSwA(true) seems not take effect.
Unfortunately this is not working and misleading.. This method was
used only in the transport layers.
You may try doing the following..
out.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
thanks,
Thilina
>
>
> Could you suggest how to solve the problem? I am using Axis2 1.2.
>
>
> Regards,
> Xinjun
>
>
>
> On 5/1/07, Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > DataHandler(byte_data,"application/octet-stream");
> > You may use the ByteArrayDataSource for this purpose.. Alternatively
> > you can try using "binary" instead of the
> > "application/octet-stream"...
> >
> > HTH,
> > Thilina
> > > > BinaryData binaryData =new BinaryData();
> > > > binaryData.setBase64Binary(dataHandler);
> > > > binaryData.setContentType(dataHandler.getContentType());
> > > > response.setBinaryData(binaryData);
> > > >
> > > > The problem is in the method toEnvelope setting the child for the
> body.
> > > >
> > > > I'm getting the following exception:
> > > >
> > > > java.lang.RuntimeException: org.apache.axiom.om.OMException:
> Referenced
> > > > Attachment not found in the MIME Message.
> > > >
> > >
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > at
> > > >
> > > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5296)
> > > > at
> > > >
> > >
> client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
> > > > at client.ClientUtilities.mtomTest(ClientUtilities.java :476)
> > > > at client.Client.main(Client.java:69)
> > > > Caused by: org.apache.axiom.om.OMException: Referenced Attachment not
> > > found
> > > > in the MIME Message.
> > > >
> > > ContentID:
> 1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > > at
> > > >
> > >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java:103)
> > > > at
> > > >
> > >
> medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
> > > > at
> > > >
> > >
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
> > > > at
> > > >
> > >
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
> > > > ... 3 more
> > > >
> > > > And with TCPMon I can see the fault as an attachment.
> > > >
> > > > Thanks and regards,
> > > >
> > > > Jorge Fernández
> > > >
> > > >
> > >
> > >
> > > --
> > > Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > >
> > >
> > > ________________________________
> > >
> > > LLama Gratis a cualquier PC del Mundo.
> > > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > > http://es.voice.yahoo.com
> > >
> > >
> > > HTTP/1.1 200 OK
> > > Server: Apache-Coyote/1.1
> > > Content-Type: multipart/related;
> > >
> boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > > type="application/xop+xml";
> > >
> start="<0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org
> >";
> > > start-info="application/soap+xml";
> > >
> action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > > chunkedDate: Tue, 01 May 2007 10:40:54
> > >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > > application/xop+xml; charset=UTF-8;
> > > type="application/soap+xml"Content-Transfer-Encoding:
> > > binaryContent-ID:
> > > <
> 0.urn:uuid:3B82B5DA59C7F75D1E1178016055345@apache.org>
> > > <?xml version='1.0' encoding='UTF-8'?>
> > > <soapenv:Envelope
> > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > >
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> > > <soapenv:Header>
> > > <wsa:ReplyTo>
> > >
> > >
> <wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > > <wsa:ReferenceParameters>
> > > <axis2:ServiceGroupId
> > >
> xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > > </wsa:ReferenceParameters>
> > > </wsa:ReplyTo>
> > >
> > >
> <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > >
> <wsa:Action>urn:getAttachment</wsa:Action>
> > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > </soapenv:Header>
> > > <soapenv:Body>
> > > <ns3:getAttachmentResponse
> > > xmlns:ns3="http://op_messages.medici_link/xsd">
> > > <ns3:binaryData
> > > xmlns:s1=" http://www.w3.org/2005/05/xmlmime"
> > > s1:contentType="application/octet-stream">
> > > <xop:Include
> > > href="cid:
> 1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > > xmlns:xop="http://www.w3.org/2004/08/xop/include" />
> > > </ns3:binaryData>
> > > </ns3:getAttachmentResponse>
> > > </soapenv:Body>
> > >
> > >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > > 10c1
> > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > Content-Type: application/xop+xml; charset=UTF-8;
> > > type="application/soap+xml"
> > > Content-Transfer-Encoding: binary
> > > Content-ID:
> > >
> > > <
> 0.urn:uuid:3B82B5DA59C7F75D1E1178016055488@apache.org>
> > > <?xml version='1.0' encoding='UTF-8'?>
> > > <soapenv:Envelope
> > > xmlns:wsa=" http://www.w3.org/2005/08/addressing"
> > >
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> > > <soapenv:Header>
> > >
> > >
> <wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> > >
> > >
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > > </soapenv:Header>
> > > <soapenv:Body>
> > > <soapenv:Fault>
> > > <soapenv:Code>
> > >
> > > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > > </soapenv:Code>
> > > <soapenv:Reason>
> > > <soapenv:Text
> xml:lang="en-US">Error while
> > > writing to the OutputStream.</soapenv:Text>
> > > </soapenv:Reason>
> > > <soapenv:Detail>
> > >
> <Exception>org.apache.axis2.AxisFault: Error
> > > while writing to the OutputStream.
 at
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:290)
> > > at
> > >
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:116)
> > > at
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > > at
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > > at
> > >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:252)
> > > 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.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:869)
> > > at
> > >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> > > at
> > >
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> (PoolTcpEndpoint.java:527)
> > > at
> > >
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> > > at
> > >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> (ThreadPool.java:684)
> > > at java.lang.Thread.run(Unknown Source)
Caused by:
> > > org.apache.axiom.om.OMException: Error while writing to the
> > > OutputStream.
 at
> > > org.apache.axiom.om.impl.MIMEOutputUtils.complete
> (MIMEOutputUtils.java:72)
> > > at
> > >
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:123)
> > > at
> > >
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> (OMNodeImpl.java:419)
> > > at
> > >
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:55)
> > > at
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> (CommonsHTTPTransportSender.java:275)
> > > at
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:203)
> > > at
> > > org.apache.axis2.engine.AxisEngine.send
> (AxisEngine.java:452)
> > > at
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:48)
> > > at
> > > org.apache.axis2.engine.AxisEngine.receive
> (AxisEngine.java:144)
> > > at
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
> > > ... 17 more
Caused by:
> > > javax.activation.UnsupportedDataTypeException : no
> object
> > > DCH for MIME type application/octet-stream
 at
> > >
> javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:885)
> > > at
> > > javax.activation.DataHandler.writeTo
> (DataHandler.java:316)
> > > at
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > > at
> > >
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > > at
> > >
> org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart(MIMEOutputUtils.java:128)
> > > at
> > >
> org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:65)
> > > ... 26 more
> > > </Exception>
> > > </soapenv:Detail>
> > > </soapenv:Fault>
> > > </soapenv:Body>
> > > </soapenv:Envelope>
> > > 38
> > >
> > > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > > 2
> > > --
> > > 0
> > >
> > >
> >
> >
> > --
> > Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with SwA
Posted by Xinjun Chen <xj...@gmail.com>.
I have a related question regarding SwA support.
In the axis2.xml, if I set enableSwA to true, my response can arrive at the
client with attachment, but then all the requests (no matter there is
any attachment) are considered as multipart requests and I get "Bad Request"
error. The "Bad Request" error will eliminate if I set enableSwA to false.
If I set enableSwA to false, I can only get the soap response but no
attachment is received at the client.
The following is the code snippet where I try to enable SwA only for one
service.
/** in axis2.xml, enableSwA is set to false **/
FileDataSource ackDataSource = new FileDataSource(ackFullPath);
DataHandler outDataHandler = new DataHandler(ackDataSource);
String attachmentID = out.addAttachment(outDataHandler);
/** try to enableSwA for this out MessageContext only */
out.setDoingSwA(true);
The out.setDoingSwA(true) seems not take effect.
Could you suggest how to solve the problem? I am using Axis2 1.2.
Regards,
Xinjun
On 5/1/07, Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > > DataHandler(byte_data,"application/octet-stream");
> You may use the ByteArrayDataSource for this purpose.. Alternatively
> you can try using "binary" instead of the
> "application/octet-stream"...
>
> HTH,
> Thilina
> > > BinaryData binaryData =new BinaryData();
> > > binaryData.setBase64Binary(dataHandler);
> > > binaryData.setContentType(dataHandler.getContentType());
> > > response.setBinaryData(binaryData);
> > >
> > > The problem is in the method toEnvelope setting the child for the
> body.
> > >
> > > I'm getting the following exception:
> > >
> > > java.lang.RuntimeException: org.apache.axiom.om.OMException:
> Referenced
> > > Attachment not found in the MIME Message.
> > >
> > ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > at
> > >
> > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5296)
> > > at
> > >
> > client.Medici_LinkSOAP12PortStub.getAttachment
> (Medici_LinkSOAP12PortStub.java:4103)
> > > at client.ClientUtilities.mtomTest(ClientUtilities.java:476)
> > > at client.Client.main(Client.java:69)
> > > Caused by: org.apache.axiom.om.OMException: Referenced Attachment not
> > found
> > > in the MIME Message.
> > >
> > ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > > at
> > >
> >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler
> (MTOMStAXSOAPModelBuilder.java:103)
> > > at
> > >
> > medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
> > > at
> > >
> > medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(
> GetAttachmentResponse.java:342)
> > > at
> > >
> > client.Medici_LinkSOAP12PortStub.fromOM
> (Medici_LinkSOAP12PortStub.java:5024)
> > > ... 3 more
> > >
> > > And with TCPMon I can see the fault as an attachment.
> > >
> > > Thanks and regards,
> > >
> > > Jorge Fernández
> > >
> > >
> >
> >
> > --
> > Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
> >
> > ________________________________
> >
> > LLama Gratis a cualquier PC del Mundo.
> > Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > http://es.voice.yahoo.com
> >
> >
> > HTTP/1.1 200 OK
> > Server: Apache-Coyote/1.1
> > Content-Type: multipart/related;
> > boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> > type="application/xop+xml";
> > start="<0....@apache.org>";
> > start-info="application/soap+xml";
> > action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> > chunkedDate: Tue, 01 May 2007 10:40:54
> >
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> > application/xop+xml; charset=UTF-8;
> > type="application/soap+xml"Content-Transfer-Encoding:
> > binaryContent-ID:
> > <0....@apache.org>
> > <?xml version='1.0' encoding='UTF-8'?>
> > <soapenv:Envelope
> > xmlns:wsa="http://www.w3.org/2005/08/addressing"
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> > <soapenv:Header>
> > <wsa:ReplyTo>
> >
> > <wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
> > <wsa:ReferenceParameters>
> > <axis2:ServiceGroupId
> > xmlns:axis2="http://ws.apache.org/namespaces/axis2
> ">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> > </wsa:ReferenceParameters>
> > </wsa:ReplyTo>
> >
> > <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> > <wsa:Action>urn:getAttachment</wsa:Action>
> >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > </soapenv:Header>
> > <soapenv:Body>
> > <ns3:getAttachmentResponse
> > xmlns:ns3="http://op_messages.medici_link/xsd">
> > <ns3:binaryData
> > xmlns:s1="http://www.w3.org/2005/05/xmlmime"
> > s1:contentType="application/octet-stream">
> > <xop:Include
> > href="cid:1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> > xmlns:xop="http://www.w3.org/2004/08/xop/include" />
> > </ns3:binaryData>
> > </ns3:getAttachmentResponse>
> > </soapenv:Body>
> >
> >
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> > 10c1
> > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > Content-Type: application/xop+xml; charset=UTF-8;
> > type="application/soap+xml"
> > Content-Transfer-Encoding: binary
> > Content-ID:
> >
> > <0....@apache.org>
> > <?xml version='1.0' encoding='UTF-8'?>
> > <soapenv:Envelope
> > xmlns:wsa="http://www.w3.org/2005/08/addressing"
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> > <soapenv:Header>
> >
> > <wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
> >
> > <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> > </soapenv:Header>
> > <soapenv:Body>
> > <soapenv:Fault>
> > <soapenv:Code>
> >
> > <soapenv:Value>soapenv:Sender</soapenv:Value>
> > </soapenv:Code>
> > <soapenv:Reason>
> > <soapenv:Text xml:lang="en-US">Error while
> > writing to the OutputStream.</soapenv:Text>
> > </soapenv:Reason>
> > <soapenv:Detail>
> > <Exception>org.apache.axis2.AxisFault: Error
> > while writing to the OutputStream.
 at
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:290)
> > at
> > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java
> :116)
> > at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
> > 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.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
> :869)
> > at
> >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> > at
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
> > at
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> > at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> > at java.lang.Thread.run(Unknown Source)
Caused by:
> > org.apache.axiom.om.OMException: Error while writing to the
> > OutputStream.
 at
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java
> :72)
> > at
> > org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(
> MTOMXMLStreamWriter.java:123)
> > at
> > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(
> OMNodeImpl.java:419)
> > at
> > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(
> SOAPMessageFormatter.java:55)
> > at
> >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> (CommonsHTTPTransportSender.java:275)
> > at
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> CommonsHTTPTransportSender.java:203)
> > at
> > org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
> > at
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(
> AbstractInOutSyncMessageReceiver.java:48)
> > at
> > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> > at
> >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:279)
> > ... 17 more
Caused by:
> > javax.activation.UnsupportedDataTypeException: no object
> > DCH for MIME type application/octet-stream
 at
> > javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java
> :885)
> > at
> > javax.activation.DataHandler.writeTo(DataHandler.java:316)
> > at
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> > at
> > javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> > at
> > org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart(
> MIMEOutputUtils.java:128)
> > at
> > org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java
> :65)
> > ... 26 more
> > </Exception>
> > </soapenv:Detail>
> > </soapenv:Fault>
> > </soapenv:Body>
> > </soapenv:Envelope>
> > 38
> >
> > --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> > 2
> > --
> > 0
> >
> >
>
>
> --
> Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Help with SwA
Posted by Thilina Gunarathne <cs...@gmail.com>.
> > DataHandler(byte_data,"application/octet-stream");
You may use the ByteArrayDataSource for this purpose.. Alternatively
you can try using "binary" instead of the
"application/octet-stream"...
HTH,
Thilina
> > BinaryData binaryData =new BinaryData();
> > binaryData.setBase64Binary(dataHandler);
> > binaryData.setContentType(dataHandler.getContentType());
> > response.setBinaryData(binaryData);
> >
> > The problem is in the method toEnvelope setting the child for the body.
> >
> > I'm getting the following exception:
> >
> > java.lang.RuntimeException: org.apache.axiom.om.OMException: Referenced
> > Attachment not found in the MIME Message.
> >
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > at
> >
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5296)
> > at
> >
> client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
> > at client.ClientUtilities.mtomTest(ClientUtilities.java:476)
> > at client.Client.main(Client.java:69)
> > Caused by: org.apache.axiom.om.OMException: Referenced Attachment not
> found
> > in the MIME Message.
> >
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> > at
> >
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java:103)
> > at
> >
> medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
> > at
> >
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
> > at
> >
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
> > ... 3 more
> >
> > And with TCPMon I can see the fault as an attachment.
> >
> > Thanks and regards,
> >
> > Jorge Fernández
> >
> >
>
>
> --
> Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ________________________________
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: multipart/related;
> boundary=MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344;
> type="application/xop+xml";
> start="<0....@apache.org>";
> start-info="application/soap+xml";
> action="urn:getAttachment";charset=UTF-8Transfer-Encoding:
> chunkedDate: Tue, 01 May 2007 10:40:54
> GMT516--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344Content-Type:
> application/xop+xml; charset=UTF-8;
> type="application/soap+xml"Content-Transfer-Encoding:
> binaryContent-ID:
> <0....@apache.org>
> <?xml version='1.0' encoding='UTF-8'?>
> <soapenv:Envelope
> xmlns:wsa="http://www.w3.org/2005/08/addressing"
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> <soapenv:Header>
> <wsa:ReplyTo>
>
> <wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
> <wsa:ReferenceParameters>
> <axis2:ServiceGroupId
> xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:3B82B5DA59C7F75D1E1178016053150</axis2:ServiceGroupId>
> </wsa:ReferenceParameters>
> </wsa:ReplyTo>
>
> <wsa:MessageID>urn:uuid:3B82B5DA59C7F75D1E1178016055296</wsa:MessageID>
> <wsa:Action>urn:getAttachment</wsa:Action>
>
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> </soapenv:Header>
> <soapenv:Body>
> <ns3:getAttachmentResponse
> xmlns:ns3="http://op_messages.medici_link/xsd">
> <ns3:binaryData
> xmlns:s1="http://www.w3.org/2005/05/xmlmime"
> s1:contentType="application/octet-stream">
> <xop:Include
> href="cid:1.urn:uuid:3B82B5DA59C7F75D1E1178016055361@apache.org"
> xmlns:xop="http://www.w3.org/2004/08/xop/include" />
> </ns3:binaryData>
> </ns3:getAttachmentResponse>
> </soapenv:Body>
>
> </soapenv:Envelope>38--MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055344
> 10c1
> --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> Content-Type: application/xop+xml; charset=UTF-8;
> type="application/soap+xml"
> Content-Transfer-Encoding: binary
> Content-ID:
>
> <0....@apache.org>
> <?xml version='1.0' encoding='UTF-8'?>
> <soapenv:Envelope
> xmlns:wsa="http://www.w3.org/2005/08/addressing"
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> <soapenv:Header>
>
> <wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
>
> <wsa:RelatesTo>urn:uuid:B5AEE5ABDE83138F781178016055102</wsa:RelatesTo>
> </soapenv:Header>
> <soapenv:Body>
> <soapenv:Fault>
> <soapenv:Code>
>
> <soapenv:Value>soapenv:Sender</soapenv:Value>
> </soapenv:Code>
> <soapenv:Reason>
> <soapenv:Text xml:lang="en-US">Error while
> writing to the OutputStream.</soapenv:Text>
> </soapenv:Reason>
> <soapenv:Detail>
> <Exception>org.apache.axis2.AxisFault: Error
> while writing to the OutputStream.
 at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:290)
> at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:116)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> 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.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:869)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> at java.lang.Thread.run(Unknown Source)
Caused by:
> org.apache.axiom.om.OMException: Error while writing to the
> OutputStream.
 at
> org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:72)
> at
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:123)
> at
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:419)
> at
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:55)
> at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:275)
> at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:203)
> at
> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
> at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:48)
> at
> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
> ... 17 more
Caused by:
> javax.activation.UnsupportedDataTypeException: no object
> DCH for MIME type application/octet-stream
 at
> javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:885)
> at
> javax.activation.DataHandler.writeTo(DataHandler.java:316)
> at
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
> at
> javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
> at
> org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart(MIMEOutputUtils.java:128)
> at
> org.apache.axiom.om.impl.MIMEOutputUtils.complete(MIMEOutputUtils.java:65)
> ... 26 more
> </Exception>
> </soapenv:Detail>
> </soapenv:Fault>
> </soapenv:Body>
> </soapenv:Envelope>
> 38
>
> --MIMEBoundaryurn_uuid_3B82B5DA59C7F75D1E1178016055487
> 2
> --
> 0
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with SwA
Posted by Jorge Fernandez <in...@yahoo.es>.
I attach the response message
Thilina Gunarathne <cs...@gmail.com> escribió: Messsage traces please..:)
On 5/1/07, Jorge Fernandez wrote:
> Hi Thilina,
>
> You were right. The problem was in TCPMon. Without using TCPMon, I don't
> even have the problem sending big files. Thanks a lot.
>
> I have one more question now that this problem was fixed: Is there any
> sample of MOTM or SwA where the attachment is not a file?? I have to send
> large arrays, for example of short and sending them in xml increases the
> size of the message as it has to generate the tags for each element. So I
> would like to send them as attachments.
>
> Could anyone tell me how can I do it?
>
> I was given some advise and I'm trying to convert the array of short in a
> byte array doing this. I would appreciate some help on this:
>
> short[] data=new short[100];
> for (short i=0;i
> data[i]=i;
> byte[] byte_data = new byte[data.length * 2];
> for(int i=0; i < data.length; i++){
> byte_data[2*i] = (byte) ((data[i] >>> 8) & 0xFF);
> byte_data[2*i + 1] = (byte) ((data[i] >>> 0) & 0xFF);
> }
>
> // Populating the code generated beans
> GetAttachmentResponse response=new GetAttachmentResponse();
> DataHandler dataHandler = new
> DataHandler(byte_data,"application/octet-stream");
> BinaryData binaryData =new BinaryData();
> binaryData.setBase64Binary(dataHandler);
> binaryData.setContentType(dataHandler.getContentType());
> response.setBinaryData(binaryData);
>
> The problem is in the method toEnvelope setting the child for the body.
>
> I'm getting the following exception:
>
> java.lang.RuntimeException: org.apache.axiom.om.OMException: Referenced
> Attachment not found in the MIME Message.
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> at
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5296)
> at
> client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
> at client.ClientUtilities.mtomTest(ClientUtilities.java:476)
> at client.Client.main(Client.java:69)
> Caused by: org.apache.axiom.om.OMException: Referenced Attachment not found
> in the MIME Message.
> ContentID:1.urn:uuid:5B831187063734CFC51177964294021@apache.org
> at
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java:103)
> at
> medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
> at
> medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
> at
> client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
> ... 3 more
>
> And with TCPMon I can see the fault as an attachment.
>
> Thanks and regards,
>
> Jorge Fernández
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com