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 Sean Doyle <sd...@gmail.com> on 2006/07/12 10:05:13 UTC

How to set MTOM options in WSDL-generated stubs?

I've created a WSDL, run it through WSDL2Java, and I wrote some simple JUnit
tests that transfer files over the interface. But - now I'd like to optimize
the sending of the files in the client (on the server side MTOM is enabled).

>From the example at http://ws.apache.org/axis2/1_0/mtom-guide.html I see
that I should set ENABLE_MTOM to true

  ServiceClient serviceClient = new ServiceClient ();
  Options options = new Options();
  options.setTo(targetEPR);
  options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
  serviceClient .setOptions(options);

But - I don't see how to use this object on the stub files generated by
WSDL2Java. I can copy the code from the stub (basically the contents of
populateAxisService() to return a AxisService object, create a new
ServiceClient with the AxisService object, then set the stub's ServiceClient
to this new value.

The net result is that everything works fine now but extremely slowly.
Sending between two processes on the same machine hits a limit of around
180K/second - over a order of magnitude slower than what I was expecting
(I'm sending files that are around 3MB in size). I'm running this on a new
Macbook Pro - everything else is quite zippy.

So - if I want speed I think there are two alternatives:
1) Someone will point out the magic combination of API calls to enable MTOM
with my generated code - or
2) If this is just a client-side problem - perhaps I code up a  OMElement
interface on the client side to set the ENABLE_MTOM parameter to be TRUE?

Other suggestions welcomed :-)

Thanks...

Sean

Re: How to set MTOM options in WSDL-generated stubs?

Posted by Michael Meire <mi...@cs.kuleuven.be>.
Hi,

I'm using the xmlbeans data binding for this...  Or does it perhaps only 
work for ADB data binding?
If you would have a sample that is working for you, I could maybe try 
that one out first?


thanks in advance
kind regards,
Michael Meire


On 10/28/06 04:08, Thilina Gunarathne wrote:

> Hmm... I was working well for me... I'm even setting up a new sample
> based on this..
>
> If it's not working please reopen the JIRA... What is the data binding
> mechanism you are using..
>
> ~Thilina
>
> On 10/27/06, Michael Meire <mi...@cs.kuleuven.be> wrote:
>
>> Hi,
>>
>> I've been spending some time on this issue a few times. I had submitted
>> a axis2 bug report about that
>> (http://issues.apache.org/jira/browse/AXIS2-513?page=all) and somewhere
>> in August, a message was posted there that it is fixed.
>> Today, I downloaded the latest nightly build, and tried it again,
>> however without success.
>> What I did was:
>>
>>    * generate stubs and skeletons
>>    * Based on the explanation in the mtom guide, in the generated
>>      abcStub class, I added the following in the constructor:
>>      
>> _serviceClient.getOptions().setProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM, 
>>
>>      org.apache.axis2.Constants.VALUE_TRUE);
>>
>> However, still no MTOM is used...
>>
>> Did anybody experience more success on this?
>>
>> thanks,
>> Michael...
>>
>>
>>
>> On 07/12/06 10:05, Sean Doyle wrote:
>>
>> > I've created a WSDL, run it through WSDL2Java, and I wrote some simple
>> > JUnit tests that transfer files over the interface. But - now I'd like
>> > to optimize the sending of the files in the client (on the server side
>> > MTOM is enabled).
>> >
>> > From the example at http://ws.apache.org/axis2/1_0/mtom-guide.html I
>> > see that I should set ENABLE_MTOM to true
>> >
>> >  ServiceClient serviceClient = new ServiceClient ();
>> >
>> >  Options options = new Options();
>> >  options.setTo(targetEPR);
>> >  options.setProperty(Constants.Configuration.ENABLE_MTOM, 
>> Constants.VALUE_TRUE);
>> >  serviceClient .setOptions(options);
>> >
>> > But - I don't see how to use this object on the stub files generated
>> > by WSDL2Java. I can copy the code from the stub (basically the
>> > contents of populateAxisService() to return a AxisService object,
>> > create a new ServiceClient with the AxisService object, then set the
>> > stub's ServiceClient to this new value.
>> >
>> > The net result is that everything works fine now but extremely slowly.
>> > Sending between two processes on the same machine hits a limit of
>> > around 180K/second - over a order of magnitude slower than what I was
>> > expecting (I'm sending files that are around 3MB in size). I'm running
>> > this on a new Macbook Pro - everything else is quite zippy.
>> >
>> > So - if I want speed I think there are two alternatives:
>> > 1) Someone will point out the magic combination of API calls to enable
>> > MTOM with my generated code - or
>> > 2) If this is just a client-side problem - perhaps I code up a
>> > OMElement interface on the client side to set the ENABLE_MTOM
>> > parameter to be TRUE?
>> >
>> > Other suggestions welcomed :-)
>> >
>> > Thanks...
>> >
>> > Sean
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: How to set MTOM options in WSDL-generated stubs?

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hmm... I was working well for me... I'm even setting up a new sample
based on this..

