Monday 8 October 2012

what is proxy in WCF? How to create proxy in WCF.

Hi Friends, Here i have explained what is proxy in WCF and How we create proxy in WCF.

Introduction:

The proxy is a CLR class that exposes a single CLR interface represnting the  service contract. The proxy provides the same operations as service contract. It also has additional method for managing the proxy life cycle and the connection to the service.The proxy completely encapsulate every aspect of the service:its location,  its implementation technology and runtime plateform , and the communication transport.

The proxy can be generated using Visual Studio by right clicking reference and clicking on add Service Refernce. This brings up the Add Service Refernce dialog box,Where you need to supply the base address of the service(or a base address and a MEX URI) and the namespace to contain the proxy.

Proxy can also be generated by using svcUtil.exe command line utility.We need to provide svcUtil with the HTTP-GET address or the metadata exchange endpoint address and ,optionally with a proxy filename. The default proxy filename is output.cs but you can also use the /out switch to indiacte a different name.


No comments:

Post a Comment

Note: only a member of this blog may post a comment.