Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: add two integers using using c#.NET (with sample code) Pin
Luc Pattyn10-Jan-07 8:33
sitebuilderLuc Pattyn10-Jan-07 8:33 
GeneralRe: add two integers using using c#.NET (with sample code) Pin
szukuro10-Jan-07 10:57
szukuro10-Jan-07 10:57 
GeneralRe: add two integers using using c#.NET (with sample code) Pin
Alaric_10-Jan-07 11:26
professionalAlaric_10-Jan-07 11:26 
GeneralRe: add two integers using using c#.NET (with sample code) Pin
Glen Harvy10-Jan-07 13:34
Glen Harvy10-Jan-07 13:34 
Questiondll Pin
raju_net18189-Jan-07 23:47
raju_net18189-Jan-07 23:47 
AnswerRe: dll Pin
Stefan Troschuetz9-Jan-07 23:52
Stefan Troschuetz9-Jan-07 23:52 
QuestionProblem with a configuration file [modified] Pin
Tania-chan9-Jan-07 23:33
Tania-chan9-Jan-07 23:33 
QuestionAsynchronous Webservice call and abort Pin
Jens Meyer9-Jan-07 23:25
Jens Meyer9-Jan-07 23:25 
Hi,

i need to make a call to a webservice and in addition abort this call if the response exeeds some specific time. I want to do this because i have to provide a method to the user which returns a value from a webservice through this method not through some callbackevent. This way i decided that it would be a good way to wrap the call to the service in a method, wait for the response (or a specific time, whatever comes first) and return the value to the user.

What i have done so far is that i make a call to XXXAsync, hooked up to the return event and set a flag that the webservice responded. In the method called by the user a wait for this flag to be set to true or a specific time, but somehow the webservice return event never fires. If i remove the waiting loop everything works fine.

Here is some sample code of the method i want to wrapt the webservice call in:

<br />
public float FaceImageQuality(Image faceImage)<br />
        {<br />
            this.retrievedFaceQuality = -10;<br />
            this.faceQualityCheckReturned = false;<br />
            fvws.FaceQualityAsync(ImageToByteArr(faceImage));<br />
            int localCounter = 0;<br />
            while (localCounter < this.maxWaitTime || this.faceQualityCheckReturned)<br />
            {<br />
                localCounter++;<br />
                Thread.Sleep(100);<br />
            }<br />
            if (!this.faceQualityCheckReturned && localCounter >= this.maxWaitTime)<br />
                throw new Exception(String.Format(this.webServiceDidNotResponded, (this.maxWaitTime * 10), "FaceImageQuality"));<br />
            return this.retrievedFaceQuality;<br />
        }<br />
<br />
private void fvws_FaceQualityCompleted(object sender, FaceValidationClass.FaceValidationWebService.FaceQualityCompletedEventArgs e)<br />
        {<br />
            this.retrievedFaceQuality = e.Result;<br />
            this.faceQualityCheckReturned = true;<br />
        }<br />



When i remove the Thread.Sleep call and the loop off the code the event fires, but only after the method is left.

Does anyone knows a way to solve this?

Best regards

Jens
QuestionHow to get HTML source of Webpage in C# ? Pin
Supriya Tonape9-Jan-07 22:45
Supriya Tonape9-Jan-07 22:45 
AnswerRe: How to get HTML source of Webpage in C# ? Pin
Ravi Bhavnani10-Jan-07 2:27
professionalRavi Bhavnani10-Jan-07 2:27 
GeneralRe: How to get HTML source of Webpage in C# ? Pin
Supriya Tonape10-Jan-07 2:46
Supriya Tonape10-Jan-07 2:46 
QuestionC# and Games Pin
kbalias9-Jan-07 22:43
kbalias9-Jan-07 22:43 
AnswerRe: C# and Games Pin
J4amieC9-Jan-07 22:53
J4amieC9-Jan-07 22:53 
AnswerRe: C# and Games Pin
Pete O'Hanlon9-Jan-07 22:55
mvePete O'Hanlon9-Jan-07 22:55 
AnswerRe: C# and Games Pin
Colin Angus Mackay9-Jan-07 23:16
Colin Angus Mackay9-Jan-07 23:16 
AnswerRe: C# and Games Pin
Christian Graus9-Jan-07 23:29
protectorChristian Graus9-Jan-07 23:29 
GeneralRe: C# and Games Pin
Pete O'Hanlon9-Jan-07 23:36
mvePete O'Hanlon9-Jan-07 23:36 
Questionbarcode generator Pin
cellardoor07169-Jan-07 22:36
cellardoor07169-Jan-07 22:36 
AnswerRe: barcode generator Pin
Christian Graus9-Jan-07 22:52
protectorChristian Graus9-Jan-07 22:52 
GeneralRe: barcode generator Pin
cellardoor07169-Jan-07 22:58
cellardoor07169-Jan-07 22:58 
GeneralRe: barcode generator Pin
Christian Graus9-Jan-07 23:30
protectorChristian Graus9-Jan-07 23:30 
GeneralRe: barcode generator Pin
cellardoor07169-Jan-07 23:37
cellardoor07169-Jan-07 23:37 
GeneralRe: barcode generator Pin
GaryWoodfine 10-Jan-07 5:36
professionalGaryWoodfine 10-Jan-07 5:36 
AnswerRe: barcode generator Pin
Luc Pattyn10-Jan-07 8:46
sitebuilderLuc Pattyn10-Jan-07 8:46 
Questionusercontrol property Pin
Marc Soleda9-Jan-07 22:32
Marc Soleda9-Jan-07 22:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.