If we do not want to explicitly set address for each EndPoint in our service then we define BASE ADDRESS for the EndPoint exposed for our service And we use it in service configuration as below, The advantage of having base address is that, if we are changing the service URL, we need to changeContinueContinue reading “Multiple base addresses for WCF Service”
Category Archives: WCF
LINQ to SharePoint with WCF 4.0
Objective How could we perform CRUD operations on SharePoint 2010 List from a WCF Service? Assume we need to create a WCF Service and that service will perform CRUD operation on SharePoint 2010 list. We are going to see that in this article. Flow Diagram Now we will follow the below steps to perform allContinueContinue reading “LINQ to SharePoint with WCF 4.0”
The Web Application could not be found .verify that you have typed the URL correctly error: SharePoint 2010 object model
The below exception is very frustrating when we start working with SharePoint object model. Let us investigate how to solve below exception Above Exception can encounter in two scenarios 1. Trying to use SharePoint 2010 object model in managed application like console or windows application. 2. Trying to use SharePoint 2010 object model in WCFContinueContinue reading “The Web Application could not be found .verify that you have typed the URL correctly error: SharePoint 2010 object model”
HTTP Error 404.3 : WCF Hosted in IIS. Add a MIME type
Normally when we host a WCF Service i9n IIS and while browsing we get the below frustrating screen Error message in above screen is very clear. We need to add MIME type for .SVC extension. To solve above problem 1. Open command prompt as Administrator 2. Navigate to C:Windows\Microsoft.Net\Framework\v3.0 3. Type the command ServiceMode1Reg.exe –iContinueContinue reading “HTTP Error 404.3 : WCF Hosted in IIS. Add a MIME type”
Enumeration in DataContract of WCF
By default Enums are serializable. If we define Enum at service side and use it in Data Contract, it is exposed at the client side. For example, if we have an Enum as below, And we are using it in DataContract as below By default Enum is serialized. So, let us see the default behaviorContinueContinue reading “Enumeration in DataContract of WCF”
Accessing WCF service without creating Proxy
Each time when we want to consume a WCF service, we need to create proxy at client side. To create proxy, service must expose metadata endpoint. Normally 1. We create a WCF service 2. Expose metadata endpoint 3. Add service reference at client side to create the proxy. 4. Using the proxy calls the serviceContinueContinue reading “Accessing WCF service without creating Proxy”
Versioning in WCF Data Contract Part #2: Missing Members
Part #1 of the article can be read here If we have a DataContract Product.cs ServiceContract is as below IService1.cs And Service implementation is as below, Service1.svc.cs Now we have a service. Now at the client side (Say it as client1) we are calling the service as below Program.cs Output Now let us go aheadContinueContinue reading “Versioning in WCF Data Contract Part #2: Missing Members”
Versioning in WCF Data Contract Part #1: Adding New Members
DataContract versioning requires when some modification has been done to the existing DataContract exposed to the client from the service or vice versa. If either service or client is changing the schema of DataContract exposed then new version of DataContract come into action and both party involved in communication should be able to accommodate theContinueContinue reading “Versioning in WCF Data Contract Part #1: Adding New Members”
Serialization order in Data Contract
If you have a Data Contract in your WCF service as below, Student.cs On serialization properties of data contract will get serialized in alphabetical order. So at the client side serialized data contract will look like So we can see in serialized data contract at the client side properties are serialized in alphabetical order. NowContinueContinue reading “Serialization order in Data Contract”
IgnoreDataMember attribute in WCF POCO Serialization
POCO stands for PLAIN OLD CLR OBJECT. If in WCF we are using 1. Complex Data type for example custom class 2. And not attributing this custom class as DataContract and properties of the class as DataMember 3. If we want to expose the below custom class to client and not using DataContractSeraliazer then allContinueContinue reading “IgnoreDataMember attribute in WCF POCO Serialization”