summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-28 19:41:51 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-28 19:41:51 +0000
commitcbe502740bdd6d2a0ae56d113882dd9d6b31c394 (patch)
treebfb25bbced6038f250e9ea972be35e76f6a200fe /sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py
parente982b4ef38fd043c15e89bdd60763b10434a087e (diff)
Removed contrib folder now that it's saved in its own branch.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@917274 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py')
-rw-r--r--sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py85
1 files changed, 0 insertions, 85 deletions
diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py
deleted file mode 100644
index 340da8700d..0000000000
--- a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-#
-# This Python code is a simple sample that provides a Python
-# client for the REST Customer sample
-
-
-from xml.etree import ElementTree as et
-import sca
-
-# Locate the customer resource service
-customerResource = sca.locateservice("CustomerResource")
-
-# Show how to invoke CRUD operations on the customer resource
-# The CRUD operations translate to HTTP POST, GET, PUT and DELETE
-# according to the REST pattern
-
-customer = customerResource.retrieve("2345")
-print "Rest - Retrieved customer " + et.tostring(customer)
-
-customer = et.fromstring("""<customer xmlns="http://sample.customer"><id>1234</id><firstName>Jane</firstName><lastName>Doe</lastName></customer>""")
-url = customerResource.create(customer)
-print "Rest - Created customer " + url
-
-customer = customerResource.retrieve("1234")
-print "Rest - Retrieved customer " + et.tostring(customer)
-
-customer = customerResource.retrieve(url)
-print "Rest - Retrieved by url " + et.tostring(customer)
-
-customer.find("{http://sample.customer}lastName").text="Smith"
-customerResource.update("1234", customer)
-print "Rest - Updated customer 1234"
-
-customer = customerResource.retrieve("1234")
-print "Rest - Retrieved customer " + et.tostring(customer)
-
-customerResource.delete("1234")
-print "Rest - Deleted customer 1234"
-
-# Also show how to use REST binding to invoke remote commands
-# using HTTP GET and XML over HTTP POST, the REST binding
-# uses that command pattern when you don't declare a REST interface
-# on your SCA reference
-
-# Locate the customer command service
-customerCommand = sca.locateservice("CustomerCommand")
-
-# Invoke operations on the customer command service
-customer = customerCommand.retrieve("2345")
-print "Command - Retrieved customer " + et.tostring(customer)
-
-customer = et.fromstring("""<customer xmlns="http://sample.customer"><id>1234</id><firstName>Jane</firstName><lastName>Doe</lastName></customer>""")
-url = customerCommand.create(customer)
-print "Command - Created customer " + url
-
-customer = customerCommand.retrieve("1234")
-print "Command - Retrieved customer " + et.tostring(customer)
-
-customer.find("{http://sample.customer}lastName").text="Smith"
-customerCommand.update("1234", customer)
-print "Command - Updated customer 1234"
-
-customer = customerCommand.retrieve("1234")
-print "Command - Retrieved customer " + et.tostring(customer)
-
-customerCommand.delete("1234")
-print "Command - Deleted customer 1234"