Skip to content

SA0221 : The FOR SOAP option in CREATE/ALTER ENDPOINT statement is deprecated

The deprecated FOR SOAP option in CREATE or ALTER ENDPOINT statements can cause compatibility issues with future SQL Server versions.

With the release of SQL Server 2012, Native XML Web Services (SOAP/HTTP endpoints) support was removed, rendering FOR SOAP options obsolete. T-SQL scripts that still utilize this functionality may encounter compatibility issues when upgrading or maintaining SQL Server systems.

For example:

-- Problematic endpoint creation using FOR SOAP
CREATE ENDPOINT SqlEndpoint
STATE = STARTED
AS HTTP
(
PATH = '/sql'
)
FOR SOAP
(
WEBMETHOD 'Add'
(name='MyNamespace.MyStoredProcedure'),
BATCHES = ENABLED,
WSDL = DEFAULT,
LOGIN_TYPE = MIXED
);

This example attempts to create a SOAP endpoint, a feature that is no longer supported by SQL Server starting from version 2012. As a result, the script will fail to execute in these newer environments.

  • Using deprecated features can lead to system incompatibility and maintenance challenges.

  • It can also increase the risk of security vulnerabilities due to reliance on outdated technologies.

`

Avoid using the deprecated FOR SOAP option in CREATE or ALTER ENDPOINT statements as it is not supported in SQL Server versions 2012 and later.

Follow these steps to address the issue:

1.Identify any CREATE ENDPOINT or ALTER ENDPOINT statements using the FOR SOAP option in your existing T-SQL scripts.

2.Remove the FOR SOAP option from these statements. SOAP endpoints are not supported after SQL Server 2012, and any functionality relying on SOAP should be refactored to use other supported communication methods such as REST APIs.

3.Test your modified scripts to ensure that they execute correctly without the FOR SOAP option and that all functionality is preserved using the new methods.

For example, the following T-SQL code illustrates the removal of a deprecated FOR SOAP option:

-- Example of corrected endpoint creation without FOR SOAP
-- Note: Implement alternative communication methods, as SOAP is unsupported
CREATE ENDPOINT SqlEndpoint
STATE = STARTED
AS HTTP
(
PATH = '/sql'
);

The rule has a Batch scope and is applied only on the SQL script.

Rule has no parameters.

The rule does not need Analysis Context or SQL Connection.

8 hours per issue.

Deprecated Features, Bugs

Deprecated Database Engine Features in SQL Server 2017

CREATE ENDPOINT FooEndpoint
STATE = Started
AS HTTP
(
PATH = '/Foo',
AUTHENTICATION = (INTEGRATED),
PORTS = (CLEAR), CLEAR_PORT = 8080,
SITE = '*'
)
FOR SOAP
(
WEBMETHOD 'FooMethod'(NAME = 'FooDatabase.FooSchema.uspFoo'),
WSDL = DEFAULT,
DATABASE = 'FooDatabase',
NAMESPACE = DEFAULT
);
ALTER ENDPOINT FooEndpoint
FOR SOAP
(
ADD WEBMETHOD 'Foo2Method'(NAME = 'FooDatabase.FooSchema.uspFoo2')
);
  Message Line Column
1 SA0221 : The FOR SOAP option in CREATE/ALTER ENDPOINT statement is deprecated. 10 4
2 SA0221 : The FOR SOAP option in CREATE/ALTER ENDPOINT statement is deprecated. 19 4

Analysis Rules