Reputation:
I have selected an Empty ASP.NET WebApp
just to add a simple WebService
1.1 to in.
I can run my web service and see it working in the IE browser so my question is what is Virtual Directory for and do I even need it?
Upvotes: 1
Views: 285
Reputation:
You don't need to have a virtual directory or a web application specific to your webservice. However, consider that your ASP.NET website or webservice is an application and requires an application pool to run in within IIS (or Cassini). Therefore, you need to make either the folder containing the webservice files or its parent a web application.
For example:
if your web service is hosted in such a disk folder:
C:\Inetpub\Wwwroot\Foo\Folder1\WebService\ASMX\MyGreatService.asmx
Any of these levels could be a web application:
(you get the picture...)
If you are doing this through IIS, when you create your website in IIS, it will automatically turn your top level directory into a web application. For example, if you create a website with its root folder at C:\Inetpub\Wwwroot\Foo\, that folder will already be a web application for you. To change any particular subfolder into its own web application, simply right-click on the folder you want to convert and select "Convert to Application".
For more details, I would refer you to the following articles:
IIS: Understanding Sites, Applications and Virtual Directories
IIS 7.0: Create and configure Virtual Directories
Web Application Vs. Virtual Directory
Upvotes: 3