WS-Inspection
A web service provider publishes a service description for consumers. This is typically published as a WSDL document. The service provider registers a reference to the service description in a centralized registry, typically UDDI. The consumer locates a reference to the service description by looking up the registry and requests the service description from the service provider. The description document is usually emailed to the consumer, limiting the dynamic discovery and use of the service.
The WS-Inspection specification allows for dynamic discovery of service documents. WS-Inspection is XML-based and provides an aggregation of references to service descriptions. A WS-Inspection document does not describe a service—it just helps in locating a desired description document. Generally, a WS-Inspection document is made available at the point of contact of the service. The consumer parses this document to retrieve the references to the service descriptions and selects a desired description. This is depicted in the following diagram:
WS-Inspection defines service and description elements to describe references to service descriptions. A typical example would be:
<inspection xmlns=”http://schemas.xmlsoap.org/ws/2001/10/inspection/”> <service> <description referencedNamespace=”http://schemas.xmlsoap.org/wsdl/” location=”http://mysite.com/myservice.wsdl” /> </service> <service> ... </service> </inspection>
The inspection
element encloses one or more service elements. Each service element contains a reference to the web service description. In this example, the first service element describes a reference to a WSDL document. The referencedNamespace
attribute describes the type of service description. The description itself may be defined in WSDL, UDDI, or plain HTML. Depending on the type of document, the attribute value for referencedNamespace
would be different.
The following example shows how a UDDI reference is described in the inspection document:
<service> <description referencedNamespace=”urn:uddi-org:api”> <wsiluddi:serviceDescription location=”http://mysite.com/uddi/myservice”> <wsiluddi:serviceKey> ... </wsiluddi:serviceKey> </wsiluddi:serviceDescription> </description> </service>
Inspection Document Hierarchy
A hierarchy of inspection documents can be created using the link
element:
<wsil:link referencedNamespace=”http://schemas.xmlsoap.org/ws/2001/10/inspection/” location=”uri”>
The location specifies the URI of the other inspection document.