Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Web Services z Problem with .NET remoting and other middleware standards z Solution z The Web services standard is more high level and flexible than other standards and therefore has wide industry support – – They are not compatible with each other Define a higher level standard, in this case, Web services – Supports a service oriented architecture – The base protocols are SOAP over HTTP over TCP/IP Define standard XML based ways of representing services, publishing them, discovering them, and learning their specification z – z Stateless, although it is still possible to use session cookies Web services support in .NET – – ASP.NET – basic support, only RPC style communication WSE – extended support, including security and messaging The General Web Services Architecture UDDI UDDI SOAP SOAP Web Web Server Server SOAP Web Web Service Service Any Any Client Client 1 Main Web Services Components z Simple Object Access Protocol (SOAP) – – z Web Service Description Language (WSDL) – – z An extendible XML based standard for describing service Includes the capabilities of an IDL + semantic description of the service DISCO – z Extendible XML based RPC protocol Serialization standard (XSD) A simple protocol for publishing available services Universal Description, Discovery and Integration (UDDI) – A yellow pages directory for services z z Support both semantic and syntactic description of services Supports discovery Web Services Operation in Practice Find a Service http://www.uddi.org Link to DISCO or WSDL document UDDI Discovery Web Service Consumer http://yourservice.com HTML or XML with a link to WSDL How do we talk? (WSDL) Web Service http://yourservice.com?WSDL XML with service descriptions Let me talk to you (SOAP) http://yourservice.com/svc1 XML/SOAP BODY DesignDesign-Time or Dynamic Runtime 2 UDDI Data Structures Business: Business: Information Information about about the the entity entity who who offers offers aa service service tModel: tModel: Descriptions Descriptions of of specifications specifications for for services services Name, Name, contact, contact, description description and and categorization categorization of of the the provider provider Pointer Pointer to to aa WSDL WSDL file file Service: Service: Descriptive Descriptive information information about about aa particular particular family family of of technical technical offerings offerings Name, Name, description description and and categorization categorization of of the the service service Binding: Binding: Technical Technical information information about about aa service service entry entry point point Access Access point(s) point(s) for for the the service service WSDL Documents z Types z Message z Operation z Port Type – – – – – A container for data type definitions using some type system (such as XSD). An abstract, typed definition of the data being communicated. An abstract description of an action supported by the service. An abstract set of operations supported by one or more endpoints. By default: One-way, Request-response, Solicit-response, and Notification z Binding z Port – – z A concrete protocol and data format specification for a particular port type. A single endpoint defined as a combination of a binding and a network address. Service – A collection of related endpoints. 3 SOAP Elements z z z Envelope (mandatory) – Top element of the XML document representing the message Header (optional) – Determines how a recipient of a SOAP message should process the message – Adds features to the SOAP message such as authentication, transaction management, message routes, etc… Body (mandatory) – Exchanges information intended for the recipient of the message. – Typical use is for RPC calls and error reporting. POST /HelloWorld/Hello.asmx HTTP/1.1 Host: localhost Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/Add" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope …> <soap:Header> <AuthHeader xmlns="http://tempuri.org/"> <Username>avi</Username> <Password>xM76w@</Password> </AuthHeader> </soap:Header> <soap:Body> <Add xmlns="http://tempuri.org/"> <a>23</a> <b>44</b> </Add> </soap:Body> </soap:Envelope> 4 SOAP Faults z z z Used to carry error and/or status information within a SOAP message Appears within the SOAP body Defines the following: – – – – faultcode (mandatory) Faultstring (mandatory) faultactor (optional) Detail <SOAP:Fault> <faultcode>SOAP:Server</faultcode> <faultstring>Internal Application Error</faultstring> <detail xmlns:f=“http://www.a.com/CalculatorFault”> <f:errorCode>794634</f:errorCode> <f:errorMsg>Divide by zero</f:errorMsg> </detail> </SOAP:Fault> Web Services Enhancement z Core WSE functionality implemented as input and output filters Output Filters Client Server Input Filters z z z Input Filters Output Filters The use of IO filters is encapsulated by the pipeline class Pipeline can be extended with custom filters Pipeline can be configured per-proxy or per-process 5 Server Integration HttpContext.Current Input Filter HttpHttpRequest Output Filter Input Filter Output Filter Input Filter Output Filter WebServicesExtension HttpHttpContext SoapSoapContext Web Service HttpHttpResponse SoapSoapContext Pipeline ResponseSoapContext.Current RequestSoapContext.Current Proxy Integration RequestSoapContext Output Filter Input Filter SoapWebSoapWebResponse Output Filter ProxyClass Input Filter WebServicesWebServicesClientProtocol Output Filter SoapWebSoapWebRequest Input Filter SoapContext Pipeline SoapContext ResponseSoapContext 6