SOAP Toolkit


Microsoft realized the need to start getting developers moving in the SOAP direction, so until all the new server products come out that natively support SOAP, or Web services, we need to leverage our existing applications and knowledge to implement SOAP solutions now. The SOAP Toolkit is a download from MSDN that helps you move in the right direction. If you haven’t downloaded it yet, grab it and install it on your development machine. With the SOAP Toolkit, you have a simple wizard that takes existing COM or .NET components you have written and creates all the files necessary to execute SOAP method calls-it does all the dirty work for you.

Here is how it works: Tell the SOAP Wizard which COM component you want to execute method calls against. The toolkit then creates an XML file containing the SDL, or Service Description Language, which is unique to your method calls in the component that describes the methods I am publishing. During the wizard process, a couple things happen: First, a listener file is created, either as an ASP page or an ISAPI application. This file “listens” for incoming SOAP calls on your server. The wizard also creates an Active Server Page that has is actually a wrapper function for your COM component. The cool thing about the ASP is that you can add any custom business logic that you desire, it just gives you the code needed to call the methods. Sounds easy, right? Well, there is one more thing we forgot to talk about, and that is ROPE.

SQL Server 2005 SOAP Endpoints for Web Services

SOAP endpoints are a new XML feature now supported in SQL Server 2005. They essentially allow a Web service consuming client, as described earlier, to access SQL Server objects, such as stored procedures and functions, using either CLR-based objects or traditional T-SQL functionality.

The following example creates an endpoint called my_endpoint, with the following method: NumberAsMonth, based on the CLR function we discussed in Chapter 14.

 CREATE ENDPOINT my_endpoint STATE = STARTED AS HTTP(    PATH = '/sql',    AUTHENTICATION = (INTEGRATED),    PORTS = (CLEAR),    SITE = 'SERVER'    ) FOR SOAP (    WEBMETHOD 'NumberAsMonth' (name='master.sys.NumberAsMonth'),    WSDL = DEFAULT,    SCHEMA = STANDARD,    DATABASE = 'master',    NAMESPACE = 'http://tempUri.org/'    ); GO 

A client can now consume the end point as it would any Web service, by simply referencing the Web service and the exposed method in its code.




Microsoft SQL Server 2005. The Complete Reference
Microsoft SQL Server 2005: The Complete Reference: Full Coverage of all New and Improved Features
ISBN: 0072261528
EAN: 2147483647
Year: 2006
Pages: 239

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net