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 Bing Li <lb...@gmail.com> on 2011/03/14 21:22:22 UTC

Any Limits on Invocation Frequency?

Dear all,

I tried to call published Web services. It worked fine. However, when
invoking one service in more than two times continuously, the client got
timeout exceptions from the 3rd one. Each invocation should be done very
quickly. It should not wait for so long time. I guess there must be some
limits on the invocation frequency? How to enlarge it?

Thanks so much!
LB

Re: Any Limits on Invocation Frequency?

Posted by Bing Li <lb...@gmail.com>.
Dear Ron,

The reason that I set up the timeout is that one of my service takes a long
time, about 67 seconds. After setting the timeout, the client does not get
exceptions for the long invocation.

If I called the service in the following way, only the first two are
executed. The server did not crash at all. From the 3rd one, timeout
exceptions are generated. But the problem is solved if the line,
serviceClient.cleanupTransport is added after the invocation.

        CategorizedHubClient.Print();
        CategorizedHubClient.Print();
        CategorizedHubClient.Print();
        CategorizedHubClient.Print();
        CategorizedHubClient.Print();
        CategorizedHubClient.Print();
        CategorizedHubClient.Print();

Thanks so much!
LB

On Wed, Mar 16, 2011 at 12:25 AM, Ron Wheeler <
rwheeler@artifact-software.com> wrote:

>  Why did it timeout?
> What did you see in the logs.
> Did the service crash?
> How long did the client wait before timing out?
>
> As far as we have seen, you can call web services as fast as it can service
> the request.
>
> Ron
>
>
> On 15/03/2011 11:17 AM, Bing Li wrote:
>
> Dear all,
>
> Anyone could answer this question?
>
> Your help is highly appreciated!
>
> LB
>
> On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lb...@gmail.com> wrote:
>
>> Dear all,
>>
>> I tried to call published Web services. It worked fine. However, when
>> invoking one service in more than two times continuously, the client got
>> timeout exceptions from the 3rd one. Each invocation should be done very
>> quickly. It should not wait for so long time. I guess there must be some
>> limits on the invocation frequency? How to enlarge it?
>>
>> Thanks so much!
>> LB
>>
>
>
>

Re: Any Limits on Invocation Frequency?

Posted by Ron Wheeler <rw...@artifact-software.com>.
Why did it timeout?
What did you see in the logs.
Did the service crash?
How long did the client wait before timing out?

As far as we have seen, you can call web services as fast as it can 
service the request.

Ron

On 15/03/2011 11:17 AM, Bing Li wrote:
> Dear all,
>
> Anyone could answer this question?
>
> Your help is highly appreciated!
>
> LB
>
> On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lblabs@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Dear all,
>
>     I tried to call published Web services. It worked fine. However,
>     when invoking one service in more than two times continuously, the
>     client got timeout exceptions from the 3rd one. Each invocation
>     should be done very quickly. It should not wait for so long time.
>     I guess there must be some limits on the invocation frequency? How
>     to enlarge it?
>
>     Thanks so much!
>     LB
>
>


Re: Any Limits on Invocation Frequency?

Posted by Bing Li <lb...@gmail.com>.
Dear Deepal,

I appreciate so much for your help! After adding the line,
serviceClient.cleanupTransport, no timeout exceptions are thrown.

But, I wonder if there are any overheads in the HTTP level for the cleanup?

Best wishes,
LB

On Tue, Mar 15, 2011 at 11:21 PM, Deepal Jayasinghe <de...@opensource.lk>wrote:

>  Hi,
>
> Axis2 does not have any such limitation, if you are using same service
> client for all the invocation then after each invocation try to call
> servciceClient.cleanupTransport method. Or if possible share your client
> code with us.
>
> Deepal
>
>
> On 3/15/2011 11:17 AM, Bing Li wrote:
>
> Dear all,
>
> Anyone could answer this question?
>
> Your help is highly appreciated!
>
> LB
>
> On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lb...@gmail.com> wrote:
>
>> Dear all,
>>
>> I tried to call published Web services. It worked fine. However, when
>> invoking one service in more than two times continuously, the client got
>> timeout exceptions from the 3rd one. Each invocation should be done very
>> quickly. It should not wait for so long time. I guess there must be some
>> limits on the invocation frequency? How to enlarge it?
>>
>> Thanks so much!
>> LB
>>
>
>

