Derik Whittaker

Syndication

News


Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Referencing 2.0 Web Services (asmx) in Visual Studio 2008

Recently I needed to add a reference to a classic (.Net 2.0) web service inside a new project that was being created via Visual Studio 2008. 

Now, I have not done a lot of work with WebServices in the past 6-9 months, but thought it would be cake.  Please keep in mind, the service I wanted to connect to was NOT a WCF Service, it was a standard ASMX service.

Below is what I thought would work, but did not

  1. Attempt to Add A Service ReferenceAddAServiceReference
  2. Choose Services in Solution (my Project is in the same solution file).
    ServicesInSolution 
  3. View the generated service implementation.
    IncorrectGeneratedService
  4. WCF Style code implementation
    WCFStyleImplementation 

What you will notice from step 4 is that the way you go about implementing this service is in the WCF style.  This is not what I was looking for.  I was wanting to reference this like all the other code in our projects.

Below is what DID work

  1. Attempt to Add A Service ReferenceAddAServiceReference
  2. Need to click the Advanced button
    ClickAdvancedButton 
  3. Need to add the service as a Web Reference
    ClickAddWebReference 
  4. Finally need to search for and find your web service
     AddWebReference
  5. Lastly, if you have done everything correctly, you should see the following.
    CorrectlyGeneratedService

Now I know that the preferred service type is now WCF, but come-on not everyone is using WCF just yet.  Adding a traditional web service reference is way too much friction.  Why is not possible to add a reference from the solution explorer?  Really can anyone answer me that.

Till next time,

[----- Remember to check out DimeCasts.Net -----]


Posted 07-21-2008 12:55 PM by Derik Whittaker
Filed under:

[Advertisement]

Comments

Visual Studio Hacks wrote Visual Studio Links #56
on 07-23-2008 1:43 PM

My latest in a series of the weekly, or more often, summary of interesting links I come across related to Visual Studio. Lisa Feigenbaum is looking for feedback on a potential Call Hierarchy feature on The Visual Basic Team blog. Visual Studio 2008 KB

Brian Johnston wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 07-24-2008 8:08 PM

You ain't kidding.  Not to mention I find the WCF style kludgy to use - the 2.0 style is much simpler and 'in-line' with traditional programming in my view - 1) create object, 2)call method on object, 3)do something with result, 4)dispose object - the web service is just another set of objects as far as the code *you* are writing is concerned.

Dave Schinkel wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 07-28-2008 8:58 PM

Thanks for all the clicks MS.  What a pain in the ass.  That could cause some people a good hour worth of time.

DotNetKicks.com wrote Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 07-28-2008 8:59 PM

You've been kicked (a good thing) - Trackback from DotNetKicks.com

gkt wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 08-25-2008 9:47 AM

Thanks for the info. Porting my old app to work with .net 2008, i also came across this problem. Another issue that i have is -

i add the solution to sourcesafe along  with web service and all seems fine.

If another sourcesafe user tries to get the solution, the webservices creates another directory under projects. Any idea how i can get the source code of webservice  to be in c:\inetpub\wwwroot\projectWebService.? .  If i delete my entire solution and get new solution from sourcesafe everything works fine.

Srini wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 10-21-2008 3:11 PM

You are my savior Derek.Thanks a lot for ur detailed response

db wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 11-25-2008 3:20 PM

If i were a girl i would give you a lapdance!

Fuzzy's Blogic wrote Deploying SSRS Reports from Powershell
on 11-25-2008 5:40 PM

My current client has a BI group that writes SSRS reports. In the "legacy" ALM tool they built,

Koen Zomers wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 12-31-2008 3:49 AM

Exactly what I was looking for, thanks!

Rune G wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 01-05-2009 4:36 AM

Excellent article. Spot on.

Keep up the good work.

MicrosoftEmployee wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 01-06-2009 2:52 PM

I guess I missed the internal memo on "oh yeah this release we have the following additional pain-features..."

Thanks!!!!!!!!

Embarassing when you are writing a solution for a customer and realize that all of a sudden you dont even know how to create a web reference?!

FireFinch wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 02-02-2009 8:29 AM

Thanks dude.

I agree with MicrosoftEmployee 's comments above.

I was looking like a monkey at a client's office trying to figure out how this works.

nomis wrote re: Referencing 2.0 Web Services (asmx) in Visual Studio 2008
on 04-14-2009 12:26 PM

would be way sweeter if the images from the "article" still worked ;)

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)