473,666 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asynchronous calls to a web Service

I have a C++ application that consumes a web service. I would like to call
the web service asynchronously so my C++ application can do other processing
in between.
My proxy file does not have any asynchronous methods in it, What do I have
to do to get my proxy file to have the asynchronous methods to call?

Thanks
Nov 21 '05 #1
5 4602
rgarf wrote:
I have a C++ application that consumes a web service. I would like to
call
the web service asynchronously so my C++ application can do other
processing
in between.
My proxy file does not have any asynchronous methods in it, What do I
have
to do to get my proxy file to have the asynchronous methods to call?


How did you generate the proxy? What language is it in? WSDL.exe and WseWsdl2.exe both generate in C#/VB.NET and both definitely generate asyn method pairs per web method. If you generated it by hand in C++ you'll need to do a little more work to get the async methods on there as well.

-Drew
Nov 21 '05 #2
The proxy was generated automatically when I added the web service as a
reference to my C++ application, so it was generated in C++ by Visual Studio.
Do I have to add anything to the generated proxy to get the asynchronous
calls, I thought it should do it automatically?

"Drew Marsh" wrote:
rgarf wrote:
I have a C++ application that consumes a web service. I would like to
call
the web service asynchronously so my C++ application can do other
processing
in between.
My proxy file does not have any asynchronous methods in it, What do I
have
to do to get my proxy file to have the asynchronous methods to call?


How did you generate the proxy? What language is it in? WSDL.exe and WseWsdl2.exe both generate in C#/VB.NET and both definitely generate asyn method pairs per web method. If you generated it by hand in C++ you'll need to do a little more work to get the async methods on there as well.

-Drew

Nov 21 '05 #3
rgarf wrote:
The proxy was generated automatically when I added the web service as
a reference to my C++ application, so it was generated in C++ by
Visual Studio. Do I have to add anything to the generated proxy to get
the asynchronous calls, I thought it should do it automatically?


Wow, wasn't even aware it generated proxies in C++ to be honest with you. Typically, yes, these methods are generated for you when using wsdl.exe. In fact, even though I rarely touch C++ anymore, I just went and crufted up a test app and if I look in the localhost.h file for the test web service i have setup I *do* see async methods:

<codeSnippet language="MC++" >
/// <remarks/>
public: System::IAsyncR esult * BeginReturnXmlN ode(System::Asy ncCallback * callback, System::Object * asyncState);

/// <remarks/>
public: System::Xml::Xm lNode * EndReturnXmlNod e(System::IAsyn cResult * asyncResult);
</codeSnippet>

HTH,
Drew
Nov 21 '05 #4
My C++ application is a MFC application, was yours a .Net app, if yes could
be different.
So how can I do Asynchronous web method calls from my C++ application if my
proxy files does not have the begin & end functions?

"Drew Marsh" wrote:
rgarf wrote:
The proxy was generated automatically when I added the web service as
a reference to my C++ application, so it was generated in C++ by
Visual Studio. Do I have to add anything to the generated proxy to get
the asynchronous calls, I thought it should do it automatically?


Wow, wasn't even aware it generated proxies in C++ to be honest with you. Typically, yes, these methods are generated for you when using wsdl.exe. In fact, even though I rarely touch C++ anymore, I just went and crufted up a test app and if I look in the localhost.h file for the test web service i have setup I *do* see async methods:

<codeSnippet language="MC++" >
/// <remarks/>
public: System::IAsyncR esult * BeginReturnXmlN ode(System::Asy ncCallback * callback, System::Object * asyncState);

/// <remarks/>
public: System::Xml::Xm lNode * EndReturnXmlNod e(System::IAsyn cResult * asyncResult);
</codeSnippet>

HTH,
Drew

Nov 21 '05 #5
rgarf wrote:
My C++ application is a MFC application, was yours a .Net app, if yes
could
be different.
So how can I do Asynchronous web method calls from my C++ application
if my
proxy files does not have the begin & end functions?


Yes, mine was an MC++ .NET WinForms app. I just tried a no MC++ app, just Win32, and it appears the logic behind "Add Web Reference" in that type of project is a completely different beast. It couldn't even handle some simple XSD stuff I had defined. Once I commented that the schema that was causing problems for it, I found exactly what you found: no async methods. This makes sense though, because you're no longer using .NET which comes with async built right in. Therefore it looks like you'd have to emulate it yourself by managing your own threads when using pure C++.

HTH,
Drew
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4820
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 threads to finish. The threads are asynchronous, correct? And I thought each would be able to use it's own version of the web service. Am I wrong, does the web service force only one thread at a time to execute? Here is code if interested... I'm...
0
1548
by: orekinbck | last post by:
Hi There This question is about calling an asynchronous web service from the UI thread. Unless I am making a fundamental error, it appears that the asynchronous web service call seems to spark off an Application.DoEvents() when system resources are low and the message loop has queued requests. Here are some snippets of code to describe the problem:
0
1662
by: Jonathan Trevor | last post by:
Hi, I've found what appears to be a bug with ASP.NET web service method invocation - making it impossible to invoke and get the result of a synchronous web call after an asynchronous call has been made if both are using sessions. Heres an example for two calls in the web service, the first is expected to be executed asynchronously by the client and the second to get the progress of the first while it is executing:
1
9839
by: Alexander Kaplunov | last post by:
I have two different scenarios: 1. I have an application that calls a web service and passes an object. Web Service takes that object and does some stuff with it, which could take some time. It seems to me that in this case it would be appropriate to use asynchronous web service. Am I correct?
5
4369
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 i can get this answer.. Thanks
0
1233
by: Ken T. | last post by:
I have questions regarding what happens on the web server side during an asynchronous web method call when the client aborts its request via .Abort() call. Background: My client app asynchronously calls a web method in a "broker" web service that I've written. My broker service method in turn synchronously calls another web service to perform backend processing. This second, synchronous call can take up to a minute to return. My...
7
6312
by: jtbjurstrom | last post by:
Bear with me because we are new to WCF and have been going through documentation and samples trying to absorb as much as possible in a short amount of time. Any suggestions would be much appreciated. We would of course rather start off on the right path instead of learning later that there's a much better and easier solution, but get stuck with our original implementation. We are working on designing a client server solution using WCF...
1
3040
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of the web service methods. What I like about the asynchronous calls that they use events. So when I call the web service operation is finished is fires the event. So all my objects that I'm using in my client application just subscribe to whatever...
1
1770
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of the web service methods. What I like about the asynchronous calls that they use events. So when I call the web service operation is finished is fires the event. So all my objects that I'm using in my client application just subscribe to whatever...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8638
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7381
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6191
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.