Web Services
-
Upload
studentscorners -
Category
Documents
-
view
75 -
download
1
Transcript of Web Services
![Page 1: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/1.jpg)
Web Services:JAX-RPC, WSDL, XML Schema, and
SOAP
CSI 3140WWW Structures, Techniques and Standards
![Page 2: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/2.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 2
Web Services Concepts
A web application uses Web technologies to provide functionality to an end userA web service uses Web technologies to
provide functionality to another software application
![Page 3: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/3.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 3
Web Services Concepts
Standard web services technologies: Communication via SOAP XML vocabulary
documents over HTTP Operations of web service defined by Web
Services Definition Language (WSDL) XML vocabulary
Data within WSDL defined using XML Schema
![Page 4: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/4.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 4
Web Services Concepts
Higher-level API’s are often used to automatically generate web services client and server communication software
We will use the Java API for XML-based Remote Procedure Call (JAX-RPC)
Microsoft .NET framework is one popular alternative to JAX-RPC
![Page 5: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/5.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 5
Web Services Concepts
Web services conceptually are just specialized web applications:
ClientServer
(Java servlet)
HTTP request (SOAP body)
HTTP response (SOAP body)
![Page 6: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/6.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 6
Web Services Concepts
Body of web services request is analogous to calling a method
Operation name (like method name)
Input parameter valuesInput parameternames
![Page 7: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/7.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 7
Web Services Concepts
Body of web services response is analogous to value returned by a method
Return value data type
Returnvalue
![Page 8: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/8.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 8
Web Services Concepts
WSDL defines web service Operations Parameters Return values Communication protocolsBasically an API for the web service Facilitates automated client/server software
generation
![Page 9: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/9.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 9
Web Services Concepts
Portions of NWS WSDL
Operation name
Inputparams
Returntype
Data typesdefined usingXML Schema
![Page 10: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/10.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 10
Web Services Concepts
Java Web Services Developer Pack (JWSDP) wscompile tool can implement a Java API from a WSDL
Classes and methodsgenerated by wscompile
This method automatically handles SOAP request and response
![Page 11: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/11.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 11
Web Services Concepts
Writing the server for a web service with JWSDP:
Write a Java interface defining the API Implement the interface JWSDP generates
SOAP and communication handling classesWSDL
![Page 12: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/12.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 12
Web Services Concepts
Example Java interface
![Page 13: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/13.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 13
Web Services Concepts
Example implementation
![Page 14: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/14.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 14
Web Services Examples
Tons of WS available on the internet.http://www.webservicex.net as a good collection
Geo IP: http://www.webservicex.net/geoipservice.asmx?op=GetGeoIP Whois: http://www.webservicex.net/whois.asmx?op=GetWhoIS SMS: http://www.webservicex.net/sendsmsworld.asmx Etc..
Google:Amazon
S3
![Page 15: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/15.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 15
JWSDP: Server
Application: currency converter Three operations:
fromDollarsfromEurosfromYen
Input: value in specified currency Output: object containing input value and
equivalent values in other two currencies
![Page 16: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/16.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 16
JWSDP: Server
1.Write service endpoint interface• May need to write additional classes representing data
structures
2.Write class implementing the interface3.Compile classes4.Create configuration files and run JWSDP tools to
create web service5.Deploy web service to Tomcat
![Page 17: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/17.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 17
JWSDP: Server
Service endpoint interface Must extend java.rmi.Remote Every method must throw java.rmi.RemoteException
Parameter/return value data types are restricted No public static final declarations
(global constants)
![Page 18: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/18.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 18
JWSDP: Server
Allowable parameter/return value data types Java primitives (int, boolean, etc.) Primitive wrapper classes (Integer, etc.) String, Date, Calendar, BigDecimal, BigInteger
java.xml.namespace.QName, java.net.URI Struct: class consisting entirely of public instance
variables Array of any of the above
![Page 19: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/19.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 19
JWSDP: Server
Struct for currency converter app (data type for return values)
![Page 20: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/20.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 20
JWSDP: Server
Service endpoint interface
![Page 21: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/21.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 21
JWSDP: Server
1.Write service endpoint interface• May need to write additional classes representing data
structures
2.Write class implementing the interface3.Compile classes4.Create configuration files and run JWSDP tools to
create web service5.Deploy web service to Tomcat
![Page 22: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/22.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 22
JWSDP: Server
Class CurConImpl contains methods, for example:
![Page 23: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/23.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 23
JWSDP: Server
1.Write service endpoint interface• May need to write additional classes representing data
structures
2.Write class implementing the interface3.Compile classes4.Create configuration files and run JWSDP tools to
create web service5.Deploy web service to Tomcat
![Page 24: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/24.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 24
JWSDP: Server
Configuration file input to wscompile to create server
Namespacesused inWSDL(normally,unique URL’sat yourWeb site)
![Page 25: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/25.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 25
JWSDP: Server
Configuration file for web service
![Page 26: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/26.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 26
JWSDP: Server
Configuration file for web service
Likeservletin web.xml
Likeservlet-mappinginweb.xml
Context path
![Page 27: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/27.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 27
JWSDP: Server
Also need a minimal web.xml
![Page 28: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/28.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 28
JWSDP: Server
Run jar and wsdeploy to create a Web Archive (WAR) file converter.war
Name must match urlPatternBase value
![Page 29: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/29.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 29
JWSDP: Server
1.Write service endpoint interface• May need to write additional classes representing data
structures
2.Write class implementing the interface3.Compile classes4.Create configuration files and run JWSDP tools to
create web service5.Deploy web service to Tomcat
![Page 30: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/30.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 30
JWSDP: Server
Just copy converter.war to Tomcat webapps directory
May need to use Manager app to deploy Enter converter.war in “WAR or Directory
URL” text box
![Page 31: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/31.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 31
JWSDP: Server
Testing success: Visit http://localhost:8080/converter/currency
![Page 32: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/32.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 32
JWSDP: Client
Goal: write a JSP-based client Input: currency and value Output: table of equivalent values
![Page 33: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/33.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 33
JWSDP: Client
Configuration file input to wscompile to create client
![Page 34: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/34.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 34
JWSDP: Client
Directory structure (wscompile generates content of classes and src)
![Page 35: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/35.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 35
JWSDP: Client
Starting point for writing a client (if the web service author does not explain how):
In the WSDL, find the name attribute of the service element
Look in Java file with this name to see how to obtain a proxy object for the service
Data type of proxy object Method called to obtain object
![Page 36: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/36.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 36
JWSDP: Client
Obtaining the proxy object: Java file consisting of service name followed by _Impl defines a class implementing the proxy-generating interface
Client code begins with method call on this class:
![Page 37: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/37.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 37
JWSDP: Client
Using the proxy object:
![Page 38: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/38.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 38
JWSDP: Client
Structs will be represented as JavaBeans classes, regardless of how they are defined on the server
![Page 39: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/39.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 39
JWSDP: Client
Bean obtaining and calling proxy object:
![Page 40: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/40.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 40
JWSDP: Client
JSP document using the bean:Call to getExValues()
Call to getEuros()
![Page 41: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/41.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 41
WSDL Example
Target namespace: namespace for names (e.g., of operations) defined by the WSDL
WSDLnamespaces XML Schema NS
Namespacesspecified inconfig files
![Page 42: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/42.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 42
WSDL Example
Defines structusing XMLSchema
Namespace fordata type definitions(ns2 in rest of document)
![Page 43: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/43.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 43
WSDL Example
Inputmessages(parameterlists)
Outputmessages(responsedata types)
Data type defined byXML Schema
![Page 44: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/44.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 44
WSDL Example
![Page 45: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/45.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 45
WSDL Example
Implement the operations using SOAP encoding ofdata structures and RPC (JWSDP defaults)
![Page 46: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/46.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 46
WSDL Example
Replaced by serverwhen WSDL is visited
![Page 47: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/47.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 47
WSDL Example
Summary: types uses XML Schema to define data types message elements define parameter lists and
return types using types and XML Schema portType defines abstract API for operation’s
using message’s binding specifies how message’s will be
communicated and operation’s called service associates URL with binding
![Page 48: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/48.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 48
XML Schema
How do we send a Java double value to a web service using XML?
Is scientific notation allowed? How large can the value be? Etc.What if we want to send an object? And what if the object contains references to other
objects?
![Page 49: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/49.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 49
XML Schema
XML Schema addresses such questions Defines a number of simple data types, including
Range of allowed valuesHow values are represented as strings
Provides facilities for defining data structures in terms of simple types or other data structures
Can also be used in place of XML DTD
![Page 50: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/50.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 50
XML Schema
Built-in data types
Types corresponding to Java primitive types: boolean, byte,int, double, etc.String representations much as Java
Exception: can use 0 for false, 1 for trueNo char; use string instead
XML DTD types (ID, CDATA, etc.)
Built-in type
![Page 51: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/51.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 51
XML Schema
Built-in data types integer and decimal (arbitrary precision) dates, times, and related subtypes URLs XML namespace qualified names binary data some restricted forms of the above, e.g., nonNegativeInteger
![Page 52: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/52.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 52
XML Schema
XML Schema namespace defining built-in types is called the document namespace
Standard prefix for this namespace is xsd
![Page 53: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/53.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 53
XML Schema
Plus Java primitive types (int, etc.)
![Page 54: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/54.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 54
XML Schema
Mapping from XML Schema data types to Java:
Primitives: one-for-one mapping date, time, dateTime: map to Calendar most others: map to String
![Page 55: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/55.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 55
XML Schema
Elements in the document namespace can declare user-defined data types Two XML Schema data types: Complex: requires markup to represent within an
XML document Simple: can be represented as character data
![Page 56: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/56.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 56
XML Schema
User-defined data types are declared in the types element of a WSDL
Example: ExchangeValueIn WSDL, user-defined types can be used To define other data types within types element To specify data types of parameters and return
values in message elements
![Page 57: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/57.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 57
XML Schema
![Page 58: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/58.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 58
XML Schema
An XML schema is markup that Is written according to the XML Schema vocabulary Defines an XML vocabularyA schema document is an XML document
consisting entirely of an XML schemaA document conforming with an XML schema
vocabulary is call an instance of the schema
![Page 59: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/59.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 59
XML Schema
Root element of the markup of an XML schema is schemaDefine data types with elements: complexType simpleTypeAn XML schema can also define other
vocabulary aspects (allowed elements, element content) that we won’t cover
![Page 60: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/60.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 60
XML Schema
One way to define simple types: restrict an existing simple base type
Base type
![Page 61: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/61.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 61
XML Schema
Built-in types all have facets, that is, aspects that can be restricted
enumeration is a facet that applies to all built-in types except boolean
length, minLength, maxLength apply to string-like types (e.g., string, QName, anyURI)
minInclusive, maxInclusive, minExclusive, maxExclusive apply to numeric and time-oriented types
totalDigits, fractionDigits apply to numeric types
![Page 62: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/62.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 62
XML Schema
Restricting multiple facets:
![Page 63: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/63.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 63
XML Schema
pattern facet applies to most types (except a few DTD) specifies regular expression
![Page 64: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/64.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 64
XML Schema
Other simple types Union: combine two or more types
Lists of values of simple type
![Page 65: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/65.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 65
XML Schema
Complex type Defined in an XML schema
Used in an instance document
![Page 66: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/66.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 66
XML Schema
Complex type can be used in placed of XML DTD content specification
sequence element is equivalent to , operator in DTD
![Page 67: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/67.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 67
XML Schema
![Page 68: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/68.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 68
XML Schema
Instance namespace
Normally associated with prefix xsiUsed within instance documents to define null-valued elements
define data types
![Page 69: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/69.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 69
SOAP
![Page 70: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/70.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 70
SOAP
![Page 71: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/71.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 71
SOAP
Alternate form
![Page 72: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/72.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 72
SOAP
SOAP encoding of arrays in WSDL
![Page 73: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/73.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 73
SOAP
Array in SOAP document
![Page 74: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/74.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 74
SOAP
If SOAP is sent via HTTP, request must include SOAPAction header field
Either empty or a URI Can be used to pass operation rather than
embedding in body of message
![Page 75: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/75.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 75
Web Services Technologies
Other implementation of JAX-RPC and/or Java-based web services
Apache Axis IBM WebSphereMicrosoft support for web services: .NETPHP also has web services tools
![Page 76: Web Services](https://reader033.fdocuments.us/reader033/viewer/2022061123/5473891ab4af9fae0f8b457a/html5/thumbnails/76.jpg)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson’s slides 76
Web Services Technologies
Universal Discovery, Description, and Integration (UDDI)
Technology for creating directories of web servicesWeb Services-Interoperability Organization
(WS-I) Basic Profile Specification of how web services should be used to
enhance interoperability Must use XML Schema and literal encoding (rather
than SOAP encoding)