Logo
programming4us
programming4us
programming4us
programming4us
Windows XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
 
programming4us
Windows 7

Visual Basic 2010 : Hosting WCF Services in Internet Information Services & Configuring Services with the Configuration Editor

6/18/2011 4:19:19 PM

Hosting WCF Services in Internet Information Services

Host applications for WCF services can be of different kinds. Other than the ASP.NET Development Server, you can host services inside managed applications, Windows services, and Internet Information Services as well. In most cases the need will be to deploy to IIS so we will cover this scenario. To host your WCF service in IIS on your development machine, follow these steps:

1.
Restart Visual Studio 2010 under administrator privileges.

2.
Go to the My Project designer for the WCF service project and select the Web tab.

3.
Check the Use Local IIS Web Server option and specify, if required, a different directory; then rerun the WCF service (see Figure 1).

Figure 1. Setting IIS as the deployment Web server.

Visual Studio will request your permission for creating and configuring a virtual directory on IIS so you just need to accept. When this is done, remember to replace the endpoint address in the client application configuration file with the new service URI. To host a WCF service on a nondevelopment machine, you need to create a directory under the Default Website and link the physical folder to the folder where the .svc file is placed together with the compiled dll service. This is accomplished via the Internet Information Services Manager administrative tools available in the Windows operating system.

Configuring Services with the Configuration Editor

WCF services enable high-level customizations over their configuration. This task can be complex if you consider that there are hundreds of options that you should translate into Xml markup. Fortunately the .NET Framework offers a graphical tool called WCF Service Configuration Editor that you can also launch from the Tools menu in Visual Studio. In this section you see how this tool can be used for enabling tracing for WCF services. Tracing is useful because it enables recording into log file (with .svclog extension) events occurring during the WCF service running time. When launched, open the Web.config file for your service. When ready click the Diagnostics folder on the left and then click the Enable Tracing command under the Tracing title on the right (see Figure 2).

Figure 2. Enabling tracing for WCF services.

By default tracing records messages classified at least as warnings. To modify this behavior simply click the Trace Level link. If you click the ServiceModelTraceListener link you can also specify additional information to be tracked, such as the process ID, the call stack, and the Thread ID. To view the log of recorded information you need to run the Service Trace Viewer tool that is available in the shortcuts folder for Visual Studio in the Windows’ All Programs menu. When the tool is running, open the .svclog file, which usually resides in the service folder. Figure 3 shows an example of log analysis.

Figure 3. The Service Trace Viewer tool in action.

The tool provides tons of information about every event occurring at the service level and is helpful if you encounter any problems.

Other -----------------
- Supporting Mobile Windows 7 Users : Understanding DirectAccess & Using BranchCache
- Microsoft Excel 2010 - Creating and Modifying Charts - Changing Chart Titles
- Microsoft Excel 2010 - Creating and Modifying Charts - Changing Chart Gridlines and Axes
- Microsoft PowerPoint 2010 : Working Together on Office Documents - Working with SharePoint Workspaces
- Microsoft PowerPoint 2010 : Working Together on Office Documents - Collaborating with Documents on Windows Live
- Microsoft Visio 2010 : Starting a New Diagram from a Sample Diagram
- Microsoft Visio 2010 : Creating a New Diagram - Using AutoAdd and AutoDelete
- Microsoft Visio 2010 : Creating a New Diagram - Using AutoConnect and Quick Shapes
- Troubleshooting Remote Access Issues (part 3) - Troubleshooting a VPN Client & A Few Words about Teredo
- Troubleshooting Remote Access Issues (part 2) - Creating a VPN Connection & Add a Certificate
 
 
Video tutorials
- How To Install Windows 8 On VMware Workstation 9

- How To Install Windows 8

- How To Install Windows Server 2012

- How To Disable Windows 8 Metro UI

- How To Change Account Picture In Windows 8

- How To Unlock Administrator Account in Windows 8

- How To Restart, Log Off And Shutdown Windows 8

- How To Login To Skype Using A Microsoft Account

- How To Enable Aero Glass Effect In Windows 8

- How To Disable Windows Update in Windows 8

- How To Disable Windows 8 Metro UI

- How To Add Widgets To Windows 8 Lock Screen
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
 
programming4us
Girls
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone