From c6df4ba458a496ded4f7fef8b2377a9919f68209 Mon Sep 17 00:00:00 2001 From: mcombellack Date: Thu, 21 May 2009 10:48:09 +0000 Subject: Initial commit of SMS Gateway JAS-WS web service that is used by the notification contribution git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@777046 13f79535-47bb-0310-9956-ffa450edef68 --- .../services/smsgateway-jaxws-service/pom.xml | 43 ++++++++++++++++++++++ .../scatours/smsgateway/SMSGatewayService.java | 32 ++++++++++++++++ .../smsgateway/SMSGatewayServiceBootstrap.java | 31 ++++++++++++++++ .../scatours/smsgateway/SMSGatewayServiceImpl.java | 34 +++++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 sandbox/travelsample/services/smsgateway-jaxws-service/pom.xml create mode 100644 sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayService.java create mode 100644 sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceBootstrap.java create mode 100644 sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceImpl.java (limited to 'sandbox/travelsample/services/smsgateway-jaxws-service') diff --git a/sandbox/travelsample/services/smsgateway-jaxws-service/pom.xml b/sandbox/travelsample/services/smsgateway-jaxws-service/pom.xml new file mode 100644 index 0000000000..d03790ab81 --- /dev/null +++ b/sandbox/travelsample/services/smsgateway-jaxws-service/pom.xml @@ -0,0 +1,43 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.5-SNAPSHOT + + + smsgateway-jaxws-service + Apache Tuscany SCA Tours SMS Gateway JAX-WS Service + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + diff --git a/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayService.java b/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayService.java new file mode 100644 index 0000000000..e6541a8ad0 --- /dev/null +++ b/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayService.java @@ -0,0 +1,32 @@ +/* + * 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. + */ +package scatours.smsgateway; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.Style; + +@WebService +@SOAPBinding(style = Style.RPC) +public interface SMSGatewayService { + + @WebMethod + boolean sendSMS(String fromNumber, String toNumber, String text); +} diff --git a/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceBootstrap.java b/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceBootstrap.java new file mode 100644 index 0000000000..8ed262e527 --- /dev/null +++ b/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceBootstrap.java @@ -0,0 +1,31 @@ +/* + * 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. + */ +package scatours.smsgateway; + +import javax.xml.ws.Endpoint; + +public class SMSGatewayServiceBootstrap { + + public static void main(String[] args) { + System.out.println("Publishing SMS Gateway Service as web service"); + + Endpoint.publish("http://localhost:8081/SMSGatewayService", + new SMSGatewayServiceImpl()); + } +} diff --git a/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceImpl.java b/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceImpl.java new file mode 100644 index 0000000000..6158ba6662 --- /dev/null +++ b/sandbox/travelsample/services/smsgateway-jaxws-service/src/main/java/scatours/smsgateway/SMSGatewayServiceImpl.java @@ -0,0 +1,34 @@ +/* + * 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. + */ +package scatours.smsgateway; + +import javax.jws.WebService; + +@WebService(endpointInterface + = "scatours.smsgateway.SMSGatewayService") +public class SMSGatewayServiceImpl implements SMSGatewayService { + + public boolean sendSMS(String fromNumber, String toNumber, String text) { + System.out.println("Sending SMS message"); + System.out.println("From: " + fromNumber); + System.out.println("To: " + toNumber); + System.out.println("Message: " + text); + return true; + } +} -- cgit v1.2.3