Very rusty .Net question. Asynchronous Web Service Methods

pkloeb

Member
Joined
Sep 4, 2013
Messages
7
Programming Experience
1-3
We are using VS 2008. I haven't touched VS since .Net 1.1 Anyway, we are supporting an application and the Web Services all have generated asynchronous methods. BeginXXX and EndXXX. There are three files in the Web Service fold. ShelfPrice.discomap and under that, ShelfPrice.disco and ShelfPrice.wsdl. Someone said the asynchronous methods were generated automaticlly whenever a web service is added; however, we have a new web service and when we add it, there are no self generated asynchronous methods (ie BeginXXX and EndXXX). Also, there are no files like I described above, discomap, disco, wsdl listed either.

What am I missing and is there a way to get those asynchronous methods generated and added to my project's Web References?

I understand that VS 2008 uses Service References now and can generate those asynchronous methods, but I'm stuck using what we have right now and would prefer to keep this rather large and complicated application the way it is.

Any help would be greatly appreciated.

Regards,
Kevin
 
If you right-click the service reference in Solution Explorer and select 'configure' there's a checkbox for "Generate asynchronous operations". This is for async event model for services references.

When you choose 'add service reference' you can also click 'advanced' and click 'add web reference' to generate the old type .Net 2.0 web service proxy.
 
If you right-click the service reference in Solution Explorer and select 'configure' there's a checkbox for "Generate asynchronous operations". This is for async event model for services references.

When you choose 'add service reference' you can also click 'advanced' and click 'add web reference' to generate the old type .Net 2.0 web service proxy.

JohnH,

Many thanks! Yes, I see how to do it for Service References and I am catching up on the async event model, but that is something the project lead doesn't want to do right now. I guess my question: Is there a way to generate asynchronous operations for Web References IN VS2008 and if so, how? Or is there a way to do it outside VS 2008 and get it in 2008?

THANKS.

Secondly, If I use the 'Advanced' button, click on 'Generate Asyncronous Operations', then click on Web Reference and add a Web Reference, it does not generate the BeginXXX and EndXXX methods.


Thirdly, a general question, if I name the class in my Web Service 'AsyncDS' and my file name is 'Async.asmx', why is it different when I declare a variable of that type after adding it as a Service Reference?

If I add it as Web Reference and declare it in code, it looks like: Dim ws=New WebRef.AsyncDS
If I add it as Service Reference and declare it in code, it looks like: Dim svc=New SrvRef.AsyncDSSoapClient

Was this done on purpose, AsyncDS vs. AsyncDSSoapClient?

First and second question is most important. Third is something that is just bothering me :)

Thanks for the help, John!

Regards,
Kevin
 
Last edited:
1&2: 'Generate Asyncronous Operations' is in the dialog for services references, not web references that is a completely different matter, but it is in that dialog you can opt to go for a web reference instead of service reference. It appears the legacy "event model" was left out at some point, it's been some years since I used VB 2008, but there is a workaround to make VS generate them again: add in project file in PropertyGroup
<WebReference_EnableLegacyEventingModel>true</WebReference_EnableLegacyEventingModel>
Open project in VS and 'Update Web Reference' and the Begin/End-methods is now generated. Info from Begin/End Async WebService Proxy Methods Not Generated in Web Application Projects | Microsoft Connect

3: The proxy namespace is defined when you add the reference, service name and service method names should come from the wsdl info of the service as set in service project. They may have added the 'soap' in the name for the legacy proxy, when I generate a web reference in VB 2010 I get appended 'SoapBinding' to the name.
 
1&2: 'Generate Asyncronous Operations' is in the dialog for services references, not web references that is a completely different matter, but it is in that dialog you can opt to go for a web reference instead of service reference. It appears the legacy "event model" was left out at some point, it's been some years since I used VB 2008, but there is a workaround to make VS generate them again: add in project file in PropertyGroup

Open project in VS and 'Update Web Reference' and the Begin/End-methods is now generated. Info from Begin/End Async WebService Proxy Methods Not Generated in Web Application Projects | Microsoft Connect

That is it!! It worked. Many, many thanks JohnH. Really appreciate it!!

Regards,
Kevin
 
Back
Top