AtomPub sample requests - 7.1

Talend ESB Infrastructure Services Configuration Guide

EnrichVersion
7.1
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
EnrichPlatform
Talend ESB
Talend Runtime
task
Design and Development
Installation and Upgrade

To obtain the AtomPub REST application service document, execute a GET request on address: http://localhost:8040/services/registry/admin.

The response will contain a description of all resource collections supported by the service:

<service xmlns="http://www.w3.org/2007/app" 
   xmlns:atom="http://www.w3.org/2005/Atom">
  <workspace>
     <atom:title type="text">Talend ESB Registry</atom:title>
     <collection href="http://localhost:8040/services/registry/admin/wsdl">
         <atom:title type="text">
            WSDL (Web Service Definition Language)
        </atom:title>
        <accept>application/atom+xml; type=entry</accept>
     </collection>
     <collection 
         href="http://localhost:8040/services/registry/admin/ws-policy">
        <atom:title type="text">
            WS-Policy (Web Services Policy)
        </atom:title>
        <accept>application/atom+xml; type=entry</accept>
     </collection>
     <collection href=
         "http://localhost:8040/services/registry/admin/ws-policy-attach">
        <atom:title type="text">
            WS-PolicyAttachment (Web Services Policy Attachment)
        </atom:title>
        <accept>application/atom+xml; type=entry</accept>
     </collection>
  </workspace>
</service>

The below examples are described for the WS-Policy resource type ws-policy but also work for the other resource types listed above. For those, just change the resource type parameter accordingly in the request URL.

To retrieve a collection of policy resources

Execute a GET request using address http://localhost:8040/services/registry/admin/ws-policy.

Sample response:

<feed xmlns="http://www.w3.org/2005/Atom">
   <id>urn:uuid:021a3df1-037f-3bd6-a65d-9b19ab066063</id>
   <title type="text">
      Talend ESB Registry :: Collection of POLICY resources [size:1]
   </title>
   <author>
      <name>Talend ESB Registry</name>
   </author>
   <generator version="">
      Talend ESB Registry AtomPub REST Service
   </generator>
   <updated>2013-03-12T07:59:22.658Z</updated>
   <link href="http://localhost:8040/services/registry/admin/ws-policy"
      rel="self"/>
   <entry xmlns:reg="http://www.talend.com/esb/registry/1.0">
      <author>
         <name>username</name>
      </author>
      <title type="text">title</title>
      <id>urn:uuid:296755cc-bf48-4b78-a8d1-5823566fade4</id>
      <updated>2013-03-12T07:59:22.658Z</updated>
      <link href="http://localhost:8040/services/registry/admin/   \\ 
         ws-policy/296755cc-bf48-4b78-a8d1-5823566fade4/check" 
         rel="related"/>
      <link href="http://localhost:8040/services/registry/admin/   \\
         ws-policy/296755cc-bf48-4b78-a8d1-5823566fade4" rel="self"/>
      <published>2013-03-12T07:59:22.658Z</published>
      <summary type="text">summary</summary>
      <content type="application/wspolicy+xml" 
         src="http://localhost:8040/services/registry/admin/ws-policy/   \\
         296755cc-bf48-4b78-a8d1-5823566fade4/content"/>
      <reg:name>SAMLToken</reg:name>
   </entry>
</feed>

To create a policy resource

Execute a POST request using address http://localhost:8040/services/registry/admin/ws-policy, with an HTTP header value of ContentType: application/atom+xml;type=entry added to the request.

Sample request body:

<entry xmlns="http://www.w3.org/2005/Atom">
   <author>
      <name>author</name>
   </author>
   <title>some policy title</title>
   <id></id>
   <updated>2012-09-12T12:53:44.512Z</updated>
   <summary type="text">policy description</summary>
   <content type="application/xml">
      <wsp:Policy Name="usernameToken"
         xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:sp=
         "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
         xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401  \\
         -wss-wssecurity-utility-1.0.xsd">
         <wsp:ExactlyOne>
            <wsp:All>
               <sp:SupportingTokens>
                  <wsp:Policy>
                     <sp:UsernameToken sp:IncludeToken=
                    "http://docs.oasis-open.org/ws-sx/ws-securitypolicy  \\
                        /200702/IncludeToken/AlwaysToRecipient">
                        <wsp:Policy />
                     </sp:UsernameToken>
                  </wsp:Policy>
               </sp:SupportingTokens>
            </wsp:All>
         </wsp:ExactlyOne>
      </wsp:Policy>
   </content>
</entry>

Sample POST response:

<entry xmlns="http://www.w3.org/2005/Atom" 
   xmlns:reg="http://www.talend.com/esb/registry/1.0">
   <author>
      <name>username</name>
   </author>
   <title type="text">some policy title</title>
   <id>urn:uuid:0989f1a9-d0c6-42df-a223-b41fff7c0395</id>
   <updated>2013-03-12T07:59:22.658Z</updated>
   <link href="http://localhost:8040/services/registry/admin/   \\
      ws-policy/0989f1a9-d0c6-42df-a223-b41fff7c0395/check" rel="related"/>
   <link href="http://localhost:8040/services/registry/admin/   \\
      ws-policy/0989f1a9-d0c6-42df-a223-b41fff7c0395" rel="self"/>
   <published>2013-03-12T07:59:22.658Z</published>
   <summary type="text">policy description</summary>
   <content type="application/wspolicy+xml" 
      src="http://localhost:8040/services/registry/admin/ws-policy/   \\
         0989f1a9-d0c6-42df-a223-b41fff7c0395/content"/>
   <reg:name>usernameToken</reg:name>
