

create role bar 
create certificate foo authorization bar with subject = 'foo'

select * from sys.endpoints

sp_reserve_http_namespace N'http://*:80/pubspath'

drop endpoint pubsendpoint
create endpoint pubsendpoint
STATE = STARTED
AS HTTP
(
  site = '*',
  path = '/pubspath',
  authentication = (integrated),
  ports = (clear)
)
FOR SOAP
(
 WEBMETHOD 
  'http://somens'.'somemethod' (name='pubs.dbo.byroyalty', SCHEMA=STANDARD),
  WSDL = DEFAULT,
  DATABASE = 'pubs',
  BATCHES = ENABLED,
  NAMESPACE = 'urn:somns'
)