Web|web Service Architecture Web Service: Description and registration, publishing Web Services
Content:
SOAP Message Sample
XML Schema Modeling
WSDL Service Description
UDDI Services Publishing
Summarize
Resources
Author Introduction
Related content:
Interactive interface, the core of Web service definition
Real-combat Web services
Web services based applications, solutions, and development platforms
What is a Web service?
Why do I need a Web service?
WSDL: Describing your Web services
Data Model for UDDI registration information
Chai Xiaolu (fennivel@uddi-china.org)
Chief System Architect
September 20, 2001
This article is the sixth of the series of architecture Web services, and the last one, based on the previous text, the whole process of publishing Web service interface is studied: XML schema modeling, WSDL Publishing and UDDI registration. Through this article, you can have a detailed understanding of the various XML and Web service of the series of specifications in the release of Web service around, the Web service technology will also have a deep understanding.
As I've described earlier, Web services are invoked through a SOAP message, described through WSDL, and publicly registered through UDDI. In the previous article, I've covered how to define a message for the SOAP API, so in this article, I'll just put save_category forward and see how this message can be modeled using a world-view XML schema on a specific implementation, If you use WSDL to specification and deliver the caller the Web service based on the message invocation, and how to publish the Web service along with its WSDL normalization description file to the UDDI registry. I hope you can explain through the example of this article, in this series of the last complete understanding of the work of Web services and related technical specifications of the role.
The resources cited in this article mainly include two categories, one is the Web Services Technical Resources Web site, contains a large number of Web services technical information, the other is the Web services "stack" series of technical specifications, they are a whole technical system, including UDDI, SOAP, WSDL, XML Schema, XML, and so on. At the end of this article, the links to these resources are given, and interested readers can find what they need through these resource links.
SOAP Message Sample
The following is an example of a save_category invocation, in which the soap HTTP Binding is used (the version of the SOAP specification used is 1.2), Suppose the target Web service is deployed in www.sagitta.com, and the portal location of the invoked Web service will be http://www.sagitta.com/catalog/.
In this message, a new category and a new product are added to an existing category.
From this we can see that there is an xmlns modifier "http://www.sagitta.com/schema/" behind the two elements of Save_category and categorylist. This URI uniquely represents the namespace of the element and all its child elements. The schema definition of these elements can also be obtained through this URL.
The schema definition of an XML document described using the World Wide Web XML Schema defines the status of a support tool in the technical family of the entire website service. The Consortium XML Schema is a modeling tool for any type of XML document. In the Web service architecture, XML schemas are essential tools and underlying support, both in the presentation of SOAP messages and in the description of the WSDL interface.
I'll start with an XML schema, save_category this message (as well as a service portal) to explain how to model XML schemas for our XML messages, and how to use WSDL to Save_ Category The service Portal to describe the interface, and then publish the portal to the UDDI registry.
XML Schema Modeling
The file suffix of an XML schema is an. xsd file, and a definition in an XML schema is usually divided into two parts, a type definition and an element definition. Here we combine save_category specific XML Schema definitions to illustrate how to use XML schemas to implement schema definitions.
In the following XML Schema document, the type definition includes: compliantspecbag,featurebag,parameter,parameterbag,product and category six types, and the element is defined as Save_ Category this element.
Save_category XML Schema Description definition: (complete XML Schema document is: sagitta.xsd)
In this schema description, the Compliantspecbag element type is described, and any element that uses the Compliantspecbag type can contain an element that is specification, which can occur 0 times to infinity (Unrestricted, In fact, it is not possible to have infinite occurrences), and specification This element contains a property specificationkey, which is required and is of type string (xs:string). The Xs namespace is the namespace (namespace) of the XML Schema 2001 of the Consortium.
Here, the Featurebag element type is described, and any document element that uses the Featurebag type can contain a feature, and the feature element can appear 0 to infinity (unrestricted, virtually impossible to appear infinitely). The type of the element's content is a string (xs:string).
This first describes the element type of parameter, and any document element that uses the parameter type can contain two keyname and keyvalue, all of which are child elements that must appear, and can occur only once. Their type is also a string (xs:string). The Parameterbag element type is then described, and any document element that uses the Parameterbag type can contain a parameter, and the type of the child element is a previously defined parameter (in an XML schema, The domain space of the type name and element name is orthogonal and does not need to consider any name duplication problem, and the number of parameter elements can occur from 0 to infinity.
This describes the element type of product, and any document element that uses the product type can contain child elements such as name, description, Compliantspecbag, Featurebag, Parameterbag. The types of name and description elements are all xs:string. And the types of Compliantspecbag, Featurebag, parameterbag. It is also clear from the view of this broken XML schema definition that reference is made to these type definitions as defined above. Any document element that uses the product type also has two properties ProductKey and Parentcategorykey that must appear, which is the property value of the two string (xs:string) type, representing the key value of its own element and the key value of the parent category.
This is a description of the category element type, and any document element that uses the product type can contain child elements that are name, description, category, and product. The types of the name and description elements are simple type xs:string. And category is a recursive element that references its own type of element. The element type of product is the product type described above. Any document element that uses the product type also has two properties Categorykey and Parentcategorykey that must appear, which is the property value of the two string (xs:string) type, representing the key value of its own element and the key value of the parent category.
This is the only element defined in this schema document, the element save_category is a composite type, and its elements can have authinfo and category. Where Authinfo is a base64 encoded string, category is a child element of type category that can occur 0 to an infinite number of times. It is not difficult to find that the basic mechanism of element definition and type definition is the same, in fact, we can completely split this definition into two paragraphs, a section for the type definition, a paragraph for the element definition, the following given this equivalent example, hope to help the understanding of the schema.
So why take the first approach, not the second one, because it's simple because the entire Web service-related message schema, such as category, product, Featurebag, Compliantspecbag, Parameterbag These elements can be reused, so it is more appropriate to define a type, and Save_category is a single message that cannot be reused by other elements, so it is directly defined as an element.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.