Last post Sep 16, 2015 08:21 AM by Mukesh_Kumar
Member
46 Points
17 Posts
Sep 16, 2015 08:17 AM|Yaduveer Saini|LINK
Hi,
I have a Web Forms application. I call WCF service which is hosted on IIS then
how can i access Class/Properties/DataMembers in (.aspx.cs) page which are contained in WCF Service.
Any help will be greatly appreciated.
Thanks
Contributor
4390 Points
871 Posts
Sep 16, 2015 08:21 AM|Mukesh_Kumar|LINK
You can use like this..First write the namespace for the wcf service.
using MyProject.MyService;
and than you can simply do that like below to access the datacontract and datamember
using (ProductsClient client = new ProductsClient()) { Product product = new Product(); product.CategoryID = "2"; product.CategoryName = "Condiments"; product.ProductID = "8"; product.ProductName = "Coffee"; product.UnitsInStock = "20"; product.WebOnly = ProductWebOnly.No; client.AddProduct(product); }
Hope this will help you.
thanks
Member
46 Points
17 Posts
How to access [DataContract] and [DataMember] when we consume/access WCF Service in another proje...
Sep 16, 2015 08:17 AM|Yaduveer Saini|LINK
Hi,
I have a Web Forms application. I call WCF service which is hosted on IIS then
how can i access Class/Properties/DataMembers in (.aspx.cs) page which are contained in WCF Service.
Any help will be greatly appreciated.
Thanks
Contributor
4390 Points
871 Posts
Re: How to access [DataContract] and [DataMember] when we consume/access WCF Service in another p...
Sep 16, 2015 08:21 AM|Mukesh_Kumar|LINK
Hi,
You can use like this..First write the namespace for the wcf service.
and than you can simply do that like below to access the datacontract and datamember
Hope this will help you.
thanks