WCF and Windows Activation Service(WAS)



Similar documents
To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

Secure Messaging Server Console... 2

Immotec Systems, Inc. SQL Server 2005 Installation Document

Implementing a WCF Service in the Real World

Bentley CONNECT Dynamic Rights Management Service

NovaBACKUP xsp Version 15.0 Upgrade Guide

WCF WINDOWS COMMUNICATION FOUNDATION OVERVIEW OF WCF, MICROSOFTS UNIFIED COMMUNICATION FRAMEWORK FOR.NET APPLICATIONS

R i o L i n x s u p p o r r i o l i n x. c o m 1 / 3 0 /

How to Get Your Site Online

Whats the difference between WCF and Web Services?

Fusion Installer Instructions

Spam Marshall SpamWall Step-by-Step Installation Guide for Exchange 5.5

LOAD BALANCING 2X APPLICATIONSERVER XG SECURE CLIENT GATEWAYS THROUGH MICROSOFT NETWORK LOAD BALANCING

Eylean server deployment guide

Oracle Exam 1z0-102 Oracle Weblogic Server 11g: System Administration I Version: 9.0 [ Total Questions: 111 ]

Deploying Migrated IBM Notes Applications to the Cloud

Basic Exchange Setup Guide

Table of Contents. This whitepaper outlines how to configure the operating environment for MailEnable s implementation of Exchange ActiveSync.

CXM 4.5 Deployed on Windows Chad Adams October 28, 2009

the client omits the BranchCache identifier from the request message.

Implementing an SSL security on AppliDis Servers running under Windows 2008 Server R2

Important Notes for WinConnect Server VS Software Installation:

Active Directory Requirements and Setup

Setting Up SSL on IIS6 for MEGA Advisor

Working with WebSphere 4.0

Basic Exchange Setup Guide

Owner of the content within this article is Written by Marc Grote

Windows Firewall Configuration with Group Policy for SyAM System Client Installation

Integrating VMware Horizon Workspace and VMware Horizon View TECHNICAL WHITE PAPER

DEPLOYING WEBTOP 6.8 ON JBOSS 6.X APPLICATION SERVER

Configure Managed File Transfer Endpoints

BusinessObjects Enterprise XI Release 2

JOSSO 2.4. Internet Information Server (IIS) Tutorial

AvePoint Meetings for SharePoint On-Premises. Installation and Configuration Guide

ENABLING RPC OVER HTTPS CONNECTIONS TO M-FILES SERVER

McAfee One Time Password

Install MS SQL Server 2012 Express Edition

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream

Using LifeSize systems with Microsoft Office Communications Server Server Setup

BlackBerry Enterprise Service 10. Version: Configuration Guide

Attacking WCF Web Services. AppSec DC. The OWASP Foundation. Brian Holyfield Gotham Digital Science

F-SECURE MESSAGING SECURITY GATEWAY

Setup Guide. network support pc repairs web design graphic design Internet services spam filtering hosting sales programming

Unlocking data creating knowledge. How to run Nesstar with IIS Socket Pooling

escan SBS 2008 Installation Guide

Codeless Server IIS Installation

Quick Start Guide. Cerberus FTP is distributed in Canada through C&C Software. Visit us today at

Configuring Apache HTTP Server as a Reverse Proxy Server for SAS 9.2 Web Applications Deployed on BEA WebLogic Server 9.2

Data Domain Profiling and Data Masking for Hadoop

USING SSL/TLS WITH TERMINAL EMULATION

The presentation explains how to create and access the web services using the user interface. WebServices.ppt. Page 1 of 14

F-Secure Messaging Security Gateway. Deployment Guide

Configuring Security Features of Session Recording

Important Notes for WinConnect Server ES Software Installation:

New Features in Neuron ESB 2.6

Installation Instruction STATISTICA Enterprise Server

Access It! Universal Web Client Integration

Configuring Global Protect SSL VPN with a user-defined port

System Administration Training Guide. S100 Installation and Site Management

The Windows Web Platform. Michael Epprecht Microsoft Switzerland twitter: fastflame

WirelessOffice Administrator LDAP/Active Directory Support

Introduction to Mobile Access Gateway Installation

Installation Manual v2.0.0

Overview of WebMux Load Balancer and Live Communications Server 2005

Recommended KEPServerEX Settings for groov

NSi Mobile Installation Guide. Version 6.2

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

Contents. TSM Remote Server Installation guide

DEPLOYMENT GUIDE Version 1.1. Deploying F5 with IBM WebSphere 7

Configuring Microsoft Internet Information Service (IIS6 & IIS7)

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

TIBCO Spotfire Metrics Prerequisites and Installation

Deploying the BIG-IP LTM with Microsoft Skype for Business

Enabling Kerberos SSO in IBM Cognos Express on Windows Server 2008

Tech Note 905 Troubleshooting Wonderware Information Server (WIS) Part Six: ArchestrA Graphics No Live-Data

Cloud Deployment Models

DEPLOYMENT GUIDE Version 1.0. Deploying F5 with the Oracle Fusion Middleware SOA Suite 11gR1

Nagios XI Monitoring Windows Using WMI

