Introduction
In this post we will learn how to host a web service in IIS. We discussed Web Services earlier and also created a Web Service using C# . If you never create a web service you can create your own web service please read Create Web Service using C#.
Description
As we discussed in previous update about Web service creation and concepts so now here i am using the same Service which i created earlier.
Host A Service In Simple Steps
1. Open IIS Manager. Search on Windows Programms for IIS and Press enter or by using CMD, open Command Promt (Ctrl + r) and type inetmgr and hit enter.
2. Expand the caret symbol on left side connection panel. Select Default Site and right click over it.
3. Click on Add Application and you will find a similar screen like below.
4. Fill the Alias name similar to your service and click on Physical path browse button. Here go to C:/inetpub/wwwroot and Create a New folder under this wwwroot. Named it just like Alias name.
5. You have successfully created a Physical path for your WebService and click Ok .
Now you have to copy all the Service project files here in this physical path. So for doing this simply go to your service application and right click on name and select Open Folder in File Explorer.
6. Select all the files and copied them .
7. Go to IIS , select content view from bottom tab (Red outline in below image) and Right click on blank content view panel.
8. Now Click on Explore and you will find the folder you created earlier in root folder in C drive and paste the data which you copied in step 6 .
9. Goto IIS select your Hosted Application and click on Refresh . All your pasted data should displayed in content view tab. Select your asmx service file and Right click select Browse.
10. You will get your running service page on the Browser .Congrats ! you successfully hosted your service.
Key Points :-
In case you got any error in step 10 for browsing service and If you are working with VS 2015 or in any other version with .Net Framework 4.6 then you have to enable .Net Extensibility 4.6 from Application Development feature under IIS.
Goto Windows feature on and off , already explain this in previous update of Enable IIS in windows .
Hope this post will help full for you. If you have any query then please let me know in comments.
Description
As we discussed in previous update about Web service creation and concepts so now here i am using the same Service which i created earlier.
Host A Service In Simple Steps
1. Open IIS Manager. Search on Windows Programms for IIS and Press enter or by using CMD, open Command Promt (Ctrl + r) and type inetmgr and hit enter.
2. Expand the caret symbol on left side connection panel. Select Default Site and right click over it.
3. Click on Add Application and you will find a similar screen like below.
4. Fill the Alias name similar to your service and click on Physical path browse button. Here go to C:/inetpub/wwwroot and Create a New folder under this wwwroot. Named it just like Alias name.
5. You have successfully created a Physical path for your WebService and click Ok .
Now you have to copy all the Service project files here in this physical path. So for doing this simply go to your service application and right click on name and select Open Folder in File Explorer.
6. Select all the files and copied them .
7. Go to IIS , select content view from bottom tab (Red outline in below image) and Right click on blank content view panel.
8. Now Click on Explore and you will find the folder you created earlier in root folder in C drive and paste the data which you copied in step 6 .
9. Goto IIS select your Hosted Application and click on Refresh . All your pasted data should displayed in content view tab. Select your asmx service file and Right click select Browse.
10. You will get your running service page on the Browser .Congrats ! you successfully hosted your service.
Key Points :-
In case you got any error in step 10 for browsing service and If you are working with VS 2015 or in any other version with .Net Framework 4.6 then you have to enable .Net Extensibility 4.6 from Application Development feature under IIS.
Goto Windows feature on and off , already explain this in previous update of Enable IIS in windows .
Hope this post will help full for you. If you have any query then please let me know in comments.
0 comments:
Post a Comment