Skip to main content


Showing posts from September, 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