diff options
Diffstat (limited to '')
2 files changed, 15 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerService.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerService.java index 9d640376e7..94ebc1e1b8 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerService.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerService.java @@ -23,6 +23,7 @@ import javax.jws.WebResult; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; +import javax.ws.rs.core.Response; import org.oasisopen.sca.annotation.Remotable; @@ -33,8 +34,12 @@ public interface CustomerService { @WebResult(name = "Customer", targetNamespace = "") Customer get(); + @GET + @WebResult(name = "Customer", targetNamespace = "") + Response getResponse(); + @POST - void addCustomer(Customer customer); + Response addCustomer(Customer customer); @PUT void updateCustomer(Customer customer); diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java index 70c718a656..22e63e0f91 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/test/java/services/customer/CustomerServiceImpl.java @@ -19,9 +19,12 @@ package services.customer; +import java.net.URI; import java.util.HashMap; import java.util.Map; +import javax.ws.rs.core.Response; + import org.oasisopen.sca.annotation.Init; import org.oasisopen.sca.annotation.Scope; @@ -38,8 +41,13 @@ public class CustomerServiceImpl implements CustomerService { return customers.values().iterator().next(); } - public void addCustomer(Customer customer) { + public Response getResponse() { + return Response.ok(get()).build(); + } + + public Response addCustomer(Customer customer) { customers.put(customer.getName(), customer); + return Response.created(URI.create("/001")).build(); } public void updateCustomer(Customer customer) { |