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:
1-- Problematic endpoint creation using FOR SOAP 2CREATE ENDPOINT SqlEndpoint 3STATE = STARTED 4AS HTTP 5( 6 PATH = '/sql' 7) 8FOR SOAP 9( 10 WEBMETHOD 'Add' 11 (name='MyNamespace.MyStoredProcedure'), 12 BATCHES = ENABLED, 13 WSDL = DEFAULT, 14 LOGIN_TYPE = MIXED 15);
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:
-
Identify any CREATE ENDPOINT or ALTER ENDPOINT statements using the FOR SOAP option in your existing T-SQL scripts.
-
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.
-
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:
1-- Example of corrected endpoint creation without FOR SOAP 2-- Note: Implement alternative communication methods, as SOAP is unsupported 3CREATE ENDPOINT SqlEndpoint 4STATE = STARTED 5AS HTTP 6( 7 PATH = '/sql' 8);

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.


Deprecated Features, Bugs


SQL
1CREATE ENDPOINT FooEndpoint 2STATE = Started 3AS HTTP 4( 5 PATH = '/Foo', 6 AUTHENTICATION = (INTEGRATED), 7 PORTS = (CLEAR), CLEAR_PORT = 8080, 8 SITE = '*' 9) 10FOR SOAP 11( 12 WEBMETHOD 'FooMethod'(NAME = 'FooDatabase.FooSchema.uspFoo'), 13 WSDL = DEFAULT, 14 DATABASE = 'FooDatabase', 15 NAMESPACE = DEFAULT 16); 17 18ALTER ENDPOINT FooEndpoint 19FOR SOAP 20( 21 ADD WEBMETHOD 'Foo2Method'(NAME = 'FooDatabase.FooSchema.uspFoo2') 22); |

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 |
