WCF Callback function – FileSystemWatcher

FileSystemWatcher class allows to get notification on any change in the directory. The notification can be even filtered by changes like rename, delete and all. File types can be specified to the class to allow notification for a particular file types. Code Snippet Dim watchFile As New FileSystemWatcher()         watchFile.Filter = ConfigurationManager.AppSettings.Item("FileType")         watchFile.IncludeSubdirectories =... Continue Reading →

WCF Service Error Hosting – Adding reference to netTcp binding service error

  System.InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].   at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:8732/Callback.ServiceLibrary/CallbackService/'.The socket connection was aborted. This could be caused by an error processing your message or... Continue Reading →

Serialize the Data to XML

public static String SerializeInterface(object SerializedObject)       {           using (MemoryStream stream = new MemoryStream())           {               XmlSerializer serializer = null;               if (SerializedObject.GetType() == typeof(INTERFACE_ERRORS))               {                   serializer = new XmlSerializer(typeof(INTERFACE_ERRORS));                   INTERFACE_ERRORS o = (INTERFACE_ERRORS)SerializedObject;                   serializer.Serialize((Stream)stream, o);               }               else if (SerializedObject.GetType() == typeof(DETAILS_TO_SUB_SYSTEM))               {                   serializer = new XmlSerializer(typeof(DETAILS_TO_SUB_SYSTEM));                   DETAILS_TO_SUB_SYSTEM details_to_sub_system = (DETAILS_TO_SUB_SYSTEM)SerializedObject;                   serializer.Serialize((Stream)stream, details_to_sub_system);               }                stream.Seek(0L, SeekOrigin.Begin);               byte[] buffer... Continue Reading →

XSD Based Programming for WCF Service

Recently i presented a session on SGDOTNET, Singapore about the XSD programming. The event happened on 8th July 2010. The topic is about the WCF service using the XSD approach.   Slide 1 : XSD Based WCF Service Slide 2: XSD Based WCF Service Part 2 Source: Sample.zip

WCF Service – A name was started with an invalid character. Error processing resource

Error Details: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. A name was started with an invalid character. Error processing resource 'http://SENWIN2008/WCF/Service/’ <%@ ServiceHost Language="C#" Debug="true" Service="Service Name" CodeBehind="Service.svc.cs" %> Resolution Check whether the IIS... Continue Reading →

Class to Validate XML Against XSD

Recently i was involved in programming generic interface for Submitting PO. I came across the XSD concept of programming. I used the XSD to validate xml passed from different sub system and serialize the data. Below is the sample code to validate the Xml against Xsd ///////////////////////////// using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml.Schema;using System.Xml;using System.IO;... Continue Reading →

WCF DataService with Custom Function and parameter

namespace Senthamil.Sample {     public class PORSS : DataService<ModelEntities>     {         // This method is called only once to initialize service-wide policies.         public static void InitializeService(DataServiceConfiguration config)         {             // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.             // Examples:             config.SetEntitySetAccessRule("RSS_STATUS", EntitySetRights.AllRead);            ... Continue Reading →

WCF Resources

Now after finishing with my mobile app for MOSS 2007, i have started writing a WCF service for SharePoint 2007. I found that the WebServices found in the SharePoint Server is not sufficient to do all the tasks which i want to perform through mobile. So i decided to create my own WCF service to... Continue Reading →

Create a website or blog at WordPress.com

Up ↑