Home > Products > SophiaFramework UNIVERSE > Tutorial > Amazon E-Commerce > - 3 / 9 -

REST and SOAP

About REST

REST (Representational State Transfer) allows you to make calls to ECS by passing parameter keys and values in a URL (Uniform Resource Locator). ECS returns its response in XML (Extensible Markup Language) format.

REST request example:

 http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService
 &AWSAccessKeyId=[your Access Key ID here]
 &Operation=ItemSearch
 &SearchIndex=Books
 &ResponseGroup=Small
 &Keywords=xml

REST response example (extracted):

...

- <Items>
 + <Request>
   <IsValid>True</IsValid> 
  - <ItemSearchRequest>
    <Keywords>xml</Keywords> 
    <ResponseGroup>Small</ResponseGroup> 
    <SearchIndex>Books</SearchIndex> 
   </ItemSearchRequest>
   </Request>
   <TotalResults>1545</TotalResults> 
   <TotalPages>155</TotalPages> 
 - <Item>
    <ASIN>0321430840</ASIN> 
    <DetailPageURL>http://www.amazon.com/gp/redirect.html%3FASIN=...
    </DetailPageURL> 
  - <ItemAttributes>
     <Author>Elizabeth Castro</Author> 
     <Manufacturer>Peachpit Press</Manufacturer> 
     <ProductGroup>Book</ProductGroup> 
     <Title>HTML, XHTML, and CSS, Sixth Edition (Visual Quickstart Guide)</Title> 
    </ItemAttributes>
  </Item>
...
 </Items>
...

About SOAP

SOAP (Simple Object Access Protocol) allows you to use Amazon E-Commerce Service (ECS) by making remote procedure calls. This information is encoded using XML.

SOAP request example:

<?xml version="1.0" encoding="UTF-8" ?> 
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 - <SOAP-ENV:Body>
  -<m:ItemSearch xmlns:m="http://webservices.amazon.com/AWSECommerceService/2005-03-23">
 - <m:Request>
    <m:Keywords>xml</m:Keywords> 
    <m:SearchIndex>Books</m:SearchIndex> 
    <m:SubscriptionId>0525E2PQ81DD7ZTWTK82</m:SubscriptionId> 
    <m:ResponseGroup>Small</m:ResponseGroup> 
   </m:Request>
  </m:ItemSearch>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

SOAP response example (extracted):

<?xml version="1.0" encoding="UTF-8" ?>

...

- <SOAP-ENV:Body>
 -<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2005-03-23">
 + <OperationRequest>
 - <Items>
 + <Request>
   <TotalResults>1545</TotalResults> 
   <TotalPages>155</TotalPages> 
 - <Item>
   <ASIN>0321430840</ASIN> 
   <DetailPageURL>http://www.amazon.com/gp/redirect.html%3FASIN= ...
   </DetailPageURL> 
 - <ItemAttributes>
   <Author>Elizabeth Castro</Author> 
   <Manufacturer>Peachpit Press</Manufacturer> 
   <ProductGroup>Book</ProductGroup> 
   <Title>HTML, XHTML, and CSS, Sixth Edition (Visual Quickstart Guide)</Title> 
  </ItemAttributes>
 </Item>
...

Go back  1   2   3   4   5   6   7   8   9  Next page