Skip to main content

Posts

Showing posts from 2007

Calling Webmethods Asyncronously

If you are using any web reference in your Windows Forms application or Web Site there might have been numerous occasions when you make a call to any of the web methods exposed by the web service. Time taken by the web method to return is dependent on the network traffic and the method implementation. We cannot block the main thread to wait for the web method to return. This eats up the application responsiveness. It is advised to call the web methods asynchronously. For every web method in ASP.NET 2.0 Web Service there is a corresponding Asynchronous method. Web Service For the Webmethod Helloworld() we have an Async method HelloWorldAsycn(). An Event HelloWorldCompleted and Event argument HelloWorldCompletedEventArgs. Before making call to the async webmethod we need to attach a eventhandler corresponding to the completion of the method. In our case it is HelloWorldCompletedEventHandler . This is how the client application will make the call, and the service will callback the even

Data as Web Service

Using new advanced features of SQL Server 2005 we can expose stored procedures, user defined functions and even T-SQL statements as web services, providing access to the database.This gives new dimensions to a SOA because any HTTP SOAP (web) client be can access the database without any extra middleware. We can send SOAP/HTTP requests to SQL Server to execute: · Transact-SQL batch statements, with or without parameters. · Stored procedures extended stored procedures, and scalar-valued user-defined functions. SQL Server 2005 relies on 'HTTP.SYS' Kernel listener (driver) of Windows Server 2003 to expose its data objects as HTTP End points. It doesn't rely on IIS to expose these services. This simplifies application development and deployment, and requires fewer infrastructure components. Once the HTTP listener in Windows Server 2003 is configured in such a way that its able to send requests to SQL Server, The database administrator (DBA) can create and define the endpoints an

Microsoft Connected Services Framework

The Microsoft CSF is an integrated, server-based software product which enables service oriented architecture (SOA) to empower the creation and management of services across networks and devices. An interoperable, manageable, and scalable infrastructure of services can be integrated with the existing technologies. It enables an SOA to create new Web Services, update the existing one and aggregate services into a single distributed application. CSF helps to create, deploy and update applications that composed of web services. The basic built-in blocks of CSF performs identity or profile management or service discovery functionality and does not require taking care of those in services. Key Functions and Components Connected Services Framework consists of components (see Figure below) that provide environments for service creation, deployment, and execution of voice, data, and multimedia services, as well as system management. In addition, Connected Services Framework provides a platform

Service Oriented Architecture

Service Oriented Architecture (SOA) is an imminent version of the Component Based Architecture. It is an Interface Based Object Oriented Design.It can also be viewed as a Distributed System that communicates across the Internet.SOA is based on the use of distributed objects and components and is the next evolutionary step in computing environments. SOA does not have a standardized, reference model yet; however, implementations share the main concepts of services, service descriptions, advertising and discovery, the specification of an associated data model, and the use of a service contract. Although SOA and Web services are two separate but related entities, it is more important to realise the clear distinction between them. Web services, in the form of SOAP-based interapplication connections, has been highlighted, while SOA — a body of application architecture and design concepts — has largely been viewed as a side effect of Web services. An SOA, at its heart, is a collection of serv

XSD Schema Validation

The other day I was writing a .NET application which would read all the configuration details from an xml file.The application was not going to initialize properly unless the data in the config file were well formed.So I was wondering whether there was a way to validate an xml against some defined XSD schema. Thankfully there is. This is how I did it. ............................................. //Open the file with xml reader XmlTextReader reader = new XmlTextReader (configFilePath); //Some local path // Read the Schema XmlReader schemaReader = new XmlTextReader (schemaPath); //path of the XSD file XmlSchema schema = XmlSchema .Read(schemaReader , null); // Create a validating Reader for the text reader XmlValidatingReader validatingReader = new XmlValidatingReader (reader ); validatingReader.ValidationType = ValidationType.Schema; validatingReader.Schemas.Add(schema); // Add the Schema to validatingReader validatingReader.ValidationEventHandler += new ValidationEventHandler( t