From 200a40b332420f94992eb39a6d0ea1cf1490ffc4 Mon Sep 17 00:00:00 2001 From: coreyg Date: Fri, 21 Nov 2014 09:30:19 +0000 Subject: Adding tuscany's website to their svn repo for svnpubsub git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68 --- site/trunk/site-publish/sca-cpp-bindings-rest.html | 160 +++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 site/trunk/site-publish/sca-cpp-bindings-rest.html (limited to 'site/trunk/site-publish/sca-cpp-bindings-rest.html') diff --git a/site/trunk/site-publish/sca-cpp-bindings-rest.html b/site/trunk/site-publish/sca-cpp-bindings-rest.html new file mode 100644 index 0000000000..216639907c --- /dev/null +++ b/site/trunk/site-publish/sca-cpp-bindings-rest.html @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + Apache Tuscany : SCA CPP Bindings REST + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > SCA Overview > SCA Native > SCA Native Work-in-progress > SCA CPP Users > SCA CPP Bindings REST + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

REST Resource Patterns

+ +

If the service/reference uses an <interface.rest> interface, we map CRUD
+methods to HTTP verbs to access resource representations as follows:

+ +

resource = retrieve()
+-> GET <binding-uri>
+<- an XML element representing the REST resource

+ +

resource = retrieve(uri, parm-value-1, parm-value-n)
+-> GET uri/parm-value-1/parm-value-n
+or if uri ends with a '?'
+-> GET uri?parm-name-1=parm-value1&parm-name-n=parm-value-n
+<- an XML element representing the REST resource

+ +

uri = create(resource)
+-> POST <binding-uri> + an XML element representing the resource to create
+<- Location header containing the uri of the created resource

+ +

update(resource)
+-> PUT <binding-uri> + an XML element representing the updated resource

+ +

update(uri, parm-1, parm-n, resource)
+-> PUT uri/parm-value-1/parm-value-n + an XML element representing the updated resource
+or if uri ends with a '?'
+-> PUT uri?parm-name-1=parm-value1&parm-name-n=parm-value-n + an XML element representing the updated resource

+ +

delete()
+-> DELETE <binding-uri>

+ +

delete(uri, parm-1, parm-n)
+-> DELETE uri/parm-value-1/parm-value-n
+or if uri ends with a '?'
+-> DELETE uri?parm-name-1=parm-value1&parm-name-n=parm-value-n

+ +

In this mode, HTTP return codes are used almost as described in the Atom spec. Also GET returns etags with the retrieved resource representations to help caching by clients.

+ +

REST RPC Patterns

+

If the service/reference does not use an <interface.rest> interface, then this is not a real REST pattern, we simply flow method calls over XML / HTTP as follows:

+ +

result = method-abc(parm-1, parm-n)

+ +

if single input parameter of complex type
+-> POST <binding-uri>/method-abc + XML element representing the complex parameter or if multiple parameters including parameters of complex types
+-> POST <binding-uri>/method-abc + Mime multipart/form-data body containing one parameter per part or if multiple parameters all of simple types
+-> GET
+<binding-uri>/method-abc?parm-1-name=parm-1-value&parm-n-name=parm-n-value

+ +

<- an XML element representing the result

+
+
+
+ + +
+ + + + + + website stats + + + + + + -- cgit v1.2.3