Chapter13.http endpoint
I understanding HTTP Endpoint Security
1 sever layers of HTTP endppint Security
(1) Endpoint Type -- TCP/HTTP (s)
(2) Endpoint payload -- the participating subset of traffic that the endpoint allows. tsql, soap, service_broker, and database_processing ing
But an HTTP endpont allows only ont type paylpad --- soap
(3) endpint state -- started | stopped (default state) | disabled
(4) authentication method -- Windows authentication or certificates
(5) encryption -- specify the ports clause to set the communication is in clear text or SSL
(6) login type -- specify the login_type to set the type of login, winodws | mixed
(7) endpiont permissions -- Grant the connect permission on the endpoint
II create a secure HTTP endpoint
1 create an HTTP endpoint
(1) Use create endpont statement to create an endpoint, including an HTTP endpont.
(2) It nodes des two section.
First: sepcify the protocol.
Second: Define the payload.
(3) Important paramenter: Required age_specific_arguments
(4) alter endpoint, drop endpoint
2 specifying web methods
(1) web methods simply expose stored procedures and functions as public method that a Web service can call. In the webmethod portion
Of the soap payload's language-specific argumens, you map specific stored procedures and fucntions you want to expose in the endpoint
As web methods
3 specifying WSDL support, schemas, and namespaces
(1) WSDL: None | default
(2) Schema, an HTTP endpoint has a default schema option that can be overridden by a participant webmethod, if choosen.
If you specify none for the schema, an inline XSD is not retrned in the soap request. If you specify the standard, an inline
XSD is returned along with the result set
(3) The soap payload enables you to specify an explicit namespace for an HTTP endpoint. The default namespace for each webmethod
4 additional soap payload parmeters
(1) batched options controls whether a connection can isue ad hoc SQL queries against the endpoint.
(2) by enabling seesions support, muitiple SOAP request/response pairs are treated as a single soap session.
(3) database option, the connection to the HTTP endpoint changes context to the database that you specified; otherwise,
Default database defined for the login is used.
5 practice
(1) Create an htt endpoint through SMO
Create HTTP endpoint
Create Endpoint sample_endpoint
State = Started
As HTTP
(
Path = ' /Httpendpoint ' ,
Authentication = (Integrated ),
Ports = (Clear ),
Site = ' Servername '
)
For Soap
(
Webmethod ' Listsample ' (Name = ' CMDB. DBO. sp_http_endpoint_sample ' , Schema = Default , Format = All_results ),
WSDL = Default ,
Database = ' Databasename ' ,
Namespace = ' Http://temUri.org '
)
(2) test whether it is created successfully. Access http: // servername/httpendpoint? WSDL
(3) create a Windows application to send SOAP requests
A drop-down list control, a button control, and core code
SOAP request code
Servername. sample_endpoint proxy = New Servername. sample_endpoint ();
Proxy. Credentials = System. net. credentialcache. defaultcredentials;
Object [] Results = Proxy. listsample ();
For ( Int J = 0 ; J < Results. length; j ++ )
{
Object E1 = Results [J];
Switch (E1.tostring ())
{
Case " Httpendpointapp. servername. sqlrowcount " :
// Get the row count
Break ;
Case " System. xml. xmlelement " :
// Get the XML result
Xmlelement xmlresult = (Xmlelement) Results [J];
// Transfer the string to Dataset
Dataset DS = New Dataset ();
DS. readxml ( New Memorystream (encoding. getencoding ( " UTF-8 " ). Getbytes (xmlresult. outerxml )));
// Bind data
This . Combobox1.datasource = DS. Tables [ 0 ]. Defaultview;
This . Combobox1.displaymember = " Datatablecolumnname " ;
Break ;
Case " Httpendpointapp. servername. sqlmessage " :
// Get the SQL message
Break ;
}
}
6. Unfortunately, Microsoft has already stated that Microsoft SQL server will delete this function in subsequent versions.