SA0221 : The FOR SOAP option in CREATE/ALTER ENDPOINT statement is deprecated
Introduction
Section titled “Introduction”The deprecated FOR SOAP option in CREATE or ALTER ENDPOINT statements can cause compatibility issues with future SQL Server versions.
Description
Section titled “Description”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 SOAPCREATE ENDPOINT SqlEndpointSTATE = STARTEDAS 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.
`
How to fix
Section titled “How to fix”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 unsupportedCREATE ENDPOINT SqlEndpointSTATE = STARTEDAS HTTP( PATH = '/sql');The rule has a Batch scope and is applied only on the SQL script.
Parameters
Section titled “Parameters”Rule has no parameters.
Remarks
Section titled “Remarks”The rule does not need Analysis Context or SQL Connection.
Effort To Fix
Section titled “Effort To Fix”8 hours per issue.
Categories
Section titled “Categories”Deprecated Features, Bugs
Additional Information
Section titled “Additional Information”Deprecated Database Engine Features in SQL Server 2017
Example Test SQL
Section titled “Example Test SQL”CREATE ENDPOINT FooEndpointSTATE = StartedAS 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 FooEndpointFOR SOAP( ADD WEBMETHOD 'Foo2Method'(NAME = 'FooDatabase.FooSchema.uspFoo2'));Analysis Results
Section titled “Analysis Results”| 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 |