Sitecore Security Hardening Guide

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

OpenESB Standalone Edition V3.0 Web admin console

Using RADIUS Agent for Transparent User Identification

Firewall Load Balancing

Click Studios. Passwordstate. Upgrade Instructions to V7 from V5.xx

How To Set Up Mybpx Security Configuration Guide V1.2.2 (V1.3.2) On A Pc Or Mac)

Symantec Indepth for. Technical Note

Grandstream Networks, Inc. How to Integrate UCM6100 with Microsoft Lync Server

Installing Autodesk Vault Server 2012 on Small Business Server 2008

Metasploit Beginners

Sharp Remote Device Manager (SRDM) Server Software Setup Guide

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP Edge Gateway for Layered Security and Acceleration Services

INSTALLING MOODLE 2.5 ON A MICROSOFT PLATFORM

AGILEXRM REFERENCE ARCHITECTURE

NovaBACKUP Central Management Console

Case Closed Installation and Setup

How To Install Powerpoint 6 On A Windows Server With A Powerpoint 2.5 (Powerpoint) And Powerpoint On A Microsoft Powerpoint 4.5 Powerpoint (Powerpoints) And A Powerpoints 2

Setting up DCOM for Windows XP. Research

Transcription:

WCF and Windows Activation Service(WAS) We have writing WCF services for the last year or so and many have remarked that these can be a pain because of the hosting requirements. In fact I think some wonder why we worry about WCF anyways given that it is so easy to write a Web service. Well let me mention a few features like security, instrumentation, error masking, fault isolation reliability, remoting and transactions that come for free in using WCF. Many of our services run inside the firewall and thus benefit from the performance of using TCP as the transport. We are developing SOA solutions and WCF is the Microsoft platform for delivering SOA. However, functionality did not come without effort as with WCF we must add two host(s) to our project, a console application for testing and a Windows Service for deployment. The Windows service is the most onerous. Well there is hope on the horizon with the introduction of Windows Process Activation Services (WAS) on Windows 2008 Server(W2K8). IIS 7 then becomes the host for our non-http services that are based on TCP or MSMQ. We can then enjoy the same ease of development and deployment that existing for simple Web Services and still derive all the framework benefits that WCF. For those interested in the gory details, with IIS 6, W3Svc module acted as a HTTP listener and then performed process activation (to handle the requests). In IIS 7, these two services are separated and WAS is responsible for the process activation. WAS contains a Configuration component that reads application info from \windows\system32\config\applicationhost.config. This really replaces the IIS metabase. Its process manager will spawn new application pools in response to activation request that are passed to it by listen adapters such as TCP. WCF uses this listening adapter to communicate activation requests received for non-http protocols. As a result we can use IIS 7 to host our WCF services that are using protocols such as TCP or MSMQ.

W3SVC HTTP Manager Configuration Manager SVCHOST.EXE Windows Process Acivation Service Listener Adapter Interface Process Manager IIS 7 Components HTTP.SYS Listeners Non-IIS TCP Listener Adapter named Pipes Adapter MSMQ Adapter Components For an in-depth article on how all this works click http://msdn2.microsoft.com/en-us/magazine/cc163357.aspx.the bottom line is this should make our development effort simpler but there is some setup required on the server side.

Windows Server 2008 Setup Windows Server 2008 is a new product with a Vista-like UI so there is learning curve in feeling our way around but the following must be done. The Application Server component must be started and support enabled for Windows Process Activation Services and for each non-http listener such as TCP Activation.These are configured using the Server Manager and if you want TCP then you should see the following services started: Only using TCP with Port Sharing Additionally, if IIS 7 was installed after WCF then make sure that you run ServiceModelReg so that the WCF extension SVC is recognized by IIS : ServiceModelReg.exe /i /x.

Web Site Setup First we must tell the Web Site(assume Default) about the non-http protocols that our Service(s) might use. In the Server Manager we bring up the IIS Manager and click on the Bindings for the Web Site as shown below: TCP Listener needs to know what port(s) to listen on... 808* Changes made by the Server Manager are reflected in the C:\Windows\System32\inetsrv\config\applicationHost file so its Default site section should now have a bindings section that looks like: <bindings> <binding protocol="http" bindinginformation="*:80:" /> <binding protocol="net.tcp" bindinginformation="808:*" /> of course we can edit this file

Development With the combination of VS2008 and W2K8 there is no need to add a Console and Windows Service Host to each WCF service that we are writting as we can use the built in testing facility that comes with VS2008 for can still use development stage and then WAS for the deployment. the existing techniques VS2008 has a new WCF client testing tool that is evoked when one hits the debug mode F5, however this only works when one is building a WCF Service Library project type. This testing tool is handy as it saves the developer from writing a test client (this is itself is not real hard) so lets assume that we desire this capabilty. We need to combine this capability with the desire to end up with a Web Application for deployment. There are 2 options here: 1. We can start with a Web WCF Service Application project and add a WCF Service Library for testing. 2. Start with a WCF Service Library then manually create a.svc file and Web.Config needed to produce a Web Application hosted as a W2K8 Web Application. The problem with 1 is that we will end up defining the service contract in the WCF Service project. We the add a reference to this Library in the Web project and point the.svc file to it : <%@ ServiceHost Language="C#" Debug="true" Service="WcfServiceLibrary1.Service1" CodeBehind="WcfServiceLibrary1.Service1.cs" %> As a result I recommend solution 2 as it is it pretty easy to copy the WCF library over to the W2K8 server and create an SVC file.

Changing the Solution defaults Create a WCF Service Library, which will setup a project with an App.Config containing all the ServiceModel definitions for the default service name which is Service1. Lets us assume that we want this to be Logger. It is also setup for HTTP which we will change later. But the first thing is to change the Service name to something more meaningful so do a CTRL-H to bring up the replace dialog and globally change in the project Service1 to Logger, (make sure Look In is set to Current project) this should make about 11-12 changes. The name of the Files in Solution Explorer is still the defaults so just inline change them to ILogger.cs and Logger.cs.We also need to change the default Namespace to follow IEI conventions so IEI.Adept.NNNNN where NNNNN is your asssigned name. e.g IEI.Adept.Logger. Both the ILogger.cs and Logger.cs files must be changed. As a result the Logger.svc.cs file that contains the implemention of our service should look like : namespace IEI.Adept.Logger public class Logger : ILogger

Changing the Solution defaults The Binding defaults to HTTP so change it to TCP with the following changes: binding = wshttpbinding to binding = nettcpbinding baseaddress = "net.tcp://localhost:8001" Change the MetaData binding to MexTcpBinding This is only needed for testing Finally on the <ServiceMetaData> Tag remove the httpgetenabled=true We can now test the TCP binded service by just pressing F5. The app.config should look like: namespace IEI.Adept <system.servicemodel> public class Logger : ILogger <services> <service name="iei.adept.logger" <host> <baseaddresses> <add baseaddress = "net.tcp://localhost:8001/" /> </baseaddresses> </host> behaviorconfiguration="iei.adept.logger.loggerbehavior"> <endpoint address ="" binding="nettcpbinding" contract="iei.adept.ilogger"> </endpoint> <endpoint address="mex" binding="mextcpbinding" contract="imetadataexchange"/> </service> </services> Implementation namespace IEI.Adept [ServiceContract()] public interface ILogger

Deployment After building the WCF service and testing it then it can be deployed as Web Application on W2K8 as follows: 1. Create a new directory under the IIS virtual root for example Logger. Copy the service library (DLL) to Logger/Bin and the PDB file for debugging. In this case assume it is Logger.DLL. 2. Open a text file in VS and create the SVC file. This file is specific to WCF and is used by IIS to find the Service Contract as the servicehost is the link between incoming request and the service model. <%@ ServiceHost Language="C#" Debug="true" Service="IEI.Adept.Logger"%> <%@ Assembly Name="Logger"%>" Now save this file as Logger.svc. 3. We need a Web.Config for our web application so take a basic generated Web.config for a IIS Web Site and add the ServiceModel information from the development project. 4. Finally go into Server Manager and create a new IIS Application called Logger pointing to Logger directory and use the Advanced Settings tab to add net.tcp support. As long as the PDB files are in the Bin and the source is available on the server then standard break points can be set in tghe application even though it is launced just-in-time by IIS. Yes we can Debug NOTE: As we are using IIS to hos the service when a client is adding a service reference the address we supply is of the form: net.tcp://server/logger/logger.svc Virtual directory

Development WCF Library Look Ma, no Windows service needed Windows 2008 Server IIS 7 Logger project Logger.cs ILogger.cs App.Config. Extract ServiceModel IIS App Default Web Site Logger Logger.svc web.config tells IIS where to find the service Bin Logger.DLL Logger.PDB Copy Bin Logger.DLL Logger.pdb Just press F5 to Test JIT Activation Client will use net.tcp://iis server name/logger/logger.svc when adding a service refernce

Factory One major problem with the Web Application is that there is no where to place startup code as there is no Main, I often put configuration code here instead of the config file. However in 3.5 a new keyword was added to the SVC file called Factory that can solve this issue. Now the SVC file will look like : <%@ ServiceHost Language="C#" Factory="MyFactory" Debug="true" Service="Service" %> We the add our Factory code such as : public class MyFactory : ServiceHostFactory protected override ServiceHost CreateServiceHost(Type servicetype, Uri[] baseaddresses) MyCustomHost customhost = new MyCustomHost(serviceType, baseaddresses); return customhost; Force Break Point } public class MyCustomHost : ServiceHost public MyCustomHost(Type servicetype, params Uri[] baseaddress) : base(servicetype, baseaddress) Debugger.Break(); NetTcpBinding Binding = new NetTcpBinding(SecurityMode.Message); this.addserviceendpoint(typeof(iservice), cb, baseaddress[0]); Depends on which transport protocols configured Setup the service Endpoint ServiceMetadataBehavior smb = this.description.behaviors.find<servicemetadatabehavior>(); if (smb == null) smb = new ServiceMetadataBehavior(); smb.httpgetenabled = true; this.description.behaviors.add(smb); this.addserviceendpoint( ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexHttpBinding(), "mex" ); Setup Metadata endpoint