ReadMe:REST Interface to the OASIS Ebxml Reg/Rep
================================================
[en_US] Dated:October22,2002
Author:Uday Subbarayan(mailto: uday.s@sun.com)
$Header: /cvsroot/ebxmlrr/ebxmlrr/doc/REST_ReadMe.txt,v 1.2 2002/11/09 03:11:13 jasilva Exp $

The beta release of Ebxml Registry/Repository has the new v3.0 feature of REST implementation.The REST
(Representational State Transfer) is a new webservices construction model and it applies the principles of
web to the transaction oriented services.
For more information about REST,you can go to this URL,http://internet.conveyor.com/RESTwiki/moin.cgi.
For more information about the REST interface to ebxmlrr,refer the spec,
OASIS/ebXML Registry Services Specification v2.2, chapter 6.6

The current REST implementation has all the 3 mandatory methods specified in the spec.

1.)To test the getRegistryObject method in QueryManager,
Populate your database with (some)test data's as specified in the ebxmlrr setup guide and do a 
select * from registryobject;
in your db to find out the id's inthe database.
Then go to this URL in your web browser:
http://<ebxmlrr-hostname>:<port-no>/ebxmlrr/registry/rest?interface=QueryManager&method=getRegistryObject&param-id=<id>

The sample response will look like:
<?xml version="1.0" ?> 
- <ExtrinsicObject id="urn:uuid:bbea8fa2-18dc-4701-aff3-fa264d20e644" objectType="IMAGE" majorVersion="0" minorVersion="1" status="Submitted" mimeType="null" isOpaque="false" xmlns="urn:oasis:names:tc:ebxml-regrep:rim:xsd:2.1">
- <Name>
  <LocalizedString lang="en-us" charset="UTF-8" value="Nikola and Zeus" /> 
  </Name>
- <Description>
  <LocalizedString lang="en-us" charset="UTF-8" value="This was when Zeus was a little puppy" /> 
  </Description>
  </ExtrinsicObject>

2.)To test the getRepositoryItem method in QueryManager,
first you need to load some items in the repository.If you haven't loaded any items
(check /exmlrr/data/repository)and if it's empty, then you can execute the loadPicture target in the 
server to load some items.
After loading the item in the repository,goto this URL in your web browser,
http://<ebxmlrr-hostname>:<port-no>/ebxmlrr/registry/rest?interface=QueryManager&method=getRepositoryItem&param-id=urn:uuid:<item-id>

The reponse will be, for example if you have loaded the some picures(gif's),you will get the gif 
in your browser.

3.)To test the submitAdhocQueryRequest method in QueryManger,
you can run the RESTSender.java with input as AdhocQueryRequest(XML file)
    set the CLASSPATH=CLASSPATH=/ebxmlrr/build/lib/classes:$CLASSPATH and then run the RESTSender for exmple,
    java com.sun.ebxml.registry.interfaces.rest.RESTSender /ebxmlrr/misc/samples/SQLQuery_1.xml
    
The reponse you will get "success" as:
<?xml version="1.0"?>
<RegistryResponse status="Success" xmlns="urn:oasis:names:tc:ebxml-regrep:registry:xsd:2.1"><AdhocQu
eryResponse xmlns="urn:oasis:names:tc:ebxml-regrep:query:xsd:2.1"><SQLQueryResult><Organization id="
urn:uuid:dafa4da3-1d92-4757-8fd8-ff2b8ce7a1bf" objectType="Organization" primaryContact="urn:uuid:97
7d9380-00e2-4ce8-9cdc-d8bf6a4157be"><Name><LocalizedString lang="us-en" charset="UTF-8" value="Sun M
icrosystems Inc."/></Name><Description><LocalizedString lang="us-en" charset="UTF-8" value="Makes Ja
va. Provider of free Java software."/></Description><Slot name="NASDAQ Symbol"><ValueList><Value>SUN
W</Value></ValueList></Slot><Slot name="Scott McNealys home phone number"><ValueList><Value>415-123-
4567</Value></ValueList></Slot><Classification id="urn:uuid:ee753a41-766b-4016-9c61-c299b9abad3e" ob
jectType="Classification" classifiedObject="urn:uuid:dafa4da3-1d92-4757-8fd8-ff2b8ce7a1bf" classific
ationNode="urn:uuid:1152986f-f5fd-4e69-963b-9088678a2e73"><Name><LocalizedString lang="us-en" charse
t="UTF-8" value="United States"/></Name><Description/></Classification><Classification id="urn:uuid:
4f7b6de4-c2df-4cd6-9b38-af43f1274fa7" objectType="Classification" classifiedObject="urn:uuid:dafa4da
3-1d92-4757-8fd8-ff2b8ce7a1bf" classificationNode="urn:uuid:5814e155-2b4e-464e-bcf1-fa045911ed94"><N
ame><LocalizedString lang="us-en" charset="UTF-8" value="Computer and Peripheral Equipment Manufactu
ring"/></Name><Description/></Classification><Classification id="urn:uuid:3093822c-d5d2-4c76-9474-ed
8842239ee7" objectType="Classification" classifiedObject="urn:uuid:dafa4da3-1d92-4757-8fd8-ff2b8ce7a
1bf" classificationNode="urn:uuid:4333395d-05ef-48d9-b905-f1468cc4a47a"><Name><LocalizedString lang=
"us-en" charset="UTF-8" value="Software Publishers"/></Name><Description/></Classification><External
Identifier id="urn:uuid:fbc8d86a-bd00-4e73-9a2e-f862cb34fc30" objectType="ExternalIdentifier" identi
ficationScheme="urn:uuid:8d0b7b54-0dae-427f-9793-868407b74ea9" value="SUNW"><Name><LocalizedString l
ang="us-en" charset="UTF-8" value="Sun Microsystems"/></Name><Description/></ExternalIdentifier><Add
ress city="Burlington" country="USA" postalCode="01867" stateOrProvince="MA" street="Network Dr." st
reetNumber="1"/><TelephoneNumber areaCode="781" countryCode="1" number="442-0704" phoneType="fax"/><
TelephoneNumber areaCode="781" countryCode="1" number="442-0703" phoneType="office"/></Organization>
<ObjectRef id="urn:uuid:dafa4da3-1d92-4757-8fd8-ff2b8ce7a1bf"/><ObjectRef id="urn:uuid:1152986f-f5fd
-4e69-963b-9088678a2e73"/><ObjectRef id="urn:uuid:5814e155-2b4e-464e-bcf1-fa045911ed94"/><ObjectRef
id="urn:uuid:4333395d-05ef-48d9-b905-f1468cc4a47a"/><ObjectRef id="urn:uuid:8d0b7b54-0dae-427f-9793-
868407b74ea9"/><ObjectRef id="urn:uuid:977d9380-00e2-4ce8-9cdc-d8bf6a4157be"/></SQLQueryResult></Adh
ocQueryResponse></RegistryResponse>
                                                                                    End of File
===================================================================================================
    


