I haven't used Axis2 on the server side to receive attachments. But I have
used Axis2 on the client to receive an attachment.

When using JAX-WS, the element of type xs:base64binary must also have an
attribute xmime:expectedContentType.
http://java.sun.com/webservices/docs/2.0/jaxws/mtom-swaref.html

Look at this page for Axis2 differences of MTOM vs SwA
http://ws.apache.org/axis2/1_1/mtom-guide.html



-Jorge


On Wed, May 19, 2010 at 6:18 PM, Nirav Shah <[email protected]> wrote:

> Thanks Andreas/Jorge,
>
> i used the Axiom package(snapshot).
>
> I have the WSDL using xs:base64Binary (MTOM),. I got an OutOfmemory error
> when making a call to the service. So i used a smaller file and that seemed
> to have work. I added a TCP Mon to intercept the request and to me it seems
> like a SwA request. why would is add MIME boundary ? i generated the ADB
> stubs  and have the following set
>
>
> soapBindingStub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
>
>
> *Intercepted Message header:*
>
> POST /axis2/services/sampleApp HTTP/1.1
> Content-Type: multipart/related;
> boundary=MIMEBoundaryurn_uuid_74D2AE27EAED433D531274307161705;
> type="application/xop+xml"; start="<
> 0.urn:uuid:[email protected]<0.urn%3auuid%[email protected]>>";
> start-info="text/xml"
> SOAPAction: "sendRequest"
> User-Agent: Axis2
> Host: localhost:8088
> Transfer-Encoding: chunked
>
> 23a5
> --MIMEBoundaryurn_uuid_74D2AE27EAED433D531274307161705
> Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
> Content-Transfer-Encoding: binary
> Content-ID: 
> <0.urn:uuid:[email protected]<0.urn%3auuid%[email protected]>
> >
>
>
>
> Thanks,
> Vish
>
>
>
> On Wed, May 19, 2010 at 1:31 PM, Andreas Veithen <
> [email protected]> wrote:
>
>> The current Axiom trunk (which will soon be released as Axiom 1.2.9),
>> there are a couple of utility classes that can be used for that. See
>> the org.apache.axiom.util.blob package, more specifically OverflowBlob
>> and BlobDataSource. Note that this stuff is new in Axiom and will be
>> reviewed before the 1.2.9 release. Thus the API may still change in
>> the next couple of days.
>>
>> Andreas
>>
>> On Fri, May 14, 2010 at 20:43, Vishwal Shah <[email protected]>
>> wrote:
>> > Thanks Andreas. Is there an alternative API in Axis2 that i can use ?
>> >
>> >
>> > Thanks,
>> > Vish
>> >
>> >
>> > On Fri, May 14, 2010 at 11:17 AM, Andreas Veithen
>> > <[email protected]> wrote:
>> >>
>> >> You should not use InputStreamDataSource. This code should never have
>> >> been included in Axis2 because it is not a valid DataSource
>> >> implementation [1].
>> >>
>> >> Andreas
>> >>
>> >> [1] http://markmail.org/message/q34d4hxahdlsefob
>> >>
>> >> On Fri, May 14, 2010 at 19:17, Vishwal Shah <[email protected]>
>> wrote:
>> >> > Hi,
>> >> > My Application receives a Http Post from another web application
>> which
>> >> > sends
>> >> > ~150mgs of data, i need to take that data and create a DataHandler
>> >> > (MTOM)
>> >> > and make a webservice call to another webapp. Its kind of pass
>> through.
>> >> > i
>> >> > cannot copy that data onto any drive, it needs to create a
>> DataHandler
>> >> > from
>> >> > the inputstream received from HttpRequest. I tried using
>> >> >
>> >> > import org.apache.axis2.builder.unknowncontent.InputStreamDataSource;
>> >> >
>> >> > InputStreamDataSource ds = new
>> >> > InputStreamDataSource(request.getInputStream());
>> >> > DataHandler dh = new DatHandler(ds);
>> >> >
>> >> > This doesn't seem to be working for me.
>> >> >
>> >> >
>> >> > Thanks,
>> >> > Vish
>> >> >
>> >> >
>> >> >
>> >> > On Thu, May 13, 2010 at 1:37 PM, Martin Gainty <[email protected]>
>> >> > wrote:
>> >> >>
>> >> >> the most prevelant input source is OMSource which extends
>> >> >> org.xml.sax.InputSource defined here:
>> >> >>
>> >> >> package org.apache.axiom.om.impl.jaxp;
>> >> >> import javax.xml.transform.sax.SAXSource;
>> >> >> import org.apache.axiom.om.OMElement;
>> >> >> import org.apache.axiom.om.impl.serialize.OMXMLReader;
>> >> >> import org.xml.sax.InputSource;
>> >> >>
>> >> >> /**
>> >> >>  * Implementation of {...@link javax.xml.transform.Source} for AXIOM.
>> >> >>  * The implementation is based on {...@link SAXSource} and directly
>> >> >> transforms an AXIOM
>> >> >>  * tree into a stream of SAX events using {...@link OMXMLReader}.
>> >> >>  * <p>
>> >> >>  * Note that {...@link org.apache.axiom.om.OMDocType} nodes are not
>> >> >> supported
>> >> >> and will be
>> >> >>  * silently skipped.
>> >> >>  */
>> >> >> public class OMSource extends SAXSource {
>> >> >>     public OMSource(OMElement element) {
>> >> >>         super(new OMXMLReader(element), new InputSource());
>> >> >>     }
>> >> >> }
>> >> >>
>> >> >> perhaps if you could display your definition(s) of
>> >> >> InputStreamDatasource
>> >> >> class
>> >> >> we could better suggest an implementation which will accomodate your
>> >> >> needs
>> >> >>
>> >> >> Martin
>> >> >> ______________________________________________
>> >> >> Verzicht und Vertraulichkeitanmerkung
>> >> >>
>> >> >> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>> >> >> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
>> >> >> unbefugte
>> >> >> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
>> >> >> Nachricht
>> >> >> dient lediglich dem Austausch von Informationen und entfaltet keine
>> >> >> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit
>> von
>> >> >> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> ________________________________
>> >> >> Date: Thu, 13 May 2010 12:01:41 -0700
>> >> >> Subject: Re: InputStream to DataSource In Axis2
>> >> >> From: [email protected]
>> >> >> To: [email protected]
>> >> >>
>> >> >> Anyone? Any help would be greatly appreciated. i cant write it to a
>> >> >> drive,
>> >> >> it has to be an in memory conversion.
>> >> >>
>> >> >>
>> >> >> -Vish
>> >> >>
>> >> >> On Thu, May 13, 2010 at 8:56 AM, Vishwal Shah <
>> [email protected]>
>> >> >> wrote:
>> >> >>
>> >> >> Hi,
>> >> >> Is there any Datasource inbuilt into Axis2 which can take
>> >> >> Inputstream(Large data, almost 200 megs) ? I tried using
>> >> >> InputStreamDataSource, but for some reason i am getting an error and
>> i
>> >> >> have
>> >> >> been reading about issues using InputStreamDatasource. Also, i am
>> not
>> >> >> sure
>> >> >> if it can handle large data (the MTOM way). Any help would be
>> greatly
>> >> >> appreciated
>> >> >>
>> >> >>
>> >> >> Thanks,
>> >> >> Vish
>> >> >>
>> >> >> ________________________________
>> >> >> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars
>> >> >> with
>> >> >> Hotmail. Get busy.
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [email protected]
>> >> For additional commands, e-mail: [email protected]
>> >>
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

Reply via email to