0

I need to create a web service that will be hosted by a website running IIS 6.0 and Asp.net 2.0. I have never created a web service before now. I have Visual Studio 2008.

  • What options do I have for creating the service.

  • Can I create the service using WCF and still have it hosted on Asp.net 2.0?

  • Do I have to specify any specific properties when I build it so that the service will run on 2.0?

  • Or must I use ASMX to build the web service?

I have tried building a service in VS2008 both as ASMX and WCF but I am unable to Add Web Reference to either type of service from VS2008 when I am testing how to consume it. I'm certain my lack of experience with Web Services is a big factor, but the more I read, the more uncertain I am of what technology I can use to create this IIS 6.0, Asp.net 2.0 hosted service.

1 Answer 1

0

WCF was introduced in .NET 3.5, so you need to use the legacy ASMX technology. Create an ASMX service, and use "Add Web Reference" to consume it. The first time you try that, you'll need to use "Add Service Reference", and then to click the "Advanced" button and then the "Add Web Reference" button. After that, "Add Web Reference" will be available as a command.

4
  • (If this is showing up multiple times, my apologies. The Add Comment command does not appear to be accepting my comments?) Aug 25, 2012 at 18:53
  • Thanks so much for your assistance. The Add Web Reference is already enabled. However, it will not detect the asmx project as a web service on localhost. If I type in the address to the web service as "localhost/MyFirstWS/Service1.asmx" it gives me a error. I have changed IIS integration mode to Classic and now it gives a different error. Resource not found " Requested URL: /MyFirstWS/Service1.asmx" not found Aug 25, 2012 at 19:03
  • Sorry, the address I type in is "http //localhost/MyFirstWS/Service1.asmx" with a colon after http. Aug 25, 2012 at 19:04
  • Many many thanks for getting me pointed in the right direction. I found a microsoft link that contains a complete example of how to do this. (It is clearly marked as legacy!) I stepped through it and it works like a charm. The link is http //msdn.microsoft.com/en-us/library/8wbhsy70(v=vs.90).aspx. Aug 26, 2012 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.