tech·nic·al·ly agile

Custom WCF Proxy

Learn how to create custom WCF proxies to streamline your web services and eliminate the need for converters. Enhance your .NET development toolkit today!

Published on
1 minute read
Image
https://nkdagility.com/resources/hfv2zp8Q-i4

The think that always annoys me with web services is that when you connect to it and generate the proxy it always generates proxies for all of the extra classes and interfaces as well, even when you have them available. This means that you always have to write convertors or adapters to convert one object type to another even though they are the same object (only core class and proxy of that class).

I decided to solve the problem by creating custom proxies for my Windows Communication Foundation services. What you need to do is add a reference to your DataContract and ServceContract assemblies and do the following:

Friend Class SubscriptionsClient
      Inherits System.ServiceModel.DuplexClientBase(Of Services.Contracts.ISubscriptions)
      Implements Services.Contracts.ISubscriptions

End Class

This way you have no need of a convertors or adapters between object types. Obviously this only works for .NET to .NET implementations of servers, you Java guys are still on your own, but it a usefully tool to add to your arsenal.

Technorati Tags: .NET    SOA    WCF 

Software Development
Comments

Related blog posts

No related videos found.

Connect with Martin Hinshelwood

If you've made it this far, it's worth connecting with our principal consultant and coach, Martin Hinshelwood, for a 30-minute 'ask me anything' call.

Our Happy Clients​

We partner with businesses across diverse industries, including finance, insurance, healthcare, pharmaceuticals, technology, engineering, transportation, hospitality, entertainment, legal, government, and military sectors.​

ProgramUtvikling Logo
Emerson Process Management Logo
DFDS Logo

CR2

Slaughter and May Logo
Boxit Document Solutions Logo
Qualco Logo

NIT A/S

Milliman Logo
Bistech Logo
SuperControl Logo
Big Data for Humans Logo
Philips Logo
Kongsberg Maritime Logo
New Signature Logo
Freadom Logo
Flowmaster (a Mentor Graphics Company) Logo
Schlumberger Logo
Nottingham County Council Logo
Royal Air Force Logo
Ghana Police Service Logo
Washington Department of Enterprise Services Logo
Department of Work and Pensions (UK) Logo
Washington Department of Transport Logo
Lockheed Martin Logo
New Signature Logo
Trayport Logo
Workday Logo
DFDS Logo
Microsoft Logo