Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Runtime Generated WCF Service Exposing .NET or COM Types

, 24 Apr 2008 CPOL
A WCF service wrapper is generated at runtime around a .NET or COM type to expose its interface.
runtimegen_wcf_service_expnetcom_demo.zip
ConsoleClient.exe
DummyComInterop.exe
ServiceHostContainer.exe
ComponentCom.dll
ComponentNet.dll
ComponentNetBase.dll
ComponetNetBase2.dll
Interop.ComponentComLib.dll
WcfServiceHost.dll
runtimegen_wcf_service_expnetcom_src.zip
ConsoleClient
Properties
Service References
Class1
configuration.svcinfo
Reference.svcmap
service.wsdl
Class1_PerCall
configuration.svcinfo
Reference.svcmap
service.wsdl
Class2
configuration.svcinfo
Reference.svcmap
service.wsdl
Class2_PerCall
configuration.svcinfo
Reference.svcmap
service.wsdl
DummyComInterop
Properties
ServiceHostContainer
Properties
WcfServiceHost
Properties
WcfServiceHost.csproj.user
ComponentCom
Class2.rgs
ComponentCom.def
ComponentCom.rgs
ComponentCom.vcproj.vspscc
ComponentComps.def
ComponentNet
Properties
ComponentNetBase
Properties
ComponetNetBase2
Properties
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1433
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace ConsoleClient.Class1_PerCall {
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="Class1_PerCall.IClass1_PerCall")]
    public interface IClass1_PerCall {
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClass1_PerCall/Add", ReplyAction="http://tempuri.org/IClass1_PerCall/AddResponse")]
        int Add(int a);
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClass1_PerCall/Subtract", ReplyAction="http://tempuri.org/IClass1_PerCall/SubtractResponse")]
        int Subtract(int a);
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClass1_PerCall/set_Count", ReplyAction="http://tempuri.org/IClass1_PerCall/set_CountResponse")]
        void set_Count(int value);
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClass1_PerCall/get_Count", ReplyAction="http://tempuri.org/IClass1_PerCall/get_CountResponse")]
        int get_Count();
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClass1_PerCall/Concat", ReplyAction="http://tempuri.org/IClass1_PerCall/ConcatResponse")]
        string Concat(string ins);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public interface IClass1_PerCallChannel : ConsoleClient.Class1_PerCall.IClass1_PerCall, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class Class1_PerCallClient : System.ServiceModel.ClientBase<ConsoleClient.Class1_PerCall.IClass1_PerCall>, ConsoleClient.Class1_PerCall.IClass1_PerCall {
        
        public Class1_PerCallClient() {
        }
        
        public Class1_PerCallClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public Class1_PerCallClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Class1_PerCallClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Class1_PerCallClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public int Add(int a) {
            return base.Channel.Add(a);
        }
        
        public int Subtract(int a) {
            return base.Channel.Subtract(a);
        }
        
        public void set_Count(int value) {
            base.Channel.set_Count(value);
        }
        
        public int get_Count() {
            return base.Channel.get_Count();
        }
        
        public string Concat(string ins) {
            return base.Channel.Concat(ins);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Igor Ladnik
Architect
Israel Israel


  • Nov 2010: Code Project Contests - Windows Azure Apps - Winner
  • Feb 2011: Code Project Contests - Windows Azure Apps - Grand Prize Winner

Follow on   LinkedIn

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 24 Apr 2008
Article Copyright 2008 by Igor Ladnik
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid