Hi,
I have to make multiple calls (about 400K) to a webservice which returns a
string. And currently it takes about a week to make all the calls. Instead of
waiting for the webservice result before i make the next call, I rather want
to make the calls and let the results comeback at its own pace. I used
Asynchronous calling and callback method, but it does not seems to work. I am
sure, asynchronous way will improve my program execution exponentially. I
would appreciate if someone can help me with this. And by the way, i did not
see an Begin and End methods.
Here is my method which is making the webservice calls.
public static Boolean WebServiceCallsXY(string x, string y)
{
try
{
UsernameToken token = new UsernameToken("AAA", "BBB",
PasswordOption.SendPlainText);
MbrSrvWse wseProxy = new MbrSrvWse ();
wseProxy.SetClientCredential<UsernameToken>(token) ;
wseProxy.SetPolicy("ProvideUsernameToken");
IndividualDetailRequest test = new IndividualDetailRequest();
test.UserId = x;
test.Pin = y;
IndividualDetailResponse response =
wseProxy.IndividualDetail(test);
if (response.Result.Length 0)
{
if (response.Result.ToString().ToLower().Equals("a"))
{
return true;
}
if (response.Result.ToString().ToLower().Equals("b"))
{
return false;
}
}
return false;
}
catch (Exception e)
{
Console.WriteLine("The following error '{0}' -------- {1} :
{2} ", e.Message, e.StackTrace, x);
return false;
}
}
--
Kalyan 2 1570
=?Utf-8?B?S2FseWFu?= <Ka****@discussions.microsoft.comwrote in
news:AA**********************************@microsof t.com:
I have to make multiple calls (about 400K) to a webservice which
returns a string. And currently it takes about a week to make all the
calls. Instead of waiting for the webservice result before i make the
next call, I rather want to make the calls and let the results
comeback at its own pace. I used Asynchronous calling and callback
method, but it does not seems to work. I am sure, asynchronous way
will improve my program execution exponentially. I would appreciate if
someone can help me with this. And by the way, i did not see an Begin
and End methods.
Surely you must have a better way ... ???
Do you have access to the developer who built the original web service?
Perhaps you can make a bulk call.
As for asynchronous web services, .NET 2.0 uses events rather than
Begin/End functions.
I don't think VS2005 creates the Begin/End methods for you like VS2003 did.
instead it creates <methodname>Async & <methodname>Completed events.
See http://objectsharp.com/cs/blogs/bruc...0/02/3480.aspx
You can read more on this in the "Asynchronous Tasks" at http://msdn.microsoft.com/msdnmag/is...10/WickedCode/
Good example... http://msdn2.microsoft.com/en-us/lib...sk(VS.80).aspx
"Kalyan" wrote:
Hi,
I have to make multiple calls (about 400K) to a webservice which returns a
string. And currently it takes about a week to make all the calls. Instead of
waiting for the webservice result before i make the next call, I rather want
to make the calls and let the results comeback at its own pace. I used
Asynchronous calling and callback method, but it does not seems to work. I am
sure, asynchronous way will improve my program execution exponentially. I
would appreciate if someone can help me with this. And by the way, i did not
see an Begin and End methods.
Here is my method which is making the webservice calls.
public static Boolean WebServiceCallsXY(string x, string y)
{
try
{
UsernameToken token = new UsernameToken("AAA", "BBB",
PasswordOption.SendPlainText);
MbrSrvWse wseProxy = new MbrSrvWse ();
wseProxy.SetClientCredential<UsernameToken>(token) ;
wseProxy.SetPolicy("ProvideUsernameToken");
IndividualDetailRequest test = new IndividualDetailRequest();
test.UserId = x;
test.Pin = y;
IndividualDetailResponse response =
wseProxy.IndividualDetail(test);
if (response.Result.Length 0)
{
if (response.Result.ToString().ToLower().Equals("a"))
{
return true;
}
if (response.Result.ToString().ToLower().Equals("b"))
{
return false;
}
}
return false;
}
catch (Exception e)
{
Console.WriteLine("The following error '{0}' -------- {1} :
{2} ", e.Message, e.StackTrace, x);
return false;
}
}
--
Kalyan
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Marty McDonald |
last post by:
I create and start several threads, each thread executes the same method -
within the method, a web service is invoked. I find that the more threads I
use, the longer it takes for all of the...
|
by: TC |
last post by:
Hello,
I am making an asynchronous call to a webservice and trying to update the
web page with the results.
The page is not updating.
Does anybody know why???
Below is my code:
|
by: Tim Gallivan |
last post by:
Hello group,
I'm trying to develop a proof of concept webservice which asynchronously
calls a function in a DLL. The function raises an event when it is finished,
and works when used as part of...
|
by: jim |
last post by:
Hi All,
I try to make an asynchronous call to a web service method as below under MS
visual .NET studio 2003:
WebService webSrv = new WebService();
AsyncCallback cb = new...
|
by: SenthilVel |
last post by:
Hi
Can any one let me know how i can perform a Asychronous calll in a web
service ?
or using a thread in Asmx a better solution than the async call ?
pls send me any link to example, where...
|
by: Raymondr |
last post by:
Hi,
First a brief description of out application:
We have a webapplication which calls a couple of webservices during one
request (postback). These calls to the webservices are made concurrent...
|
by: kkao77 |
last post by:
Someone help me please.
I've tried to write an asynchronous method, but it didn't call my web
service, do I need to do something in my webservice project to make it
work?
or if there is...
|
by: Susan |
last post by:
I have a process that takes a while to run so I have it running
asynchronously so that the user can continue working. My question is that I
want to killl the process if the user changes the search...
|
by: sirmoreno |
last post by:
Hi,
In my web site I have some long tasks that I want to call without delaying the page rendering - without making the thread that handels the page request wait for the long task to end.
I...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |