Tutorials to .com

Tutorials to .com » Dotnet » Webservice » Interface, Web service definition of the core

Interface, Web service definition of the core

Print View , by: iSee ,Total views: 8 ,Word Count: 3614 ,Date: Sat, 23 May 2009 Time: 3:38 AM


framework for Web Service: User Interface, Web services defined in the core




Content:

API Overview
Catalog Service
Member Service
Feedback Service
Order Service
Description and registration: Published Web services references About the author


Related Content:

Actual Web service applications based on Web services, solutions and development platform for Web services what is?
Why do we need Web services?




CHAI Xiao-Lu (fennivel@uddi-china.org)
Chief system Architect
September 17, 2001

This is the framework for Web services, Part V of a series of articles to the former text described in the application, based on a detailed definition of the API message Catalog services and all API is to use SOAP to call and return to complete, this paper defined the specific API detailed introduction and demonstration of the interactive information data structure and the structure of the definition of API method and the corresponding model for the definition of their own readers in Web service interfaces to provide the example of the help and tutorials.
In this series the first article, The Case for the paper has done a systematic analysis of the system is divided into modules, initially defined in the following online services components:

Catalog Service - categories (Category) management, product (Product) Management, data exchange, data backup, etc.;
Order Service - to receive orders, orders to other orders, such as service delivery;
Feedback Service - Feedback (Feedback) management, data exchange.
Apparently as a result of these services must have a user's system to support, whether it is because of security considerations (with permission to do certain operations, or because the users of services (the service is clearly unlikely to Order this be implemented from the user) . Therefore, we need to increase the online services of a Member Service, Membership applications can basically rely on Web services to complete the process, such as Web Application, so the Member Service interface Web Service can be relatively simplified. All of these online services need to provide components external interface, we have a detailed plan from the beginning of the definition:

Figure 1. API information


resources mainly include two categories of services is the Web site of the technical resources, including a large number of Web services, technical information, and the other is Web services "stack" series of technical specifications, they are a technical system, including UDDI, SOAP, WSDL, xml and so on. Finally, this article links to these resources, interested readers can find these resources link the content.

API Overview

API for the entire system design, its principles has revealed the following:

Simplicity, since this is a public open Web services API it should first of all, the design is simple, to be acceptable to a large number of users to obtain better application, then the API must be simple, no complex API used everyone will be widely accepted unless it is too wide penetration of the system, and at present we have to design the Web service is a new system, so live for the present application, API must be simple.

Scalability, as a higher refresh rate, open strong Web service API should have a very good scalability of the back, when domestic demand should be the change or changes in external demand as necessary, API will be based on the new changes in business logic, when the API should not be to overturn a fundamental reconstruction, and should have the incremental capacity can be expanded.

Compatibility, in fact, scalability and compatibility is a common, API compatibility refers to the backward compatibility, high version of the API should have a low version of the API compatibility, which means the use of the Web services API version should be able to support the use of a low version of API calls.

Efficiency, API should adhere to the premise of simplicity and takes into account the efficiency, when applied to some combination of a very frequent operation, we should call this design a portfolio of operating only a single entrance, an interactive call, this can external applications to enhance efficiency, while reducing the load on Web services.

Completeness, the so-called completeness of the API that is to say, the need to cover all public functions, and this is the best in terms of goals, as long as the design phase of a complete, will be able to meet the requirements of completeness. And in case the situation was found incomplete, it is relatively easy to amend the.

Catalog Service

save_category: preservation category, in this API call, including the update and the new operation, at the same time the migration category can also be done through the API.
delete_category: delete the category, the specified category and all sub-elements deleted from the Catalog.
find_category: positioning in the catalog search category, through a variety of ways, such as name, keyword, etc. For example.
save_product: preservation of product, in this API call, may contain the same updates, the new operation and relocation.
delete_product: delete the product, the product will be designated to delete information from the Catalog.
find_product: positioning in the catalog to find product, through a variety of ways, such as name, for example, where the category, keyword, etc. For example.
get_categoryDetail: access to a complete category of information, including all category contains summary information and detailed product information.
get_productDetail: access to the complete product information.
get_categoryInfo: access category and all its children and grandchildren all category and product information.
In the definition of these messages, we first need to determine the category and the product of these two entities described in the xml format. The light of the foregoing entities in the relational model, we can define them as follows:

Category specific description of the format:


<category categoryKey="…" parentCategoryKey="…">
<name> ... ... </ name>
<description> ... ... </ description>
</ category>




Product specific description of the format:


<product productKey="…" parentCategoryKey="…">
<name> ... ... </ name>
<description> ... ... </ description>
<compliantSpecBag />
<featureBag />
<parameterBag />
</ category>




Which, compliantSpecBag, featureBag and parameterBag specific format are as follows:

<compliantSpecBag>
<specification specificationKey="……" /> *
</ compliantSpecBag>




compliantSpecBag described is a computer-related products which adhere to industry standards. In this gathering there, specification of this element can appear several times, each of its entries that followed were an industrial standards, such as a portable computer-based entertainment may be followed, such as USB1.0, IEEE1394, etc. industrial norms.


