SQL Server 2016 – How to Create SOAP Endpoint

sql server

When I'm trying to create a SOAP endpoint in SQL Server 2016:

CREATE ENDPOINT Weather_CurConditions
STATE = Started
AS HTTP
(
    PATH = '/CurrentConditions',
    AUTHENTICATION = (INTEGRATED),
    PORTS = (CLEAR), CLEAR_PORT = 8080,
    SITE = '*'
)
FOR SOAP
(
    WEBMETHOD 'GetWeather'(NAME = 'Weather.dbo.usp_GetWeather'),
    WSDL = DEFAULT,
    DATABASE = 'Weather',
    NAMESPACE = DEFAULT
);

I get the following error:

Msg 7878, Level 16, State 1, Line 1

This "CREATE ENDPOINT" statement is not supported on this edition of SQL Server.

Here is the output of SELECT @@VERSION:

Microsoft SQL Server 2016 (RTM) – 13.0.1601.5 (X64)
  Apr 29 2016 23:23:58
  Copyright (c) Microsoft Corporation
  Enterprise Edition (64-bit) on Windows 8.1 Enterprise 6.3 (Build 9600: )

What can I do ?

Best Answer

You can no longer use SOAP/HTTP endpoints. This isn't a SQL Server 2016 problem, since this would not have worked in 2014 either. From the documentation on CREATE ENDPOINT:

NOTE: Native XML Web Services (SOAP/HTTP endpoints) was removed in SQL Server 2012.

It has been deprecated for at least 8 years (this is the oldest version of the current document I could find):

If you look at that document, you will see that "The CREATE ENDPOINT or ALTER ENDPOINT statement with the FOR SOAP option" was deprecated at that time. Their suggestion for a replacement is to "Use Windows Communications Foundation (WCF) or ASP.NET instead."

Arguably, there could be a better error message, like the following (emphasis mine):

Msg 7877, Level 16, State 1
SOAP/HTTP endpoints are no longer supported in this version of SQL Server.

But your workarounds remain the same:

  1. Continue using an older version of SQL Server.
  2. Find another source for this information that doesn't require this type of information.
  3. As the docs suggest, don't try to make SQL Server perform this work (it's not a web browser) - e.g. create an application or service that stores the data in SQL Server.