HistoryViewLinks to this page 2012 September 7 | 12:02 pm

In this scenario the client uses the service discovery documents to get the service URIs for an AM service provider project. Service URIs are available for each project or context that the service provider manages.

1. Starting with URI to the AM service providers catalog URI, we GET the service catalog resource. This resource is a common OSLC resource.

Request

GET https://am.acme.com/catalog/servicecatalog
Accept: application/x-oslc-disc-service-provider-catalog+xml

Response

200 OK
Content-Type: application/x-oslc-disc-service-provider-catalog+xml

<?xml version="1.0"?>
<oslc_disc:ServiceProviderCatalog
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/terms/" 
 xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/"
 rdf:about="http://am.acme.com/AMCatalog" >

 <dc:title>Architecture Management Service Provider Catalog</dc:title>

 <oslc_disc:entry>
 <oslc_disc:ServiceProvider>
 <dc:title>Project X</dc:title>
 <oslc_disc:details rdf:resource="http://am.acme.com/projects/_CGwYgAnrEd6_yLxvteIpZw" />
 <oslc_disc:services
 rdf:resource="http://am.acme.com/projects/_CGwYgAnrEd6_yLxvteIpZw/services.xml" />
 </oslc_disc:ServiceProvider>
 </oslc_disc:entry>

 <oslc_disc:entry>
 <oslc_disc:ServiceProvider>
 <dc:title>Project Y</dc:title>
 <oslc_disc:details rdf:resource="http://am.acme.com/projects/_sajkASDo92asDAsjd" />
 <oslc_disc:services
 rdf:resource="http://am.acme.com/projects/_sajkASDo92asDAsjd/services.xml" />
 </oslc_disc:ServiceProvider>
 </oslc_disc:entry>

</oslc_disc:ServiceProviderCatalog> 

2. The client examines the results and sees two entries. Each entry corresponds to a project or context on the server. Clients are to assume that if an antry appears in the result that it has at least some rights to the project. The client can use the returned information to prompt the user to select a specific project to search for an AM resource in. The client uses the oslc_disc:services resource to obtain the specific services (and endpoints) for the project. The client GETs the service document.

Request

GET <http://am.acme.com/projects/_CGwYgAnrEd6_yLxvteIpZw/services.xml>
Accept: application/x-oslc-am-service-description+xml

Response

200 OK
Content-Type: application/x-oslc-am-service-description+xml

<oslc_am:ServiceDescriptor xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/terms/" xmlns:oslc_am="http://open-services.net/xmlns/am/1.0/"
   rdf:about="http://am.acme.com/service-descriptor.xml">

   <dc:title>Project X</dc:title>
   <dc:description>My description of Project X.</dc:description>

   <oslc_am:ResourceFactory
      rdf:resource="https://am.acme.com/resourceFactory?projectId=Project X">
      <dc:title>Factory for creating AM Resources in Project X</dc:title>
   </oslc_am:ResourceFactory>

   <oslc_am:LinkTypeFactory
      rdf:resource="https://am.acme.com/linkTypeFactory?projectId=Project X">
      <dc:title>Factory for getting and if allowed creating Link Type URIs for use in Project X</dc:title>
   </oslc_am:LinkTypeFactory>

   <oslc_am:SimpleQuery
      rdf:resource="https://am.acme.com/simplequery/project1/">
      <dc:title>Simple Query end point</dc:title>
   </oslc_am:ResourceFactory>


   <oslc_am:SelectionDialog
      rdf:resource="https://am.acme.com/resourcePicker?projectId=Project X">
      <dc:title>Web UI for finding and selecting AM resources in Project X</dc:title>
      <oslc_am:hintWidth>400px</oslc_am:hintWidth>
      <oslc_am:hintHeight>500px</oslc_am:hintHeight>
   </oslc_am:SelectionDialog>

</oslc_am:ServiceDescriptor>

3. The service descriptor document contains the service end points for all the services available for the selected context/project. This document includes the name and description of the context/project. The discovered URLs MAY include query parts.

The Resource Factory URI is used to POST new resource requests to. The Link Type Factory URI is used to get known link type URIs that are used in resource links. If the service provider permits it, it can also be used register definitions for new link types. The Selection Dialog URI is used by clients that want a human readable HTML based web interface to search for and ‘select’ AM resources with.