CIS5930 Internet ComputingWeb Services BasicsXML Web Services ProtocolsWSDLWSDL SpecificationExample WSDLWSDL definition Root ElementThe WSDL message ElementsBuilt-in XSD SimpleTypesThe WSDL portType ElementMessage Exchange PatternsThe WSDL binding ElementWSDL SOAP BindingsWSDL SOAP Bindings (cont’d)SOAP Request MessageSOAP Response MessageUsing WSDLGenerating WSDL and Server Code with gSOAPImplementing a Web Service with gSOAPImplementing a Web Service with gSOAP (cont’d)Slide 21Slide 22Implementing a Concurrent Web Service with gSOAPImplementing a Client with gSOAPImplementing a Service with ASP.NET in VBImplementing a Client with SOAP::Lite for PerlSOAP Fault messagesSOAP 1.1 FaultsWSDL and SOAP FaultsSOAP HeadersSOAP Headers (cont’d)Slide 32SOAP RPC EncodingSOAP RPC Encoding (cont’d)Slide 35Slide 36RPC versus Doc/lit in WSDLRPC versus Doc/lit in WSDL (cont’d)Slide 39SOAP Request Message in Doc/Lit StyleSOAP Multi-ref EncodingStatic Structure Analysis for SOAP RPC EncodinggSOAP Constructs a Plausible Object Model for SerializationGenerating an XML Schema Definition for Serialized XMLGenerating Code for Runtime Points-To AnalysisGenerating Serialization CodeSerialization ExampleSerialization Example (cont’d)Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Slide 57Slide 58Deserialization ExampleDeserialization Example (cont’d)Slide 61Slide 62Slide 63Slide 64Slide 65Slide 66Slide 67Slide 68Converting a WSDL to Code with gSOAPWS-* Protocols and PluginsSOAP With MTOM AttachmentsSOAP With MTOM Attachments (cont’d)WS-AddressingWS-Addressing (cont’d)WS-SecurityUsername TokenSecurity TimestampsSignaturesSignature ExampleList of WS-* ProtocolsSlide 81Other Notable WS-* ProtocolsSlide 83To be continued…CIS5930Internet ComputingXML Web Services BasicsProf. Robert van EngelenCIS 5930 Fall 2006 201/13/19Web Services BasicsInteroperability has highest priorityXML over HTTPWeb services can be created regardless of the programming languageReusable application componentsSoftware can be reused as service components in a service-oriented architecture, i.e. to support the requirements of software usersCompositionality is realized with open standardsConnect existing softwarePublish the application as a serviceApplications connect and interact by encoding and decoding data in XMLCIS 5930 Fall 2006 301/13/19XML Web Services ProtocolsSOAP“Simple Object Access Protocol” is an XML messaging protocolTypically remote procedure call (RPC) request-response messagesOr XML-based messages (document/literal style)WSDL“Web Service Description Language” is an XML document that defines the service interface, protocol bindings, and service endpoint addressesUses XML schema to define XML typesTypically uses SOAP to bind the messaging protocolUDDI“Universal Description, Discovery and Integration” is a repository/database of services (e.g. defined by WSDLs)Not very popular, won’t discussCIS 5930 Fall 2006 401/13/19WSDLWSDL represents a contract between the service requestor and the service providerWSDL is an XML specification that defines four critical pieces of information of an XML Web service:1. Interface information describing all publicly available functions2. Data type information for all message requests and message responses3. Binding information about the transport protocol to be used4. Address information for locating the specified serviceCIS 5930 Fall 2006 501/13/19WSDL SpecificationThe definitions root element defines the name and namespace of the web serviceThe types element contains a set of XML schemas with all the data types (XML elements and types) used between the client and serverOne or more message elements define the names of the messages, each contains zero or more message part elements, which can refer to message parameters or message return valuesThe portType element combines multiple message elements to form a complete one-way or round-trip operationThe binding element describes how the service will be implemented on the wireThe service element defines the endpoint address for invoking the serviceQuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.CIS 5930 Fall 2006 601/13/19Example WSDLThe HelloService service provides a single publicly available function sayHelloThe function expects a single string parameter, and returns a single string greetingRequest-response message pattern over HTTP using HTTP POSTQuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.CIS 5930 Fall 2006 701/13/19WSDL definition Root ElementDefines the name and targetNamespace:<definitions name="HelloService” targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl” xmlns="http://schemas.xmlsoap.org/wsdl/” xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/” xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl” xmlns:xsd="http://www.w3.org/2001/XMLSchema”>Typically the xmlns namespace bindings are included in the root element and are used in the remainder of the WSDLNote that the WSDL namespace is declared as the default namespace for all of the other WSDL elements (http://schemas.xmlsoap.org/wsdl/) so these elements are not explicitly namespace qualifiedCIS 5930 Fall 2006 801/13/19The WSDL message ElementsTwo message elements are definedThe first represents a request message, SayHelloRequest, and the second represents a response message, SayHelloResponse:<message name="SayHelloRequest"> <part name="firstName" type="xsd:string"/></message><message name="SayHelloResponse"> <part name="greeting" type="xsd:string"/></message>For the request, the part specifies the function parametersFor the response, the part specifies the function return valuesThe type is a QName value, indicating the schema type of the partCIS 5930 Fall 2006 901/13/19Built-in XSD SimpleTypesSimple type Example Value(s)string Web Servicesboolean true, false, 1, 0float -INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaNdouble -INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaNdecimal -1.23, 0, 123.4, 1000.00integer -126789, -1, 0, 1, 126789nonPositiveInteger -126789, -1, 0negativeInteger -126789, -1long -1, 12678967543233int -1, 126789675short -1, 12678byte -1, 126nonNegativeInteger 0, 1, 126789unsignedLong 0, 12678967543233unsignedInt 0, 1267896754unsignedShort 0, 12678unsignedByte 0, 126positiveInteger 1, 126789date 1999-05-31time
View Full Document