- From: David Booth <dbooth@w3.org>
- Date: Fri, 20 Jun 2003 16:47:23 -0400
- To: "Savas Parastatidis" <Savas.Parastatidis@newcastle.ac.uk>, <www-ws-desc@w3.org>
Savas, The targetResource is intended to help in discovery or selection of an appropriate service. It is not intended to help in client or service code generation, nor is it intended to help ensure that the client and service agree on the interaction that they will have. I don't think the example you showed reflects the way the targetResource was intended to be used. Imagine you have 3000 printer services, and 5000 management services. You wish to print a document to the printer nearest to your office, but you first want to use its management service to find out how much ink is left in its toner cartridge. Your office mate, before leaving for vacation, told you that Web service PrinterService428 will print to that printer, but she didn't tell you which management service controls it. You have a directory of all of the Web service descriptions (WSDs) for all of your management services. How do you know which is the one that controls the printer you wish to use? The targetResource can help you. Here's how. Let's suppose all of the printer service descriptions use the same targetNamespace: targetNamespace="http://example.com/Printer_NS_Semantics.html" and all of the management service descriptions use the same targetNamespace: targetNamespace="http://example.com/Management_NS_Semantics.rdf" (BTW, don't confuse "targetNamespace" with "targetResource". They're totally different.) The WSDL 1.2 Web service description (WSD) of PrinterService428 says: <definitions targetNamespace="http://example.com/Printer_NS_Semantics.html" ...> ... <interface name="PrintInterface"> <operation name="PrintDocument"> ... </operation> </interface> ... <service name="PrinterService428" targetResource="http://example.com/printers/HPLaserJet3200/SN1235654007"> ... </service> </definitions> The WSD of ManagementService3456 says: <definitions targetNamespace="http://example.com/Management_NS_Semantics.rdf" ...> ... <interface name="PrinterManagementInterface"> <operation name="ManagePrinter"> ... </operation> </interface> ... <service name="ManagementService3456" targetResource="http://example.com/printers/HPLaserJet3200/SN1235654007"> ... </service> </definitions> Here's what you do. 1. First, you need to know the semantics of the WSD of PrinterService428. Fortunately, there SHOULD be a human or machine readable document at the end of the WSD's targetNamespace[1], defining its semantics. So you look at http://example.com/Printer_NS_Semantics.html and find that for services described using this namespace: a. the "PrintInterface" interface is the one to use to print a document; and b. the targetResource attribute identifies the physical printer that is manipulated when you send requests to a "PrintInterface". Good. (Of course, if there isn't a document at the end of the targetNamespace, then you're on your own to figure out the semantics of that WSD. Perhaps you can guess, or perhaps you can find some other document, in a non-standard location, that (you hope) correctly describes the semantics.) 2. Next, you need to confirm that the printer management services also use the targetResource attribute in the same way. So you look at http://example.com/Management_NS_Semantics.rdf and learn that for services described using this namespace: a. the "PrinterManagementInterface" is used to check the toner level; and b. the targetResource attribute identifies the physical printer that is manipulated when you send requests to a "PrinterManagementInterface". Excellent. That's what you wanted. 3. Next, you look up the value of the targetResource attribute in the WSD of PrinterService428 and find: targetResource="http://example.com/printers/HPLaserJet3200/SN1235654007" 4. Finally, you simply search your directory of WSDs for a service having targetNamespace="http://example.com/Management_NS_Semantics.rdf" and <interface name="PrinterManagementInterface"> and targetResource="http://example.com/printers/HPLaserJet3200/SN1235654007" The WSD that matches your search should be the WSD of the management service corresponding to PrinterService428. References 1. http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/wsdl12/wsdl12.html#Definitions_XMLRep -- David Booth W3C Fellow / Hewlett-Packard Telephone: +1.617.253.1273
Received on Friday, 20 June 2003 16:47:54 UTC