ALTER ENDPOINT (Transact-SQL)

Consente di modificare un endpoint esistente tramite:

  • L'aggiunta di un nuovo metodo a un endpoint esistente.

  • La modifica o l'eliminazione di un metodo esistente dall'endpoint.

  • La modifica delle proprietà di un endpoint.

[!NOTA]

In questo argomento vengono descritti la sintassi e gli argomenti specifici dell'istruzione ALTER ENDPOINT. Per le descrizioni degli argomenti comuni sia a CREATE ENDPOINT che a ALTER ENDPOINT, vedere CREATE ENDPOINT (Transact-SQL).

In SQL Server 2008 i Servizi Web XML nativi (endpoint SOAP/HTTP) sono obsoleti. Per ulteriori informazioni, vedere Servizi Web XML nativi: obsoleti in SQL Server 2008.

Icona di collegamento a un argomentoConvenzioni della sintassi Transact-SQL

Sintassi

ALTER ENDPOINT endPointName
[ STATE = { STARTED | STOPPED | DISABLED } ]
[ AS { TCP | HTTP } ( <protocol_specific_items> ) ]
[ FOR { SOAP | TSQL | SERVICE_BROKER | DATABASE_MIRRORING } (
   <language_specific_items>
        ) ]

<AS HTTP_protocol_specific_arguments> ::=
AS HTTP (
  [ [ , ] PATH = 'url' ]
  [ [ , ] PORTS = ( { CLEAR | SSL } [ ,...n ] ) ]
  [ [ , ] SITE = { '*' | '+' | 'webSite' } , ]
  [ [ , ] CLEAR_PORT = clearPort ]
  [ [ , ] SSL_PORT = SSLPort ]
  [ [,] AUTHENTICATION = ( { BASIC | DIGEST | NTLM | KERBEROS | INTEGRATED } [ ,...n ] ) ]
  [ [ , ] AUTH_REALM = { 'realm' | NONE } ]
  [ [ , ] DEFAULT_LOGON_DOMAIN = { 'domain' | NONE } ]
  [ [ , ] COMPRESSION = { ENABLED | DISABLED } ]
)

<AS TCP_protocol_specific_arguments> ::=
AS TCP (
  LISTENER_PORT = listenerPort
  [ [ , ] LISTENER_IP = ALL | ( 4-part-ip ) | ( "ip_address_v6" ) ]
)

<FOR SOAP_language_specific_arguments> ::=
FOR SOAP (
  [ { ADD WEBMETHOD [ 'namespace' .] 'method_alias' 
    (   NAME = 'database.owner.name'
      [ , SCHEMA = {NONE | STANDARD | DEFAULT } ]
      [ , FORMAT = { ALL_RESULTS | ROWSETS_ONLY | NONE} ]
    )  
  } [ ,...n ] 
  ]

  [ { ALTER WEBMETHOD [ 'namespace' .] 'method_alias' 
    (   NAME = 'database.owner.name'
      [ , SCHEMA = {NONE | STANDARD | DEFAULT} ]
      [ , FORMAT = { ALL_RESULTS | ROWSETS_ONLY } ]
    )  
  } [ ,...n] 
]
  [ [ , ] { DROP WEBMETHOD [ 'namespace' .] 'method_alias' } [ ,...n ] ]
  [ [ , ] BATCHES = { ENABLED | DISABLED } ]
  [ [ , ] WSDL = { NONE | DEFAULT | 'sp_name' } ]
  [ [ , ] SESSIONS = { ENABLED | DISABLED } ]
  [ [ , ] LOGIN_TYPE = { MIXED | WINDOWS } ]
  [ [ , ] SESSION_TIMEOUT = timeoutInterval ]
  [ [ , ] DATABASE = { 'database_name' | DEFAULT } ]
  [ [ , ] NAMESPACE = { 'namespace' | DEFAULT } ]
  [ [ , ] SCHEMA = { NONE | STANDARD } ]
  [ [ , ] CHARACTER_SET = { SQL | XML } ]
  [ [ , ] HEADER_LIMIT = int ]
)

