Basically via VS.NET IDE we reference the WCF service as shown below. doing this way we need to update the service Reference whenever WCF service Operation or Data Contracts changes.
Here is the way we can Invoke WCF service with out Adding a Service Reference.
Thanks
SreenivasaRagavan.
7 comments:
Without adding service reference how can you get the interface IFortune?Can you explain
Hi Savitha,
IFortune is the ServiceContract.
just Add all SeviceContract Interfaces to your Client Project that is all.
Thanks
Ragavan
Hi,
Is there a way we can invoke WCF even without including the Service Contract Interface in our project? This is possible for Web Services using System.Web.Services.ServiceDescription object and System.Web.Services.ServiceDescriptionImporter instances.
I just cant get through to invoke WCF similarly.
Hi Viswanathan,
I think when you use this System.Web.Services.ServiceDescription you are basically creating proxy dynamically and invoking .
yes. But since the architecture of WCF is different from web service, like we need contracts, end points, etc, we cannot use System.Web.Services.Description.ServiceDescription class. This causes exceptions especially when it is wsHTTPBinding. I came across Vipul Modi's blog with source code for a dynamic WCF client - http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx.
But that is too sophisticated. I am just expecting a small method as a one that can be achieved with ServiceDescription class.
This is very nice and informative blog thanks for sharing this informationareService Contractsfully insured to provide your belongings the extra cushion that they might need during the transit and giving you the peace of mind that your valuable possessions are in good hands.
Post a Comment