</entry>

To read a policy resource

Execute a GET request on address http://localhost:8040/services/registry/admin/ws-policy/{resource id} where resource id is a UUID similar to the 0989f1a9-d0c6-42df-a223-b41fff7c0395 retrieved from the previous example.

Sample GET response:

<entry xmlns="http://www.w3.org/2005/Atom">
   <author>
      <name>username</name>
   </author>
   <title type="text">{no title}</title>
   <id>urn:uuid:0989f1a9-d0c6-42df-a223-b41fff7c0395</id>
   <updated>2013-03-12T07:59:22.658Z</updated>
   <link href="http://localhost:8040/services/registry/admin/   \\
      ws-policy/0989f1a9-d0c6-42df-a223-b41fff7c0395" rel="self" />
   <published>2013-03-12T07:59:22.658Z</published>
   <summary type="text">{empty summary}</summary>
   <content type="application/wspolicy+xml" 
   src="http://localhost:8040/services/registry/admin/ws-policy/   \\
      0989f1a9-d0c6-42df-a223-b41fff7c0395/content" />
</entry>

To update a policy resource

Execute a PUT request on address http://localhost:8040/services/registry/admin/ws-policy/{resource id} with an HTTP header of ContentType: application/atom+xml;type=entry.

Sample PUT request:

<entry xml:base="http://policy" xmlns="http://www.w3.org/2005/Atom">
   <author>
      <name>author</name>
   </author>
   <title>new policy title</title>
   <id>urn:uuid:0989f1a9-d0c6-42df-a223-b41fff7c0395</id>
   <updated>2012-09-12T12:53:44.512Z</updated>
   <content type="application/xml">
      <!--
         modified policy document here
      -->
   </content>
</entry>

To retrieve or delete a policy resource

Execute a GET or DELETE request, respectively, on address http://localhost:8040/services/registry/admin/ws-policy/{resource id}.

To update a policy resource

Execute a PUT request on address http://localhost:8040/services/registry/admin/ws-policy/{resource id} with the new policy document as the request body.

To create a Policy Attachment

Execute a POST request on address http://localhost:8040/services/registry/admin/ws-policy-attach with an HTTP header value of ContentType: application/atom+xml;type=entry.

Sample POST request body:

<entry xmlns="http://www.w3.org/2005/Atom">
   <author>
      <name>author</name>
   </author>
   <title>my title</title>
   <id>urn:uuid:5296755cc-bf48-4b78-bbbb-5823566fade4</id>
   <updated>2012-09-12T12:53:44.512Z</updated>
   <summary type="text">content summary</summary>
   <content type="application/xml">
      <wsp:PolicyAttachment xmlns:wsp="http://www.w3.org/ns/ws-policy">
         <wsp:AppliesTo>
            <wsp:URI>http://services.talend.org/ReservationService#   \\
               wsdl11.service(ReservationServiceProvider)</wsp:URI>
         </wsp:AppliesTo>
         <wsp:PolicyReference URI="usernameToken" />
      </wsp:PolicyAttachment>
   </content>
</entry>

Sample POST response:

<entry xmlns="http://www.w3.org/2005/Atom" 
   xmlns:reg="http://www.talend.com/esb/registry/1.0">
   <author>
      <name>username</name>
   </author>
   <title type="text">my title</title>
   <id>urn:uuid:8cb99f38-20e7-417a-99d3-9f66f45bf216</id>
   <updated>2013-03-12T10:16:31.312Z</updated>
   <link href="http://localhost:8040/services/registry/admin/   \\
      ws-policy-attach/8cb99f38-20e7-417a-99d3-9f66f45bf216" rel="self"/>
   <link href="http://localhost:8040/services/registry/admin/   \\
      ws-policy-attach/8cb99f38-20e7-417a-99d3-9f66f45bf216/check" 
      rel="related"/>
   <published>2013-03-12T10:16:31.312Z</published>
   <summary type="text">content summary</summary>
   <content type="application/wspolicy+xml" 
      src="http://localhost:8040/services/registry/admin/   \\
      ws-policy-attach/8cb99f38-20e7-417a-99d3-9f66f45bf216/content"/>
   <reg:targetNamespace>
      http://services.talend.org/ReservationService
   </reg:targetNamespace>
   <reg:serviceName>
      {http://services.talend.org/ReservationService}   \\
      ReservationServiceProvider
   </reg:serviceName>
   <reg:name>urn:uuid:75c75618-6847-477d-b8b9-d961b003dc56</reg:name>
</entry>

To check the consistency of the resources

Execute GET request on address:
  • http://localhost:8040/services/registry/admin/wsdl/{id}/check to check the consistency of a specific WSDL, including the policies assigned to it.

  • http://localhost:8040/services/registry/admin/ws-policy/{id}/check to check the consistency of a specific policy.

Sample of successful response:

<resourceCheckerResultCollection>
  <resourceCheckerResult>
    <passed>true</passed>
  </resourceCheckerResult>
</resourceCheckerResultCollection>

Sample of failed response:

<resourceCheckerResultCollection>
  <resourceCheckerResult>
    <failedInfo>
      <failedItems>
        <detailInfo>Cannot find policy resource referenced by uri -
      schemaValidation</detailInfo>
        <item>schemaValidation</item>
      </failedItems>
      <resName>urn:uuid:eed948da-5173-4b6e-b27e-4d7f8967abaf</resName>
    </failedInfo>
    <passed>false</passed>
  </resourceCheckerResult>
</resourceCheckerResultCollection>