Subscribe For Free Updates!

We'll not spam mate! We promise.

Aug 25, 2012

Configure IIS Server and Deploy Asp.net Web Service Locally

Views:

Configure IIS Server and Deploy Asp.net Web Service Locally
To day i will Describe to you how to Configure an IIS Server on Windows XP and Windows 7 and also will be explaining  How to Deploy , Publish and Host Asp.net Web service and Web site on IIS Server Locally.

By Deploying or Hosting Asp.net Website or web service Locally Any One Can Access your Web site or web service through Local , LAN (Local Area Network )  and Through WiFi .



USAGE
1) This is Very Useful tutorial ,For E.g:- In Some Organizations,  they want Web site or web applications that are only accessibly in that particular Organization (Technically : in Organization LAN NETWORK) .So they Host their Asp.net website,Web service or Web applications Locally.

2) If a Personal  web application of an Organization is Hosted Globally then The Web Application Security Factor is Very LOW and There is a great of a hacker accessing or Hacking your Web application.But on Local Host there Security Factor is very High  and there is Minimum chances of Hack attacks.

3) In Developing Android Applications ,When you are Trying to  Access a Asp.net Web Service on Android Emulator you cannot Access the Asp.net web service until you host asp.net web service Locally .Because the default URL of Asp.net Web service is For Example "http://localhost/sajjad/Service1.asmx"  mean it is Referring windows  LocalHost, if you access
This Service (Through URL "http://localhost/sajjad/Service1.asmx") in android is inaccessible because android has ITS OWN LOCAL HOST and Face Error SITE NOT FOUND .

4) You Can not Access you asp.net web Site or Web service Through System's Local IP address (Like:192.168.1.2)  until you deploy it On IIS Server.

These are Some Major usages in addition to these there are a lot of other Usages too.

So Lets Begin ,
First you have to install ISS SERVER ON Windows Xp and Windows 7 .I will be showing you Both Installation Windows Xp and 7.

Windows XP and Windows 7 IIS Server  Installations

Steps

First of all, Open  Control Panel.
Configure IIS Server and Deploy Asp.net Web Service Locally
In the Programs Options, select Turn Windows Features on or off.
Configure IIS Server and Deploy Asp.net Web Service Locally

You might See the following Popup screen:
Configure IIS Server and Deploy Asp.net Web Service Locally

 Now, simply click on the features that are checked on the following screens and then hit the OK button.
Configure IIS Server and Deploy Asp.net Web Service Locally


Configure IIS Server and Deploy Asp.net Web Service Locally
Configure IIS Server and Deploy Asp.net Web Service Locally

A progress bar popup will appear.
Configure IIS Server and Deploy Asp.net Web Service Locally
Once the installation is over, to confirm it! simply type the following URL into your browser: http://localhost.
If installation is successful, then you will see the following screen:
Configure IIS Server and Deploy Asp.net Web Service Locally
 Now you can use Internet Information Services Manager to manage and configure IIS. To open IIS Manager, click Start, type inetmgr in the Search Programs and Files box, and then press Enter. or go to Control Panel >Administrative Tools>Internet Information Services (IIS) Manager
Configure IIS Server and Deploy Asp.net Web Service Locally
We have installed the IIS Server on Windows ,
Now Add an Web Application to the IIS SERVER
In Left Site Of the IIS Manager Widnow there is an Option by the Name "SITES"Click it then > Right click on Default web site option > Add Application write an Alias Name Like "visualstudiolearn"  , and Give a Physical Path of Application See the Screen Below .
Configure IIS Server and Deploy Asp.net Web Service Locally

























Now Lets Create a ASP.NET Simple Web service in Visual studio . I have already Written an Article about How to create Asp.net Webservice  and How to utilize Asp.net web service if you donot know then read it first.
Next create a method with Following Code
[WebMethod]
        public string HelloWorld()
        {
            return "Configure IIS Server and Deploy Asp.net Web Service Locally  VISUALSTUDIOLEARN.com By SAJJAD AHRAF";
        }
Now Press F5 to Test Service if it is running correctly  or Not.

Now We will Publish Our Web Service .Right Click Project>(from solution Explorer tab ) then click Publish option >A popup window will open.SET Publish Method to "File System" , and Set Target Location to Physical Path (defined by you Already we will add Application in IIS Manager) See Screen Below
Configure IIS Server and Deploy Asp.net Web Service Locally

























After doing this you can Access Service through Following URLS.
http://localhost/visualstudiolearn/Service1.asmx
OR
http://192.168.1.2/visualstudiolearn/Service1.asmx

Note "192.168.1.2"  is your System Local IP address  you can find you IP address just open Cmd "Command Prompt " and write ipconfig.
See Screen Below,
Configure IIS Server and Deploy Asp.net Web Service Locally





























Now You can Also access This Web service in Android Emulator by  just Entering the
Following  in android Web Browser

http://192.168.1.2/visualstudiolearn/Service1.asmx

See the Out put.
Configure IIS Server and Deploy Asp.net Web Service Locally


Plese Feel Free to Socializer This Post
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

1 comments:

Become a Fan

visual studio learn