Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Timeout for method in service

 
 
Thread Tools Display Modes
Old 02-06-2007   #1 (permalink)
ottogbg
Guest


 

Timeout for method in service

I have a service (InstanceContextMode.Single) that has a couple of methods
accessible through a basicHttpBinding in WCF.

One of these methods is a "receive"-methods" which checks for new messages.
The method loops until a new message is ready, and then returns this message.

A TimeoutException is thrown when the client has waited for more than 1
minute (default value) for the receive-method to return. Each time that the
exception has been caught, the client calls the same method again.

The problem is that the method in the service keeps running, and will return
when a new message arrives, but the client never receives it.

So, is it possible to stop the execution of the method in the service if the
client has timed out, i.e. have them both time out after the same period of
time?
Old 02-06-2007   #2 (permalink)
MobileMan
Guest


 

RE: Timeout for method in service

The simple answer to your question is "yes," but without knowing more about
what your application does my first question would be "is this the best
architecture?"

Is your client waiting to receive messages from your service, that are sent
to the service from some other process or method?

For example, your client is waiting to be notified that MSFT stock has hit a
specified value, and when that occurs your service will send the message to
the client.

Dumb example, but if this the general idea then you might want to consider a
publish & subscribe design, or possibly one-way calls instead.

Tell me more ..........
--
Stay Mobile


"ottogbg" wrote:

> I have a service (InstanceContextMode.Single) that has a couple of methods
> accessible through a basicHttpBinding in WCF.
>
> One of these methods is a "receive"-methods" which checks for new messages.
> The method loops until a new message is ready, and then returns this message.
>
> A TimeoutException is thrown when the client has waited for more than 1
> minute (default value) for the receive-method to return. Each time that the
> exception has been caught, the client calls the same method again.
>
> The problem is that the method in the service keeps running, and will return
> when a new message arrives, but the client never receives it.
>
> So, is it possible to stop the execution of the method in the service if the
> client has timed out, i.e. have them both time out after the same period of
> time?

Old 02-06-2007   #3 (permalink)
Mariano Omar Rodriguez
Guest


 

Re: Timeout for method in service

It will be a better solution to make a contrack with a callback.

"ottogbg" <ottogbg@discussions.microsoft.com> wrote in message
news:7D543D0B-118F-4859-925D-BB61C3A80B64@microsoft.com...
>I have a service (InstanceContextMode.Single) that has a couple of methods
> accessible through a basicHttpBinding in WCF.
>
> One of these methods is a "receive"-methods" which checks for new
> messages.
> The method loops until a new message is ready, and then returns this
> message.
>
> A TimeoutException is thrown when the client has waited for more than 1
> minute (default value) for the receive-method to return. Each time that
> the
> exception has been caught, the client calls the same method again.
>
> The problem is that the method in the service keeps running, and will
> return
> when a new message arrives, but the client never receives it.
>
> So, is it possible to stop the execution of the method in the service if
> the
> client has timed out, i.e. have them both time out after the same period
> of
> time?


Old 02-07-2007   #4 (permalink)
Arkady Frenkel
Guest


 

Re: Timeout for method in service

Add another method Stop() which you call on the service before client gone
so it will case your service stop to check messages and Start() for v.v
operation
Arkady

"ottogbg" <ottogbg@discussions.microsoft.com> wrote in message
news:7D543D0B-118F-4859-925D-BB61C3A80B64@microsoft.com...
>I have a service (InstanceContextMode.Single) that has a couple of methods
> accessible through a basicHttpBinding in WCF.
>
> One of these methods is a "receive"-methods" which checks for new
> messages.
> The method loops until a new message is ready, and then returns this
> message.
>
> A TimeoutException is thrown when the client has waited for more than 1
> minute (default value) for the receive-method to return. Each time that
> the
> exception has been caught, the client calls the same method again.
>
> The problem is that the method in the service keeps running, and will
> return
> when a new message arrives, but the client never receives it.
>
> So, is it possible to stop the execution of the method in the service if
> the
> client has timed out, i.e. have them both time out after the same period
> of
> time?



Old 02-07-2007   #5 (permalink)
ottogbg
Guest


 

Re: Timeout for method in service

"MobileMan" wrote:
> The simple answer to your question is "yes," but without knowing more about
> what your application does my first question would be "is this the best
> architecture?"
>
> Is your client waiting to receive messages from your service, that are sent
> to the service from some other process or method?
>
> For example, your client is waiting to be notified that MSFT stock has hit a
> specified value, and when that occurs your service will send the message to
> the client.
>
> Dumb example, but if this the general idea then you might want to consider a
> publish & subscribe design, or possibly one-way calls instead.
>
> Tell me more ..........


True, that is basically the concept. See below.

"Mariano Omar Rodriguez" wrote:
> It will be a better solution to make a contrack with a callback.


I have considered callbacks, and it does the work really well, the problem
is compability with WS-clients. I have not been able to consume a
wsDualHttpBinding in a Java client. That is why I have this design.

"Arkady Frenkel" wrote:
> Add another method Stop() which you call on the service before client gone
> so it will case your service stop to check messages and Start() for v.v
> operation
> Arkady


That can work, although the callback approach would work.

Thanks!
Old 02-07-2007   #6 (permalink)
Mariano Omar Rodriguez
Guest


 

Re: Timeout for method in service

Then, I believe that you could use another WebMethod that making poolling
reports the status of the complition of the task.


"ottogbg" <ottogbg@discussions.microsoft.com> wrote in message
news:8BD8C6EF-C8FB-4B86-A5D5-34D3426BE61E@microsoft.com...
> "MobileMan" wrote:
>> The simple answer to your question is "yes," but without knowing more
>> about
>> what your application does my first question would be "is this the best
>> architecture?"
>>
>> Is your client waiting to receive messages from your service, that are
>> sent
>> to the service from some other process or method?
>>
>> For example, your client is waiting to be notified that MSFT stock has
>> hit a
>> specified value, and when that occurs your service will send the message
>> to
>> the client.
>>
>> Dumb example, but if this the general idea then you might want to
>> consider a
>> publish & subscribe design, or possibly one-way calls instead.
>>
>> Tell me more ..........

>
> True, that is basically the concept. See below.
>
> "Mariano Omar Rodriguez" wrote:
>> It will be a better solution to make a contrack with a callback.

>
> I have considered callbacks, and it does the work really well, the problem
> is compability with WS-clients. I have not been able to consume a
> wsDualHttpBinding in a Java client. That is why I have this design.
>
> "Arkady Frenkel" wrote:
>> Add another method Stop() which you call on the service before client
>> gone
>> so it will case your service stop to check messages and Start() for v.v
>> operation
>> Arkady

>
> That can work, although the callback approach would work.
>
> Thanks!


 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling service restart timeout with WMI Bob Smith VB Script 1 1 Week Ago 06:47 PM
Method invocation failed because [System.String] doesn't contain a method B Williams PowerShell 0 03-31-2008 06:00 PM
Windows Service Timeout in Vista Dapo Onawole Vista General 0 01-18-2007 11:50 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50