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 "Masin, Valerie" <VJ...@docharbor.com> on 2007/04/03 21:03:37 UTC

RE: Axis2 not putting binary attachment on the wire

Problem solved. There was nothing wrong with Axis. Rather than using a
FileDataSource we had been using our own class that implements
DataSource but that class hadn't been returning a new InputStream object
for every call to getInputStream (as the javadocs say it must). Once I
switched it to use a FileDataSource it worked fine.

We used our homegrown DataSource class successfully with Axis1 so I
assume that Axis2 takes advantage of making multiple calls to
getInputStream whereas axis1 hadn't.

Thanks for the responses.
-- Valerie

-----Original Message-----
From: Thilina Gunarathne [mailto:csethil@gmail.com] 
Sent: Wednesday, March 28, 2007 3:12 AM
To: axis-user@ws.apache.org
Subject: Re: Axis2 not putting binary attachment on the wire

Please log a Jira with enough information (a test case would be great)
to reproduce this..

thanks,
Thilina

On 3/28/07, Masin, Valerie <VJ...@docharbor.com> wrote:
>
>
>
> No it is not working fine with mtom, there is no data attached. Where 
> you said "Hope you had your binary data here..." there was no data. 
> There was just the 0.
> I show the soapmonitor output to show that there had been data in the 
> soap message before it was optimized to mtom.
>
>  ________________________________
>  From: Thilina Gunarathne [mailto:csethil@gmail.com]
> Sent: Tue 3/27/2007 9:29 PM
>
> To: axis-user@ws.apache.org
> Subject: Re: Axis2 not putting binary attachment on the wire
>
>
>
>
> It seems it works fine when MTOM is enabled...
>
> > From tcpmon
> > HTTP/1.1 200 OK
> > Server: ""
> > Date: Tue, 27 Mar 2007 13:30:16 GMT
> > Content-type: multipart/related;
> >
> boundary=MIMEBoundaryurn_uuid_E612E8E634E97EAEE61175002216495;
> > type="application/xop+xml";
> >
> start="<0....@apache.org>";
> > start-info="text/xml"; charset=UTF-8Transfer-encoding:
> >
> chunked02d7--MIMEBoundaryurn_uuid_E612E8E634E97EAEE61175002216495conte
> nt
> > -type: application/xop+xml; charset=UTF-8;
> > type="text/xml";content-transfer-encoding:
> binarycontent-id:
> >
> <0....@apache.org>
> >       <?xml version='1.0' encoding='UTF-8'?>
> >          <soapenv:Envelope
> >
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> >             <soapenv:Header />
> >             <soapenv:Body>
> >                <ns1:getDocumentResponse 
> > xmlns:ns1="urn:webservices.docharbor.com">
> >                   <ns1:return>
> >
> <ns1:documentSize>198</ns1:documentSize>
> >                      <ns1:document>
> >                         <xop:Include
> >
> href="cid:1.urn:uuid:E612E8E634E97EAEE61175002216497@apache.org"
> > xmlns:xop="http://www.w3.org/2004/08/xop/include" />
> >                      </ns1:document>
> >                   </ns1:return>
> >                </ns1:getDocumentResponse>
> >             </soapenv:Body>
> >          </soapenv:Envelope>
> > 00cc
> >
> > --MIMEBoundaryurn_uuid_E612E8E634E97EAEE61175002216495
> > content-type: application/octet-stream
> > content-transfer-encoding: binary
> > content-id:
> >
> <1....@apache.org>0
> Hope you had your binary date here...
>
> ~Thilina
> PS: Please use TCPMON when sniffing messages with attachments..
> SOAPMonitor will not show you the attachments...
>
> >
> >
> > -----Original Message-----
> > From: Thilina Gunarathne [mailto:csethil@gmail.com]
> > Sent: Tuesday, March 27, 2007 5:54 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: Axis2 not putting binary attachment on the wire
> >
> > Opps... Sounds like a bug to me.. Please log a JIRA with more
details..
> > Some source code would be actually better...
> >
> > Then in order to get through this you can try enablingMTOM in your 
> > Axis2.xml..
> >
> > Thanks,
> > Thilina
> >
> > On 3/28/07, Masin, Valerie <VJ...@docharbor.com> wrote:
> > >
> > >
> > > My webservice returns a binary document which I declare in my wsdl

> > > as base64Binary. Using SOAPMonitor I see my document in the 
> > > returned soap
> >
> > > message. However, tcpmon shows that the document is empty. I have 
> > > tried this both with and without MTOM.
> > >
> > > Without MTOM here is the soap from SOAPMonitor...
> > > <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope
> > >
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> > >   <soapenv:Header />
> > >   <soapenv:Body>
> > >     <ns1:getDocumentResponse
> > xmlns:ns1="urn:webservices.docharbor.com">
> > >       <ns1:return>
> > >         <ns1:documentSize>198</ns1:documentSize>
> > >
> > >
> >
> <ns1:document>e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcZGVmbGFuZzEwMzN7
> XG
> >
> ZvbnR0Ymx7XGYwXGZzd2lzc1xmY2hhcnNldDAgQXJpYWw7fX0NCntcKlxnZW5lcmF0b3Ig
> TX
> >
> NmdGVkaXQgNS40MS4xNS4xNTA3O31cdmlld2tpbmQ0XHVjMVxwYXJkXGYwXGZzMjAgSSdt
> IH
> >
> RoZSBkZWZhdWx0IGRvY3VtZW50IGZvciBpbXBvcnRhdGlvbi5ccGFyDQp9DQoA</ns1:do
> cu
> > ment>
> > >       </ns1:return>
> > >     </ns1:getDocumentResponse>
> > >   </soapenv:Body>
> > > </soapenv:Envelope>
> > >
> > >
> > > ... and here is the output of tcpmon
> > > HTTP/1.1 200 OK
> > > Server: ""
> > > Date: Tue, 27 Mar 2007 18:26:12 GMT
> > > Content-type: text/xml; charset=UTF-8
> > > Transfer-encoding: chunked
> > >
> > > 016f
> > > <?xml version='1.0' encoding='UTF-8'?>
> > >    <soapenv:Envelope
> > >
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> > >       <soapenv:Header />
> > >       <soapenv:Body>
> > >          <ns1:getDocumentResponse
> > xmlns:ns1="urn:webservices.docharbor.com">
> > >             <ns1:return>
> > >                <ns1:documentSize>198</ns1:documentSize>
> > >                <ns1:document></ns1:document> <<<<<<<<<<<<<<<<<<<< 
> > > notice the empty document
> > >             </ns1:return>
> > >          </ns1:getDocumentResponse>
> > >       </soapenv:Body>
> > >    </soapenv:Envelope>
> > > 0
> > >
> > > Does anyone know why this is happening? Thanks, Valerie
> >
> >
> > --
> > 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
> >
> >
> >
> ---------------------------------------------------------------------
> > 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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org