企业级应用系统体系架构WebService课件.ppt
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《企业级应用系统体系架构WebService课件.ppt》由用户(晟晟文业)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 企业级 应用 系统 体系 架构 WebService 课件
- 资源描述:
-
1、企业级应用系统体系架构企业级应用系统体系架构(六)(六)Web Service2023-1-6From:OReilly:Enterprise JavaBeans 3.0,5th Edition,May.2006TopicnWeb Services StandardsnWeb Services OverviewnXML Schema and XML NamespacesnSOAP 1.1nWSDL 1.1nUDDI 2.02Web Services OverviewnWeb Services present the opportunity for real interoperability ac
2、ross hardware,operating systems,programming languages,and applications.nBased on the XML,SOAP,and WSDL standards,web services have enjoyed widespread adoption by nearly all of the major enterprise players,including Microsoft,IBM,BEA,JBoss,Oracle,Hewlett-Packard,and others.Sun Microsystems has integr
3、ated web services into the Java EE platform;specifically,Sun and the Java Community Process have introduced several web services APIs,including the Java API for XML Web Services(JAX-WS),the Java API for XML-based RPC(JAX-RPC),the SOAP with Attachments API for Java(SAAJ),and the Java API for XML Regi
4、stries(JAXR).These web services APIs were integrated into J2EE 1.4 and have been expanded upon in Java EE 5 and EJB 3.0.3Web Services OverviewnA web service is a remote application described using the Web Service Description Language(WSDL)and accessed using the Simple Object Access Protocol(SOAP)acc
5、ording to the rules defined by the WS-I Basic Profile 1.1.nThe WS-I(Web Services Integration Organization)is a group of vendors(Microsoft,IBM,BEA,Sun Microsystems,Oracle,HP,and others)that have banded together to ensure web services are interoperable across all platforms.To do this,they have created
6、 a recommendation called the Basic Profile 1.1,which defines a set of rules for using XML,SOAP,and WSDL together to create interoperable web services.4Web Services Overview5TopicnWeb Services StandardsnWeb Services OverviewnXML Schema and XML NamespacesnSOAP 1.1nWSDL 1.1nUDDI 2.06XML SchemanAn XML S
7、chema is similar in purpose to a Document Type Definition(DTD),which validates the structure of an XML document.To illustrate some of the basic concepts of XML Schema,lets start with an XML document with address information:3243 West 1st Ave.Madison WI 53591 nYou measure the correctness of an XML do
8、cument by determining two criteria:whether the document is well formed and whether it is valid.7XML SchemanIn order to validate an XML document,you need a way to represent these application-specific constraints.nThe XML Schema for the Address XML document looks like this:8XML SchemanXML Schema built
9、-in types and their corresponding Java types9XML SchemanBy default,each element declared by a must occur once in an XML document,but you can specify that an element is optional or that it must occur more than once by using the occurrence attributes.For example,we can say that the street element must
10、 occur once but may occur twice:nBy default,the maxOccurs and minOccurs attributes are always 1,indicating that the element must occur exactly once.10XML SchemanThe declarations are nested under a element,which indicates that the elements must occur in the order they are declared.You can also nest t
11、he elements under an declaration,which allows the elements to appear in any order.The following shows the AddressType declared with an element rather than a element:11XML SchemanIn addition to declaring elements of XSD built-in types,you can declare elements based on complex types.This is similar to
12、 how Java class types declare fields that are other Java class types.For example,we can define a CustomerType that uses the AddressType:12XML SchemanAn XML document that conforms to the Customer XSD would look like this:Jones Sara 3243 West 1st Ave.Madison WI 53591 nAt runtime,the XML parser compare
13、s the document to its schema,ensuring that the document conforms to the schemas rules.If the document doesnt adhere to the schema,it is considered invalid,and the parser produces error messages.13XML NamespacesnIn some cases,its convenient to combine two or more XML markup languages into a single do
14、cument so that the elements from each markup language can be validated separately using different XML Schema.nTo use different markup languages in the same XML document,you must clearly identify the markup language to which each element belongs.Jones Sara 3243 West 1st Ave.Madison WI 53591 14XML Nam
15、espacesnThe prefixes are assigned using XML Namespace declarations,which are shown in bold in the previous listing.An XML Namespace declaration follows this format:xmlns:prefix=URI nThe prefix can be anything you like,as long as it does not include blank spaces or any special characters.The URI used
16、 in the XML Namespace declaration identifies the exact markup language that is employed.It doesnt have to point at a web page or an XML document;it only needs to be unique to that markup language.For example,the XML Namespace used by the Address markup is different from the URL used for the Reservat
17、ion markup:xmlns:addr=http:/ xmlns:res=http:/ nThe URI in the XML Namespace declaration should match the target namespace declared by the XML Schema.15XML NamespacesnPrefixing every element in an XML document with its namespace identifier is a bit tedious,so the XML Namespace allows you to declare a
18、 default namespace that applies to all nonprefixed elements.The default namespace is simply an XML Namespace declaration that has no prefix(xmlns=URL).For example,we can use a default name in the Reservation document for all reservation elements:Jones Sara 3243 West 1st Ave.Madison WI 53591 16XML Na
19、mespacesnWe can apply the scoping rules of namespace to simplify the Reservation document further by allowing the address elements to override the default namespace with their own default namespace:Jones Sara 3243 West 1st Ave.Madison WI 53591 17XML NamespacesnXML Namespaces are URIs that uniquely i
20、dentify a namespace but do not actually point at a resource.In other words,you dont normally use the URI of an XML Namespace to look something up.Its usually only an identifier.However,you might want to indicate the location of the XML Schema associated with an XML Namespace so that a parser can upl
21、oad it and use it in validation.This is accomplished using the schemaLocation attribute:Jones Sara 18XML NamespacesnXML Schema also uses XML Namespaces.Lets look at XML Schema for the Address markup language with a new focus on the use of XML Namespaces:19TopicnWeb Services StandardsnWeb Services Ov
22、erviewnXML Schema and XML NamespacesnSOAP 1.1nWSDL 1.1nUDDI 2.020SOAP 1.1nSOAP 1.1 is simply a distributed object protocol such as DCOM,CORBAs IIOP,and JRMP(the primary transport used by RMI).nSOAP is defined by its own XML Schema and relies heavily on the use of XML Namespaces.Every SOAP message th
23、at is sent across the wire is an XML document consisting of standard SOAP elements and application data.The use of namespaces differentiates the standard SOAP elements from the application data.Heres a SOAP request message that might be sent from a client to a server:21SOAP 1.1nThe element is the ro
24、ot of the SOAP message;all other elements are contained by it.Within the element are two direct children:the element and the element.nThe element is generally used for carrying infrastructure data such as security tokens,transaction IDs,routing information,and so on.In the previous example,the eleme
25、nt is empty,which is not unusual for basic web services.In many cases,we are only interested in exchanging information and not in more advanced issues,such as those relating to security and transactions.Although the element is required,the element is not.From this point forward,the element will be o
展开阅读全文