Click here to Skip to main content
15,886,873 members
Articles / Programming Languages / C#

Runtime Generated WCF Service Exposing .NET or COM Types

Rate me:
Please Sign up or sign in to vote.
4.69/5 (38 votes)
24 Apr 2008CPOL8 min read 79.8K   1.1K   51  
A WCF service wrapper is generated at runtime around a .NET or COM type to expose its interface.
//------------------------------------------------------------------------------
// <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.Class2_PerCall {
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="Class2_PerCall.IClass2_PerCall")]
    public interface IClass2_PerCall {
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClass2_PerCall/Method1", ReplyAction="http://tempuri.org/IClass2_PerCall/Method1Response")]
        string Method1(ref string bsParam1, ref int lParam2);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public interface IClass2_PerCallChannel : ConsoleClient.Class2_PerCall.IClass2_PerCall, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class Class2_PerCallClient : System.ServiceModel.ClientBase<ConsoleClient.Class2_PerCall.IClass2_PerCall>, ConsoleClient.Class2_PerCall.IClass2_PerCall {
        
        public Class2_PerCallClient() {
        }
        
        public Class2_PerCallClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public Class2_PerCallClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Class2_PerCallClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Class2_PerCallClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public string Method1(ref string bsParam1, ref int lParam2) {
            return base.Channel.Method1(ref bsParam1, ref lParam2);
        }
    }
}

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)


Written By
Software Developer (Senior)
Israel Israel


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



Comments and Discussions