Welcome to MSDN Blogs Sign in | Join | Help

MADHU@MICROSOFT BLOG

All About Distributed apps

Syndication

News

Madhu Ponduru works at Microsoft. Everything here, though, is his personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.
How to write Serviced components for WCF?

If you want to expose serviced component as WCF service, you have to define custom interface for all your serviced component public methods(you can have multiple custom interfaces also) and then serviced component has to implement that interface.

If you don't have custom interface in serviced componnet, all methods will fall into default interface, ComSvcConfig.exe not going to expose default interface as WCF service.

I spoke to one of developers to know why we are not exposing default interface as WCF service, Here is reason

The main reason is that a  class interface is a CLR metaphor and mapping it to a contract is non trivial and people expect class like behavior with it which we are not guaranteeing the whole idea is that if you use interfaces then you are much closer programming model wise to Indigo. And this is exactly what we are promoting

If you already wrote Service component, you can use c# refactoring support to extract interface for that class and then implement that interface.

REFERENCE:

http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/WCF_tools/html/7717c6c2-85fc-418b-a8ed-bad8e61cec5c.asp

on my machine,I am trying to generate config file for StudentManagement COM+ application,I followed these instructions to generate config file

 EXAMPLE:

STEP1:

install your svc component in GAC

C:\WINDOWS\WinFX\v3.0\Windows Communication Foundation>gacutil /i C:\customers\WCF\StudentManagement\StudentManagement.dll

STEP2:

by using regsvcs,install it in COM+

C:\WINDOWS\WinFX\v3.0\Windows Communication Foundation>regsvcs C:\customers\WCF\StudentManagement\StudentManagement.dll

STEP3:

Run comsvcconfig file to generate config file

//When you are using contract option,you are going to use this format

 

COMPONENT NAME,INTERFACE NAME

 

C:\WINDOWS\WinFX\v3.0\Windows Communication Foundation>comsvcconfig /i /applicat

ion:StudentManagement /hosting:was /webDirectory:TESTAPP /mex /contract:StudentM

anagement.Students,IStudents /v

 

 

Published Wednesday, April 05, 2006 6:10 PM by madhu_ponduru@hotmail.com

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement  
Page view tracker