OpenSG Service Definition, Feb 2010 RESTful Service Discussions Shawn Hu
OpenSG Service Definition, Feb 2010 Design Artifact Considerations XML schemas for message payload definition WSDL 2.0 for service definition in REST style –Operation style & pattern style=" pattern=" –Binding type: type=" –Operation method (http verbs) whttp:method="GET" (or others)
OpenSG Service Definition, Feb 2010 Consumption XML Schema Consumption.xsd
OpenSG Service Definition, Feb 2010 RESTful Service Definition Input –Using HTTP GET or POST following URL naming convention Output –Using XSD for return
OpenSG Service Definition, Feb 2010 Xpath for URI Design
OpenSG Service Definition, Feb 2010 URI = + + – - A base address where a web service is located such as (not real address but for example only) – - A path to access resource component. This path follows XSD Xpath convention such as /Consumption/MeterReading/IntervalBlocks/IntervalReadings/ to access interval readings as consumption – - An optional field for arguments such as ?timeStamp= T00:00:00Z –Example URI for a resource: ntervalBlocks/IntervalReadings?timeStamp= T00:00:00Z URI Naming Convention
OpenSG Service Definition, Feb 2010 Service Table
OpenSG Service Definition, Feb 2010 Entry URI: ks/IntervalReadings/value?timeStamp= T09:30:47Z Note: may need to truncated to only list such as T09:30:47Z Return XML: T09:30:47Z GET URI & Return XML
OpenSG Service Definition, Feb 2010 Entry URI: ks/IntervalReadings/value Resulting XML to post: T09:30:47Z POST Entry URI & XML
OpenSG Service Definition, Feb 2010 XML can be compressed or truncated as below if space is limited using the POST XML as an example: T09:30:47Z Compressed/Truncated XML
OpenSG Service Definition, Feb 2010 WSDL Design –Operation Style & Pattern style= iri(W3C WSDL2.0) –The content model of this element is defined using a complex type that contains a sequence from XML Schema. –The sequence MUST only contain elements.† It MUST NOT contain other structures such as xs:choice. There are no occurrence constraints on the sequence.† –The sequence MUST contain only local element children.† Note these child elements can contain the nillable attribute.† –The localPart of the element's QName MUST be the same as the Interface Operation component's {name}.† Interface Operationname† –The complex type that defines the body of the element or its children elements MUST NOT contain any attributes.†† –The children elements of the sequence MUST derive from xs:simpleType, and MUST NOT be of the type or derive from xs:QName, xs:NOTATION, xs:hexBinary or xs:base64Binary.†† Note: IRIs – Internationalized Resource Identifiers (IETF)
OpenSG Service Definition, Feb 2010 WSDL Design –Operation Style & Pattern pattern= in-out (W3C WSDL2.0) –The in-out message exchange pattern consists of exactly two messages, in order, as follows:†† –A message: »indicated by a Interface Message Reference component whose {message label} is "In" and {direction} is "in"Interface Message Referencemessage labeldirection »received from some node N –A message: »indicated by a Interface Message Reference component whose {message label} is "Out" and {direction} is "out"Interface Message Referencemessage labeldirection »sent to node N –The in-out message exchange pattern uses the rule Fault Replaces Message propagation rule.†2.2.1 Fault Replaces Message propagation rule† –An operation using this message exchange pattern has a {message exchange pattern} property with the value " exchange pattern
OpenSG Service Definition, Feb 2010 Service Output –In-Out Pattern for a GET return (message)
OpenSG Service Definition, Feb 2010 Service Output –In-Out Pattern for a POST return (ack)
OpenSG Service Definition, Feb 2010 Summary –Definition using WSDL 2.0 (IRI style & In- Out pattern) –URL naming pattern (to follow XSD XPath) –SLA on services such as limited return data size –Return data in XSD format (CIM based) –GET for non state change and POST for state change
OpenSG Service Definition, Feb 2010 Questions & Comments