Download presentation
Presentation is loading. Please wait.
1
Practical II – Modifying WSDL (30+ mins)
INTRODUCTION 02/11/2017 Practical II – Modifying WSDL (30+ mins) Richard Hopkins National e-Science Centre, Edinburgh February 23 / Web Services and WSRF, 24/25 Feb 2005, NeSC
2
Introduction Goals – To gain some direct experience of WSDL definition
02/11/2017 Introduction Goals – To gain some direct experience of WSDL definition Structure Take the WSDL produced by ws-compile for the quote of the day practical, and modify it as follows A) Change names – QotdPort becomes OLDQotdPort etc. for binding, portType, operation, messages leave location as location=" Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction Web Services and WSRF, 24/25 Feb 2005, NeSC
3
Modification B) Give the service a new port, for which
location=" the operation is GetQuote - Request has information minLength – the minimum number of characters in the quote maxLength – the maximum number of characters in the quote Response has fields theQuote – the actual quote anAttribution – zero or more of these, each a source for the quote Extension points are included in both request and response Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
4
B will be according to a provided solution
I will go through that solution But most of it won’t be there when you do the exercise Make sure you understand it C) what is wrong with the provided solution? how would you fix it? For coffee break discussion – you are expected to do any fixes to the WSDL Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
5
Part A – Changing names …. <types/>
INTRODUCTION 02/11/2017 Part A – Changing names …. <types/> <message name="OLDQotd_getQuote"/> <message name="OLDQotd_getQuoteResponse"> <part name="result" type="xsd:string"/> </> <portType name="OLDQotd"> <operation name="OLDgetQuote"> <input message="tns:OLDQotd_getQuote"/> <output message="tns:OLDQotd_getQuoteResponse"/></></> <binding name="OLDQotdBinding" type="tns:OLDQotd"> …. Some change of name … </binding> <service name="Qotd"> <port name="OLDQotdPort" binding="tns:OLDQotdBinding"> <soap:address location=" xmlns:wsdl=" </></></> Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction Web Services and WSRF, 24/25 Feb 2005, NeSC
6
Part B – new types Becomes <types/>
Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
7
The Types <types>
<schema xmlns=" targetNamespace=" <element name="QuoteT"> <complexType> <sequence> <element name="theQuote" type="xsd:string"/> <element name="anAttribution" type="xsd:string" minOccurs="1“ maxOccurs="unbounded“ /> <any namespace="##other" minOccurs="1“ maxOccurs="unbounded“ /> </sequence> </complexType> </element> <element name="GetQuoteT"> <complexType> <sequence> <element name="minLength" type="xsd:integer" minOccurs="0"/> <element name="maxLength" type="xsd:integer" minOccurs="0"/> <any namespace="##other“ minOccurs="1“ maxOccurs="unbounded“ /> </sequence> </complexType> </element> </schema> </types> The complex bit – Will leave this slide up Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
8
Insert Two New Messages
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns=" … xmlns:types= … > <types> …. </types> <message name="Qotd_getQuote"> <part name="getQuoteP" element="types:GetQuoteT"></part> </message> <message name="Qotd_getQuoteResponse"> <part name="result" element="types:QuoteT"/> <message name="OLDQotd_getQuote"/> …. Very similar to the OLD message items – Change of name Put in naes of types in the schema declarations just done Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
9
Insert New PortType Very similar to the OLD portType
<message name="Qotd_getQuote"> <part name="getQuoteP" element="types:GetQuoteT"></part> </message> <message name="Qotd_getQuoteResponse"> <part name="result" element="types:QuoteT"/> <message name="OLDQotd_getQuote"/> …. <portType name="Qotd"> <operation name="getQuote"> <input message="tns:Qotd_getQuote"/> <output message="tns:Qotd_getQuoteResponse"/> </operation> </portType> <portType name="OLDQotd"> ….. Very similar to the OLD portType Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
10
Insert New Binding Very similar to the OLD binding
<portType name="Qotd"> <operation name="getQuote"> … </operation> </portType> <portType name="OLDQotd"> … </portType> <binding name="QotdBinding" type="tns:Qotd"> <soap:binding style="rpc" transport=" <operation name="getQuote"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle=" namespace=" use="encoded"/> </input> <output> … </output> </operation> </binding> <binding name="OLDQotdBinding" type="tns:OLDQotd"> …. </binding> Very similar to the OLD binding Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
11
A New Port for the Service
<service name="Qotd"> <port name="QotdPort" binding="tns:QotdBinding"> <soap:address location=" xmlns:wsdl=" </port> <port name="OLDQotdPort" binding="tns:OLDQotdBinding"> <soap:address location=" </service> </definitions> Put in a new port for the service, for accessing this richer quote of the day interface Use a new location, since the old interface must continue to be available at the old location Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
12
So, away you go <types>
<schema xmlns=" targetNamespace=" <element name="QuoteT"> <complexType> <sequence> <element name="theQuote" type="xsd:string"/> <element name="anAttribution" type="xsd:string" minOccurs="1“ maxOccurs="unbounded“ /> <xs:any namespace="##other" minOccurs="1“ maxOccurs="unbounded“ /> </sequence> </complexType> </element> <element name="GetQuoteT"> <complexType> <sequence> <element name="minLength" type="xsd:integer" minOccurs="0"/> <element name="maxLength" type="xsd:integer" minOccurs="0"/> <xs:any namespace="##other“ minOccurs="1“ maxOccurs="unbounded“ /> </sequence> </complexType> </element> </schema> </types> The complex bit – Will leave this slide up Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
13
Retrospective – the problems
what is wrong with the provided solution? how would you fix it? Some problems The message structuring does not fit with RPC encoded See WSDL produced for the FileRepository practical for how this might better be done The extension point (any) elements violate determinism, since they both occur after a variable-occurrence element The extensibility “rules” suggest the elements should have anyAttributes, but that would not be appropriate for RPC style There is the possibility of faults – no quote in the given range Include fault messages Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
14
The End THE END Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
15
Practical III – Modifying WSDL for WSRF compliance (45+ mins)
INTRODUCTION 02/11/2017 Practical III – Modifying WSDL for WSRF compliance (45+ mins) Richard Hopkins National e-Science Centre, Edinburgh February 23 / Web Services and WSRF, 24/25 Feb 2005, NeSC
16
Introduction Goals – To think a bit about resources and WSRF
02/11/2017 Introduction Goals – To think a bit about resources and WSRF A paper&pencil exercise – best in pairs Real use of WSRF would use specific tool support Structure Start with the original WSDL produced by ws-compile for the quote of the day practical Consider how it needs modifying for revised functionality Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction Web Services and WSRF, 24/25 Feb 2005, NeSC
17
Revised Functionality
A user must register before getting any quotes The user registers the range of quote lengths they are interested in registerUser(minLength, maxLength) A Unique Quote is returned The getQuote operation selects a quote which Is within the currently registered range of quote lengths Has not previously been provided for this user registration Registration Modification/Enquiries The user can discover and modify their current minLength and maxLength The user can discover the number of quotes that are available to be selected from in a getQuote operation The quote service can autonomously add and remove quotes a user can ask to be informed if such a change results in a change in the number of available quotes Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
18
The Questions What is the resource?
What is a formulation of its properties which fits with the functionality NOT the full actual state of the set of available quotes Do a schema definition for this How do we make best use for the WSRF-defined operations to provide this functionality – What are the operations? What do we have to add to the WSL In general terms – not actual definitions Example message exchanges Do actual XML documents for the SOAP envelopes of the message exchanges for the various operations Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
19
DO IT The next slides have the answers Try it First
Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
20
A POSSIBLE SET OF ANSWERS
What is the resource? A user registration What is a formulation of its properties which fits with the functionality? minLength; maxLength; count (of number of available quotes) How do we we make best use for the WSRF-defined operations to provide this functionality – What are the operations? Request/Response register(minLength, maxLength):registrationRef getQuote() getMultipleResourceProperties(…) setResourceProperties (…) [not count] subscribeToNotificationOfCountValueChange Notification ChangeOfCountValue(OldValue, NewValue) What to add to the WSDL? These operations; the resourceProperties definition; Headers for resource qualified end-point addresses Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
21
The XML details (to be done)
Schema for Properties Document Message examples Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
22
THE END End Web Services and WSRF, 24/25 Feb 2005, NeSc -- Introduction
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.