Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

Asynchronous calls to a web Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rgarf - 23 Nov 2004 14:09 GMT
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
Drew Marsh - 23 Nov 2004 19:27 GMT
> I have a C++ application that consumes a web service. I would like to
> call
[quoted text clipped - 4 lines]
> 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
rgarf - 23 Nov 2004 20:47 GMT
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?

> > I have a C++ application that consumes a web service. I would like to
> > call
[quoted text clipped - 8 lines]
>
> -Drew
Drew Marsh - 23 Nov 2004 22:46 GMT
> 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::IAsyncResult *  BeginReturnXmlNode(System::AsyncCallback *  callback, System::Object *  asyncState);
       
       /// <remarks/>
       public: System::Xml::XmlNode *  EndReturnXmlNode(System::IAsyncResult *  asyncResult);
</codeSnippet>

HTH,
Drew
rgarf - 24 Nov 2004 14:49 GMT
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?

> > 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
[quoted text clipped - 13 lines]
> HTH,
> Drew
Drew Marsh - 24 Nov 2004 16:35 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.