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 Laurent CELLA <la...@inexbee.com> on 2006/05/22 18:19:45 UTC

Release 1.0 How to disable MTOM

Hi Dear Axis Users.

I Have tested the sample given in AXIS 2 rel 1.0 :  MTOMService / 
imagetransfer
-> the client let us select a file, name it and post to the server.
-> the server is a MTOM implementation.

It works perfectly.

So, I modified a bit the Server Sample to handles in SOAP with 
attachments. found in the user guide in this url
http://ws.apache.org/axis2/1_0/mtom-guide.html
Then I Used the client again, but targeting my modified service instead.

This sample is supposed to return us an instance of class Attachments 
linking to attachments retrieved on mime.
The result is null.

When i log the OMElement received by the method, it looks like it is the 
MTOM way
( my attachment is contained in a XML node ).

It looks like exactly as my service was configured to be implemented 
with MTOM pattern.
Where to configure my service in order it to function the SWA way ?

I had no axis2.xml present. Is it a default behaviour that would make 
MTOM by default in AXIS 2 rel 1.0 ?

My Server code modification consisted in what is following ( only to 
make my method match the mtomSample element )

  public void setOperationContext(OperationContext oc) throws AxisFault {
        msgcts = 
oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    }
      
    public OMElement mtomSample(OMElement omEle) throws Exception {
        
        System.out.println("here we are! " + omEle.toString());     // 
MTOM like xml ( attachments by value )
        Attachments attachment = (Attachments) 
msgcts.getProperty(MTOMConstants.ATTACHMENTS);

        System.out.println("attachment=" + attachment ); // null returned.

       ....
      
          omEle.detach();
          omEle.build();
          return omEle;
    }
 
Thanks alot for the time you have taken to read this mail.

Laurent CELLA
Inexbee Software




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


Re: Release 1.0 How to disable MTOM

Posted by Thilina Gunarathne <cs...@gmail.com>.
See my comments below...

 >On 5/22/06, Laurent CELLA <la...@inexbee.com> wrote:
>
> This sample is supposed to return us an instance of class Attachments
> linking to attachments retrieved on mime.
> The result is null.
>
> When i log the OMElement received by the method, it looks like it is the
> MTOM way
> ( my attachment is contained in a XML node ).


MTOM is backward compatible with SwA. So we use MTOM to send SwA messages.

It looks like exactly as my service was configured to be implemented
> with MTOM pattern.
> Where to configure my service in order it to function the SWA way ?


Receiving of attachments will not be affected by any configurations.
MTOM/SwA/non-optimised will be auto detected by Axis2 based on the
content-type, and will be decoded accordingly.

I had no axis2.xml present. Is it a default behaviour that would make
> MTOM by default in AXIS 2 rel 1.0 ?
>
> My Server code modification consisted in what is following ( only to
> make my method match the mtomSample element )
>
> public void setOperationContext(OperationContext oc) throws AxisFault {
>        msgcts =
> oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
>    }


*Change this to MESSAGE_LABEL_IN_VALUE*
**
HTH,
~Thilina

   public OMElement mtomSample(OMElement omEle) throws Exception {
>
>        System.out.println("here we are! " + omEle.toString());     //
> MTOM like xml ( attachments by value )
>        Attachments attachment = (Attachments)
> msgcts.getProperty(MTOMConstants.ATTACHMENTS);
>
>        System.out.println("attachment=" + attachment ); // null returned.
>
>       ....
>
>          omEle.detach();
>          omEle.build();
>          return omEle;
>    }
>
> Thanks alot for the time you have taken to read this mail.
>
> Laurent CELLA
> Inexbee Software
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
"May the SourcE be with u"
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
http://www.bloglines.com/blog/Thilina