tailieunhanh - Developing Web Services with Apache Axis 2 phần 2
Bạn đã sử dụng như không gian tên mục tiêu. Có một lựa chọn tốt? Về cơ bản một không gian tên là tốt miễn là nó là duy nhất trên toàn cầu. Vì vậy, điều này nên được tốt. Tuy nhiên, người ta có thể cố gắng để tải về một trang web từ URL này. Khi không làm việc, họ có thể nghi ngờ rằng dịch vụ web của bạn là của để. | Chapter 1 Designing the interface for a simple web service 23 A web service Target namespace http ss A schema Port type stringUtil You ve been using http ss as the target namespace. Is it a good choice Basically a namespace is good as long as it is globally unique. So this one should be good. However people may try to download a web page from this URL. When it doesn t work they may suspect that your web service is out of order. To avoid this confusion you may use something called URN Uniform Resource Name as the namespace. A namespace must be a URI. URI stands for Uniform Resource Identifier. There are two kinds of URI. One is URL such as http bar. The other is URN. A URN takes the format of urn some-object-type some-object-id . For example International ISBN Agency has made a request to the IANA International Assigned Numbers Association that it would like to manage the object type named isbn . After the request has been approved the International ISBN Agency can declare that a URN urn isbn 1-23-456789-0 will identify a book whose ISBN is 1-23-456789-0. It can determine the meaning of the object id without consulting IANA at all. Similarly you may submit a request to IANA to register your Internet domain name such as as the object type. Then on approval you can use URNs like urn xyz to identify an object xyz in your company. What xyz means or its format is completely up to you to decide. For example you may use urn product 123 so xyz is product 123 to mean the product 123 produced by your company or urn patent 123 so xyz is patent 123 to mean a patent coded 123 in your company. 24 Chapter 1 Designing the interface for a simple web service However this will create a lot of workload on you and on IANA one registration per company . As you have already registered the domain name it is unlikely that someone will use it in their URN s. So you may want to go ahead and use or as many people .
đang nạp các trang xem trước