<FOR SERVICE_BROKER_language_specific_arguments> ::=
FOR SERVICE_BROKER (
   [ AUTHENTICATION = { 
      WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ]
      | CERTIFICATE certificate_name 
      | WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ] CERTIFICATE certificate_name 
      | CERTIFICATE certificate_name WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ] 
    } ]
   [ , ENCRYPTION = { DISABLED 
       | 
         {{SUPPORTED | REQUIRED } 
       [ ALGORITHM { RC4 | AES | AES RC4 | RC4 AES } ] } 
   ]

  [ , MESSAGE_FORWARDING = {ENABLED | DISABLED} ]
  [ , MESSAGE_FORWARD_SIZE = forwardSize
)

<FOR DATABASE_MIRRORING_language_specific_arguments> ::=
FOR DATABASE_MIRRORING (
   [ AUTHENTICATION = { 
      WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ]
      | CERTIFICATE certificate_name 
      | WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ] CERTIFICATE certificate_name 
      | CERTIFICATE certificate_name WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ] 
    } ]
   [ , ENCRYPTION = { DISABLED 
       | 
         {{SUPPORTED | REQUIRED } 
       [ ALGORITHM { RC4 | AES | AES RC4 | RC4 AES } ] } 
    ] 
   [ , ] ROLE = { WITNESS | PARTNER | ALL }
)

Argomenti

[!NOTA]

Gli argomenti seguenti sono specifici dell'istruzione ALTER ENDPOINT. Per una descrizione degli altri argomenti, vedere CREATE ENDPOINT (Transact-SQL).

  • ADD WEBMETHOD
    Aggiunge un nuovo endpoint di metodo.

    Nota importanteImportante

    Se si utilizza ADD WEBMETHOD per l'esposizione dei metodi, è necessario accertarsi che non si verifichino sovrapposizioni di nomi se più database di SQL Server vengono elaborati dallo stesso endpoint HTTP. Per evitare ciò, aggiungere l'URL del nome di dominio registrato nel percorso dello spazio dei nomi.

  • ALTER WEBMETHOD
    Modifica la definizione di un endpoint di metodo esistente.

  • AS { TCP | HTTP }
    Non è possibile modificare il protocollo di trasporto con ALTER ENDPOINT.

  • AUTHORIZATION login
    L'opzione AUTHORIZATION non è disponibile in ALTER ENDPOINT. La proprietà può essere assegnata solo quando l'endpoint viene creato.

  • DROP WEBMETHOD
    Elimina un endpoint di metodo esistente.

  • FOR { SOAP | TSQL | SERVICE_BROKER | DATABASE_MIRRORING }
    Non è possibile modificare il tipo di payload con ALTER ENDPOINT.

Osservazioni

Se si utilizza ALTER ENDPOINT, specificare solo i parametri che si desidera aggiornare. Tutte le proprietà di un endpoint esistente rimangono invariate a meno che non vengano modificate in modo esplicito.

Non è possibile eseguire le istruzioni ENDPOINT DDL all'interno di una transazione utente.

Per informazioni sulla scelta di un algoritmo di crittografia da utilizzare con un endpoint, vedere Scelta di un algoritmo di crittografia.

[!NOTA]

RC4 è un algoritmo relativamente vulnerabile, mentre AES costituisce un algoritmo relativamente avanzato ma notevolmente più lento rispetto a RC4. Se la protezione ha una priorità superiore rispetto alla velocità, è consigliabile utilizzare AES.

Autorizzazioni

L'utente deve essere membro del ruolo predefinito del server sysadmin, proprietario dell'endpoint oppure disporre dell'autorizzazione ALTER ANY ENDPOINT.

Per modificare la proprietà di un endpoint esistente, è necessario utilizzare l'autorizzazione ALTER AUTHORIZATION. Per ulteriori informazioni, vedere ALTER AUTHORIZATION (Transact-SQL).

Per ulteriori informazioni, vedere GRANT - autorizzazioni per endpoint (Transact-SQL).

Esempi

A. Aggiunta di un nuovo metodo a un endpoint esistente

Nell'esempio seguente viene aggiunto un nuovo metodo all'endpoint sql_endpoint precedentemente creato.

ALTER ENDPOINT sql_endpoint
FOR SOAP
(
  ADD WEBMETHOD 'SayHello' (name='AdventureWorks.dbo.SayHello')
);

B. Aggiunta di un nuovo metodo che funziona in modalità RAW SOAP

Nell'esempio seguente viene aggiunto un nuovo metodo Web ReportUsageStats che funziona in modalità RAW, specificato tramite FORMAT=NONE, per recapitare i risultati di una stored procedure ai client SOAP senza modificarli. Per ulteriori informazioni, vedere la descrizione dell'opzione FORMAT in CREATE ENDPOINT (Transact-SQL).

ALTER ENDPOINT sql_endpoint
FOR SOAP
(
  ADD WEBMETHOD 'ReportUsageStats' (name='myDatabase.dbo.sp_reportserverstats', FORMAT=NONE)
);

Cronologia modifiche

Aggiornamento del contenuto

Aggiornamento della sezione Argomenti per la descrizione di operazioni aggiuntive non consentite.