Listing 2: T-SQL • Build the SOAP EndPoint
This code creates a SOAP endpoint and binds the two stored procedures created in Listing 1 to it. Note that the <i>authorization</i> setting specifies a valid login that is assigned ownership of the endpoint (the system administrator, in this case). If you don't assign a value to the authorization setting, ownership is assigned to the caller instead.
create endpoint eprocurement_purchasing
authorization sa
state=started
as http
(
path='/purchasing',
authentication = (integrated),
ports = (clear),
site = 'localhost'
)
for soap
(
webmethod 'SelectProduct'
(name =
'AdventureWorks.dbo.spSelectProduct',
schema = standard),
webmethod 'CreatePurchaseOrder'
(name =
'AdventureWorks.dbo.spCreatePurchaseOrder',
schema = standard),
wsdl = default,
schema = standard,
database = 'AdventureWorks'
);