<featureBag>
<feature> ... ... </ feature> *
</ featureBag>




featureBag described is a key characteristics of computer products. In this gathering there, feature of this element can occur many times an entry for each text string to describe the use of a certain product characteristics. For example, a portable computer-based entertainment properties may include "weight only 2 pounds, the thickness of only 1.9cm, super-portable," such a characterization.


<parameterBag>
<parameter> *
<keyName> ... ... </ keyName>
<keyValue> ... ... </ keyValue>
</ parameter>
</ parameterBag>




parameterBag described is a computer-related technical parameters of products. In this gathering there, parameter of this element can appear several times, each using the keyName and keyValue entries were to describe the value of a certain technical parameters. For example, a portable computer may be the technical parameters TFT_Size10.1 ".

In the definition of a core data model, we can be, respectively, since the definition of the API specific news.

save_category

Category for the latest information on preservation, the use of this API call, you can complete the update of the category, the new operation and relocation.


<save_category>
<authInfo> ... ... </ authInfo>
<category categoryKey="…" parentCategoryKey="…"> *
<name> ... ... </ name>
<description> ... ... </ description>
<category /> *
<product /> *
</ category>
</ save_category>




Syntax in the above description, we should be able to find, save_category can be used to preserve the integrity of one or more category trees trees-ray is not only to preserve one or more category nodes, such a design is to design efficient The adjustment of goals.

When the entire message in any category or product logos belong to their own entity categoryKey or key productKey is empty, it means that this is a new category or product, need to be inserted into the database, in the return message will be sent back to These key elements.

When the news of any category or product of the changes did not happen parentCategoryKey that element is to update the information. ParentCategoryKey if the time changes that will be before the elements from the original logo by parentCategoryKey node category was moved to the new logo by parentCategoryKey node under the category. Of course, if the operation includes a data update, will update the implementation of the data.

Careful readers must have found in the news, there is a authInfo elements, this is a test for the authorization token permissions. I will be in the back of the element specified is how to obtain and use.

Call save_category news is the return of one or more complete acceptance of the category information, and information submitted by the difference is only a summary of information, do not believe that the information, at the same time the original empty key Web services have been assigned to fill the key. Here is an example of the return message:


<result>
<category categoryKey="a01" parentCategoryKey="……">
<category categoryKey="a02" parentCategoryKey="a01" />
<category categoryKey="a03" parentCategoryKey="a01" />
<category categoryKey="a04" parentCategoryKey="a01" />
<product productKey="p01" parentCategoryKey="a01" />
<product productKey="p02" parentCategoryKey="a01" />
</ category>
<category categoryKey="b01" parentCategoryKey="……">
<category categoryKey="b07" parentCategoryKey="b01" />
<category categoryKey="b08" parentCategoryKey="b01" />
<product productKey="p09" parentCategoryKey="b01" />
</ category>
</ result>




delete_category

Delete category for the API call, to one or more category and all sub-elements deleted from the Catalog.


<delete_category>
<authInfo> ... ... </ authInfo>
<category categoryKey="…" /> *
</ delete_category>




Syntax in the above description, we should be able to find, save_category can be used to delete one or more of the use of categoryKey logo category. When a category is deleted when all its sub-elements (including elements and product sub-category sub-elements) will be deleted.

delete_category news is the return call by the implementation of one or more of the category to delete the list of key information.

find_product

Used in a catalog search to meet the conditions specified product, in the API message in support of a variety of query methods, such as name, such as followed in accordance with industry norms.


<find_product>
<authInfo> ... ... </ authInfo>
<category categoryKey="…" />
<name />
<compliantSpecBag />
<parameterBag>
</ find_product>




Find_product information in support of four search criteria:

category, the elements described in the search category to be the root of subtree. Shows that to be implemented search space is determined by the elements of the logo categoryKey by sub-category of all elements.
name, the name of the string element is described as the most left of string substring exist in the implementation of the search is the most left-matching, for example, in the name of the elements described in "China" then the "China Automotive", " China Computer "will be matched to the" high-quality Chinese car "will not be matched to.
compliantSpecBag, the elements described in a gathering of industry norms and rely on the aggregation of the designated search, we can all do not meet these specifications to exclude computer products outside of the search result set. Elements such as the norms contained in two USB1.1 and IEEE1394, then only to support specification of these two products will be searched.
parameterBag, the elements described in an accumulation of technical parameters, the use of compliantSpecBag similar way, all those who do not meet the description of the technical parameters specified computer products will be excluded from the search result set outside.
CompliantSpecBag and parameterBag the default search behavior is dealt with in the way of logic, we can specify parameters to define the logic or approach. For example:


<compliantSpecBag>
<logicBehavior value="OR" />
<specification specificationKey="Key[USB1.1]" />
<specification specificationKey="Key[IEEE1394]" />
</ compliantSpecBag>