Re: Any Limits on Invocation Frequency?

Posted by Deepal Jayasinghe <de...@opensource.lk>.
When you have a inout operation at the server side you should use the
client.|sendReceive| or |sc.sendReceiveNonBlocking|. The operation
invokeRobust is used when web service operation is void and you would
like to see when something went wrong (e.g., an exception). So, to solve
your problem I would suggest to use sendReceive operation of the service
client.

Deepal

3/15/2011 12:05 PM, Bing Li wrote:
> Dear Deepal,
>
> Thanks so much for your help! I will try your code. The code that got
> timeout exceptions is as follows.
>
> The client:
>
>     .....
>     public static boolean Print()
>     {
>         try
>         {
>             RPCServiceClient serviceClient = new RPCServiceClient();
>             Options options = serviceClient.getOptions();
>             options.setTimeOutInMilliSeconds(Constants.HTTP_TIMEOUT);
>             EndpointReference targetEPR = new
> EndpointReference(Constants.CATEGORIZED_HUB_SERVICE_ENDPOINT);
>             options.setTo(targetEPR);
>             QName shutdownDB = new
> QName(Constants.GREATFREE_NAMESPACE, Constants.PRINT);
>             Object[] shutdownDBArgs = new Object[] {};
>             serviceClient.invokeRobust(shutdownDB, shutdownDBArgs);
>             return true;
>         }
>         catch (AxisFault e)
>         {
>             e.printStackTrace();
>             return false;
>         }
>         catch (Exception e)
>         {
>             e.printStackTrace();
>             return false;
>         }
>     }
>     ......
>
> The server code is very simple and it is implemented by POJO.
>
>     public String Print()
>     {
>         System.out.println("Hello World!");
>         return "How do you do?";
>     }
>
> Moreover, I noticed that when the return value of the server side is
> changed to void, no timeout exceptions were raised. It is weird!
>
> Thanks again!
> LB
>
>
> On Tue, Mar 15, 2011 at 11:21 PM, Deepal Jayasinghe
> <deepal@opensource.lk <ma...@opensource.lk>> wrote:
>
>     Hi,
>
>     Axis2 does not have any such limitation, if you are using same
>     service client for all the invocation then after each invocation
>     try to call servciceClient.cleanupTransport method. Or if possible
>     share your client code with us.
>
>     Deepal
>
>
>     On 3/15/2011 11:17 AM, Bing Li wrote:
>>     Dear all,
>>
>>     Anyone could answer this question?
>>
>>     Your help is highly appreciated!
>>
>>     LB
>>
>>     On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lblabs@gmail.com
>>     <ma...@gmail.com>> wrote:
>>
>>         Dear all,
>>
>>         I tried to call published Web services. It worked fine.
>>         However, when invoking one service in more than two times
>>         continuously, the client got timeout exceptions from the 3rd
>>         one. Each invocation should be done very quickly. It should
>>         not wait for so long time. I guess there must be some limits
>>         on the invocation frequency? How to enlarge it?
>>
>>         Thanks so much!
>>         LB
>>
>>
>

Re: Any Limits on Invocation Frequency?

Posted by Bing Li <lb...@gmail.com>.
Dear Deepal,

Thanks so much for your help! I will try your code. The code that got
timeout exceptions is as follows.

The client:

    .....
    public static boolean Print()
    {
        try
        {
            RPCServiceClient serviceClient = new RPCServiceClient();
            Options options = serviceClient.getOptions();
            options.setTimeOutInMilliSeconds(Constants.HTTP_TIMEOUT);
            EndpointReference targetEPR = new
EndpointReference(Constants.CATEGORIZED_HUB_SERVICE_ENDPOINT);
            options.setTo(targetEPR);
            QName shutdownDB = new QName(Constants.GREATFREE_NAMESPACE,
Constants.PRINT);
            Object[] shutdownDBArgs = new Object[] {};
            serviceClient.invokeRobust(shutdownDB, shutdownDBArgs);
            return true;
        }
        catch (AxisFault e)
        {
            e.printStackTrace();
            return false;
        }
        catch (Exception e)
        {
            e.printStackTrace();
            return false;
        }
    }
    ......

