Click here to Skip to main content
15,896,557 members
Articles / Programming Languages / XML

WCF Proxy Generation Options

Rate me:
Please Sign up or sign in to vote.
3.57/5 (5 votes)
11 Feb 2009CPOL7 min read 129.9K   3.6K   23  
An overview of a number of different ways of generating proxies for using WCF Services.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProxyGeneration;
using System.ServiceModel;

namespace Proxy
{
    public class ProxyServiceClient : ClientBase<IProxyServ>, IBob
    {
        public ProxyServiceClient()
            : base()
        { }

        public ProxyServiceClient(string endpoint)
            : base(endpoint)
        { }

        public void HelloWorld()
        {
            try
            {
                base.Channel.HelloWorld();
            }
            catch (Exception exc)
            {
                //FANTASTIC error handling here. No, really. It must be awesome.
                throw new ApplicationException(exc.Message, exc);
            }
        }
    }
}

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)
United Kingdom United Kingdom
Chris is a full time software developer in London, UK.
He has a BSc in computer science and is busy taking courses in the MCTS stream.

Comments and Discussions