Expressed the need for this example the search of computer products compatible with either USB1.1, or compatible IEEE1394 interface, then do not support the specification of these two norms of any computer products will be excluded from the search result set outside.

find_product news is the return call to be matched one or more of the product information, but to information is a summary list of the list. Here is an example of the return message:


<result>
<product productKey="p01" parentCategoryKey="a01" />
<name> ... ... </ name>
<description> ... ... </ description>
</ product>
<product productKey="p02" parentCategoryKey="a01" />
<name> ... ... </ name>
<description> ... ... </ description>
</ product>
</ result>




After analyzing the information of the three API, we is not hard to understand save_product, delete_product and three in front of find_category and similar information, and a more simplified form, it is not in the detailed description of the waste of space.

As for the remaining three sources: get_categoryDetail, get_productDetail and get_categoryInfo, a message to these three relatively simple entities into the return key information, and secondly after a demonstration in front of, I believe we should have a specific understanding of, so here not to spend a specific length of the definition of news.

Member Service

The Member Service, the API provides two sources:

get_authToken

Request for a Member Service to the authentication token. In all other API calls when they need to use the authentication token. This function is functionally equivalent to the request of those who complete the login procedure.


<get_authToken generic = "2.0" xmlns = "urn: uddi-org: api_v2"
userID = "someLoginName"
password = "somePassword" />




userID parameter must be the emergence of online services under the authority of that individual user. Member Service provided by the user to provide the user ID and password to check the validity of the method. password parameter must appear, it means the user ID corresponding to the password.

discard_authToken

Used to notify the Member Service, previously provided authentication token is no longer valid. While other Web services in the Member Service receive this message after the authentication token received by the use of other Web services should be judged as illegal.


<discard_authToken generic="2.0" xmlns="urn:uddi-org:api_v2">
<authInfo/>
</ discard_authToken>




authInfo This parameter is necessary, it is a token that contains the elements of the certification. Authentication token can be used to obtain get_authToken API call.

Feedback Service

save_feedback: preservation of feedback, in this API call, including the update and the new operation, at the same time the migration category can also be done through the API. In addition, the use of the API to delete the operation can be completed (the reason why this design is because of last resort is to delete this will happen only when the operation), the deletion of the operation through the introduction feedbackKey and authInfo only to complete the operation.
find_feedback: positioning in the catalog looking for feedback, such as name, such as such as categoryKey.
get_feedbackDetail: access to a category level with detailed information on all the feedback.
get_feedbackInfo: access to an entire subtree under the category of all the detailed feedback information.
Order Service

request_order: a request to issue orders, in this application API includes new orders and cancel orders for the two operations. When the incoming orderKey is empty and contains other details, the operation is to apply for new orders. OrderKey If the incoming order to the existing keys, but does not include other details of the contents of order, so that its operation is canceled orders. The return message can be specified, respectively, requests for orders to accept or reject the instructions.
get_orderDetail: access to details of orders to see in retrospect.
find_order: Search the input parameters in accordance with the conditions specified in the relevant orders.
Description and registration: Published Web Services

In this paper, a detailed description and presentation of a Web services API is how to design and definition, which introduced some of the basic design and application of the model. After this series of articles, I will use the WSDL description of Web services and Web services using UDDI registration to end the series.

Reference

Web Service Technology / comment sites
UDDI-China.ORG, to UDDI-based Web services technology site.
WebServices.ORG, Web services technology integrated site.
IBM developerWorks / Web Service Zone, IBM's Web Services Technology Resource Center
MSDN Online Web Services Developer Resources, Microsoft's Web services, Web site developers resources
ITPapers / Web Service, ITPapers reviews of Web services to resolve B2B e-business applications and integrated interactive InterOP Stack series of technical standards
UDDI Executive White Paper, UDDI-China.org, UDDI.org
UDDI Technical White Paper, UDDI-China.org, UDDI.org
UDDI programmers API specification, UDDI-China.org, UDDI.org
UDDI Data Structure Reference, UDDI-China.org, UDDI.org
Web Service Description Language (WSDL) 1.0, IBM, 25 Sep 2000
SOAP: Simple Object Access Protocol Specification 1.1, IBM, Microsoft, DevelopMentor, 2000
Extensible Markup Language (XML) 1.0 (Second Edition), W3C, 6 Oct 2000
About the author

CHAI Xiao-Lu: Shanghai too easy to e-commerce Technology Co., Ltd. (DealEasy) Chief System Architect, xml technology consultant. UDDI-China.org Studios Blue Flame (Blue Blaze Studio) members. UDDI Advisor Group members, WSUI Working Group members. Fudan University in 2000 a master's degree in computer science, computer science in the International Academic Conference (ICSC), the Asia-Pacific Seminar on XML technologies (XML Asia / Pacific'99), the Chinese XML technical seminar (Beijing), computer science journals various types of international and domestic major conferences and journals published more than paper. Specializing in XML-based system integration and data exchange of technical studies, at the same time on the database, object-oriented technologies such as technology and know more about CSCW.


.Net WebService Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.