The server code is very simple and it is implemented by POJO.

    public String Print()
    {
        System.out.println("Hello World!");
        return "How do you do?";
    }

Moreover, I noticed that when the return value of the server side is changed
to void, no timeout exceptions were raised. It is weird!

Thanks again!
LB


On Tue, Mar 15, 2011 at 11:21 PM, Deepal Jayasinghe <de...@opensource.lk>wrote:

>  Hi,
>
> Axis2 does not have any such limitation, if you are using same service
> client for all the invocation then after each invocation try to call
> servciceClient.cleanupTransport method. Or if possible share your client
> code with us.
>
> Deepal
>
>
> On 3/15/2011 11:17 AM, Bing Li wrote:
>
> Dear all,
>
> Anyone could answer this question?
>
> Your help is highly appreciated!
>
> LB
>
> On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lb...@gmail.com> wrote:
>
>> Dear all,
>>
>> I tried to call published Web services. It worked fine. However, when
>> invoking one service in more than two times continuously, the client got
>> timeout exceptions from the 3rd one. Each invocation should be done very
>> quickly. It should not wait for so long time. I guess there must be some
>> limits on the invocation frequency? How to enlarge it?
>>
>> Thanks so much!
>> LB
>>
>
>

Re: Any Limits on Invocation Frequency?

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi,

Axis2 does not have any such limitation, if you are using same service
client for all the invocation then after each invocation try to call
servciceClient.cleanupTransport method. Or if possible share your client
code with us.

Deepal

On 3/15/2011 11:17 AM, Bing Li wrote:
> Dear all,
>
> Anyone could answer this question?
>
> Your help is highly appreciated!
>
> LB
>
> On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lblabs@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Dear all,
>
>     I tried to call published Web services. It worked fine. However,
>     when invoking one service in more than two times continuously, the
>     client got timeout exceptions from the 3rd one. Each invocation
>     should be done very quickly. It should not wait for so long time.
>     I guess there must be some limits on the invocation frequency? How
>     to enlarge it?
>
>     Thanks so much!
>     LB
>
>

Re: Any Limits on Invocation Frequency?

Posted by Bing Li <lb...@gmail.com>.
Dear all,

Anyone could answer this question?

Your help is highly appreciated!

LB

On Tue, Mar 15, 2011 at 4:22 AM, Bing Li <lb...@gmail.com> wrote:

> Dear all,
>
> I tried to call published Web services. It worked fine. However, when
> invoking one service in more than two times continuously, the client got
> timeout exceptions from the 3rd one. Each invocation should be done very
> quickly. It should not wait for so long time. I guess there must be some
> limits on the invocation frequency? How to enlarge it?
>
> Thanks so much!
> LB
>

Re: Any Limits on Invocation Frequency?

Posted by Sanka Samaranayake <ss...@gmail.com>.
You can increase the connection timeout and the try ..  Have a look at
http://wso2.org/library/209

Sanka


On Mon, Mar 14, 2011 at 9:22 PM, Bing Li <lb...@gmail.com> wrote:
> Dear all,
>
> I tried to call published Web services. It worked fine. However, when
> invoking one service in more than two times continuously, the client got
> timeout exceptions from the 3rd one. Each invocation should be done very
> quickly. It should not wait for so long time. I guess there must be some
> limits on the invocation frequency? How to enlarge it?
>
> Thanks so much!
> LB
>



-- 
Sanka Samaranayake

PMC Member, Committer, Apache Software Foundation, http://www.apache.org/

Telephone: +34 677 864358
Email: sanka AT apache DOT org
Blog: http://sankas.blogspot.com/
Linked-in: http://lk.linkedin.com/pub/sanka-samaranayake/4/b2b/3b3

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