If it's not working please reopen the JIRA... What is the data binding
mechanism you are using..

~Thilina

On 10/27/06, Michael Meire <mi...@cs.kuleuven.be> wrote:
> Hi,
>
> I've been spending some time on this issue a few times. I had submitted
> a axis2 bug report about that
> (http://issues.apache.org/jira/browse/AXIS2-513?page=all) and somewhere
> in August, a message was posted there that it is fixed.
> Today, I downloaded the latest nightly build, and tried it again,
> however without success.
> What I did was:
>
>    * generate stubs and skeletons
>    * Based on the explanation in the mtom guide, in the generated
>      abcStub class, I added the following in the constructor:
>      _serviceClient.getOptions().setProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM,
>      org.apache.axis2.Constants.VALUE_TRUE);
>
> However, still no MTOM is used...
>
> Did anybody experience more success on this?
>
> thanks,
> Michael...
>
>
>
> On 07/12/06 10:05, Sean Doyle wrote:
>
> > I've created a WSDL, run it through WSDL2Java, and I wrote some simple
> > JUnit tests that transfer files over the interface. But - now I'd like
> > to optimize the sending of the files in the client (on the server side
> > MTOM is enabled).
> >
> > From the example at http://ws.apache.org/axis2/1_0/mtom-guide.html I
> > see that I should set ENABLE_MTOM to true
> >
> >  ServiceClient serviceClient = new ServiceClient ();
> >
> >  Options options = new Options();
> >  options.setTo(targetEPR);
> >  options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
> >  serviceClient .setOptions(options);
> >
> > But - I don't see how to use this object on the stub files generated
> > by WSDL2Java. I can copy the code from the stub (basically the
> > contents of populateAxisService() to return a AxisService object,
> > create a new ServiceClient with the AxisService object, then set the
> > stub's ServiceClient to this new value.
> >
> > The net result is that everything works fine now but extremely slowly.
> > Sending between two processes on the same machine hits a limit of
> > around 180K/second - over a order of magnitude slower than what I was
> > expecting (I'm sending files that are around 3MB in size). I'm running
> > this on a new Macbook Pro - everything else is quite zippy.
> >
> > So - if I want speed I think there are two alternatives:
> > 1) Someone will point out the magic combination of API calls to enable
> > MTOM with my generated code - or
> > 2) If this is just a client-side problem - perhaps I code up a
> > OMElement interface on the client side to set the ENABLE_MTOM
> > parameter to be TRUE?
> >
> > Other suggestions welcomed :-)
> >
> > Thanks...
> >
> > Sean
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
http://webservices.apache.org/~thilina/
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: How to set MTOM options in WSDL-generated stubs?

Posted by Michael Meire <mi...@cs.kuleuven.be>.
Hi,

I've been spending some time on this issue a few times. I had submitted 
a axis2 bug report about that 
(http://issues.apache.org/jira/browse/AXIS2-513?page=all) and somewhere 
in August, a message was posted there that it is fixed.
Today, I downloaded the latest nightly build, and tried it again, 
however without success.
What I did was:

    * generate stubs and skeletons
    * Based on the explanation in the mtom guide, in the generated
      abcStub class, I added the following in the constructor:
      _serviceClient.getOptions().setProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM,
      org.apache.axis2.Constants.VALUE_TRUE);

However, still no MTOM is used...

Did anybody experience more success on this?

thanks,
Michael...



On 07/12/06 10:05, Sean Doyle wrote:

> I've created a WSDL, run it through WSDL2Java, and I wrote some simple 
> JUnit tests that transfer files over the interface. But - now I'd like 
> to optimize the sending of the files in the client (on the server side 
> MTOM is enabled).
>
> From the example at http://ws.apache.org/axis2/1_0/mtom-guide.html I 
> see that I should set ENABLE_MTOM to true
>
>  ServiceClient serviceClient = new ServiceClient ();
>
>  Options options = new Options();
>  options.setTo(targetEPR);
>  options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
>  serviceClient .setOptions(options);
>
> But - I don't see how to use this object on the stub files generated 
> by WSDL2Java. I can copy the code from the stub (basically the 
> contents of populateAxisService() to return a AxisService object, 
> create a new ServiceClient with the AxisService object, then set the 
> stub's ServiceClient to this new value.
>
> The net result is that everything works fine now but extremely slowly. 
> Sending between two processes on the same machine hits a limit of 
> around 180K/second - over a order of magnitude slower than what I was 
> expecting (I'm sending files that are around 3MB in size). I'm running 
> this on a new Macbook Pro - everything else is quite zippy.
>
> So - if I want speed I think there are two alternatives:
> 1) Someone will point out the magic combination of API calls to enable 
> MTOM with my generated code - or
> 2) If this is just a client-side problem - perhaps I code up a  
> OMElement interface on the client side to set the ENABLE_MTOM 
> parameter to be TRUE?
>
> Other suggestions welcomed :-)
>
> Thanks...
>
> Sean


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