Share via


Özel WSDL uygulamayı kullanarak

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

Özel WSDL oluşturucu örnek uygulama ayarlamak için , aşağıdaki görevleri gerçekleştirmek için gerekenler:

  • Belirli, WSDL desteklemek için özel bir WSDL işleyicisi uygulama oluşturun.

    Bu görevi tamamlamak için , bkz: Uygulama özel WSDL oluşturma.

  • Yükleme, yapılandırma SQL Server kaydolun ve özel WSDL işleyicisi kullanmak için.

Bu görev için yüklemenizi aşağıdaki değişiklikleri yürüten bir dağıtım komut dosyası oluşturma içerir. SQL Server:

  • Sunucuya özel WSDL derleme (CustomWSDL.dll) ekler ve bunu, ASSEMBLY ADD Ekstresi ile kullanmak için kaydeder.

  • Özel WSDL işleyicisi uygulamanız doğru çalışabilmek için bağımlı tüm ek saklı yordamlar oluşturur.

  • Oluşturur veya değiştirir, at the örnek of bir HTTP bitiş noktası SQL Server Böylece, BT, özel bir WSDL işleyicisi kullanmak ve bir özel WSDL yanıtı yerine, varsayılan veya basit bir WSDL yanıt döndürür.

Özel WSDL işleyicinin dağıtma

Aşağıdaki yordam çalıştıran bir bilgisayarda yerel yönetici olarak oturum açtığınızdan emin varsayar. SQL Server, veya için uzaktan yönetici ayrıcalıkları ile bağlanabilirsiniz.

Bölüm 1: Sunucu yapılandırın.

  1. Içinde SQL Server Management Studio,'ı tıklatın Yeni bir sorgu ve sunucuya bağlanın.

  2. Aşağıdakileri kopyalayın. Transact-SQL Sorgu penceresine komut dosyası.

    USE master 
    GO
    
    -- Drop myWSDL procedure if it exists.
    IF (SELECT count(*) FROM sysobjects WHERE name = 'myWSDL') = 1 
    DROP PROCEDURE myWSDL
    GO
    
    -- Drop CustomWSDL assembly if it exists.
    DROP ASSEMBLY CustomWSDL
    GO
    
    -- Update the path to the compiled assembly as necessary.
    CREATE ASSEMBLY CustomWSDL FROM 'C:\temp\CustomWSDL.dll'
    GO 
    
    -- Create a stored procedure to map to the common lanugage
    -- runtime (CLR) method As with any other SQL Server stored procedure
    -- that maps to a CLR method, the actual stored procedure name 
    -- ('myWSDL') can be arbitrarily specified.
    CREATE PROCEDURE myWSDL
    (
    @endpointID as int,
    @isSSL as bit,
    @host as nvarchar(256),
    @queryString as nvarchar(256),
    @userAgent as nvarchar(256)
    )
    AS EXTERNAL NAME CustomWSDL.[MSSql.CustomWSDL].GenerateWSDL
    GO
    
    -- Follow the security guidelines set up for your environment.
    -- The following example is meant to be used for development or 
    -- testing purposes only.
    GRANT EXEC on myWSDL to [PUBLIC]
    GO
    
    -- The following is a sample stored procedure (InOut) that
    -- demonstrates the configuration of an HTTP endpoint. 
    -- If the InOut stored procedure already exists, it is dropped.
    IF (SELECT count(*) FROM sysobjects WHERE name = 'InOut') = 1 DROP PROC InOut
    GO
    
    CREATE PROC InOut
             @InParam int,
             @OutParam nvarchar(100) output
    AS
    SELECT * FROM syslanguages WHERE langid = @InParam
    SELECT @OutParam = [name] FROM syslanguages WHERE langid = @InParam
    PRINT @OutParam
    SELECT * FROM syslanguages WHERE langid = @InParam FOR XML raw, XMLSCHEMA
    RETURN 1
    GO
    GRANT EXEC on InOut to [PUBLIC]
    
    -- The following creates a sample HTTP endpoint to demonstrate 
    -- the endpoint setup. If the sample endpoint already exists, it
    -- is first dropped.
    IF (SELECT count(*) FROM [msdb].sys.http_endpoints WHERE name = 'sql_endpoint') = 1
    DROP ENDPOINT sql_endpoint
    GO
    
    CREATE ENDPOINT sql_endpoint
             STATE=STARTED
    AS HTTP (
             SITE='*',
             PATH='/sql/WSDL',
             PORTS=(CLEAR),
             CLEAR_PORT=80,
             AUTHENTICATION=(DIGEST, INTEGRATED)
    )
    FOR SOAP
    (
             WEBMETHOD 'http://myNS.com/'.'InOut' ( NAME='master.dbo.InOut' ),
             DATABASE = 'master',
             WSDL='master.dbo.myWSDL',
             Batches=enabled,
             SCHEMA = STANDARD
    )
    
    GRANT CONNECT ON ENDPOINT::sql_endpoint to [PUBLIC]
    
  3. Komut dosyasını yürütün.

Bölüm 2: Handler sınama

Özel WSDL emin olmak için işleyici işlevleri düzgün değiştirilmiş URL sorgu dizeleri özel bir WSDL istemek için kullanmayı deneyin.Örneğin, örnek SQL Server Bağlanmakta olduğunuz emin olarak adlandırılır MyServer ve önceki komut dosyası, bir son nokta yol sunucuda kurulmuş olması gerekir sql/WSDL, hangi özel WSDL işleyicisi kullanarak yanıt verir. Bu nedenle, bu bitiş noktasına bağlanma sınamak ve özel bir WSDL isteği sağlamak için aşağıdaki gibi bir URL HTTP Web tarayıcı istemcisinde kullanır:

http://MyServer/sql/WSDL?wsdlargument

Değeri bağımsız değişken dizelerin her biri farklı bir istemci ve WSDL türleri için destek aşağıdaki özel WSDL tanımlayıcıları herhangi biri olabilir.

Özel bir WSDL URL'SI

Açıklama

everett

Kullanılarak geliştirilen basit Web istemcileri için Visual Studio 2003 geliştirici araçları.

jbuilder

Borland JBuilder 9.0 geliştirici araçları kullanılarak geliştirilen basit Web istemcileri için.

glue

WebMethods Yapıştırıcı 5.0.1 geliştirici araçları kullanılarak geliştirilen basit Web istemcileri için.

Aşağıdaki gösterildiği gibi tablo, <argument> Basit bir WSDL (XSD yerel türleri) için bu özel seçim tüm üç döndürür; ancak, tam WSDL genişletilmiş istiyorsanız, append extended Sorgu için bağımsız değişken dizesi.

Basit bir WSDL tanıtıcısı

Genişletilmiş WSDL tanıtıcısı

http://MyServer/sql/WSDL?wsdleverett

http://MyServer/sql/WSDL?wsdleverettextended

http://MyServer/sql/WSDL?wsdljbuilder

http://MyServer/sql/WSDL?wsdljbuilderextended

http://MyServer/sql/WSDL?wsdlglue

http://MyServer/sql/WSDL?wsdlglueextended