From f31b8fa6a3b9d9d356212670296c60beb468c8e5 Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 16 Mar 2010 17:57:42 +0000 Subject: Copy travelsample from 1.x to 2.x git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@923906 13f79535-47bb-0310-9956-ffa450edef68 --- .../smsgateway/SMSGatewayService.java | 32 +++++++++++++++++++++ .../smsgateway/SMSGatewayServiceBootstrap.java | 31 ++++++++++++++++++++ .../smsgateway/SMSGatewayServiceImpl.java | 33 ++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.java create mode 100644 sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java create mode 100644 sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java (limited to 'sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src') diff --git a/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.java b/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayService.java new file mode 100644 index 0000000000..696ab12daa --- /dev/null +++ b/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours.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/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java b/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java new file mode 100644 index 0000000000..6631aee907 --- /dev/null +++ b/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/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 com.tuscanyscatours.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: http://localhost:8081/SMSGatewayService"); + System.out.println("Press Ctrl^C to terminate..."); + + Endpoint.publish("http://localhost:8081/SMSGatewayService", new SMSGatewayServiceImpl()); + } +} diff --git a/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java b/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java new file mode 100644 index 0000000000..cd4eab052d --- /dev/null +++ b/sca-java-2.x/trunk/tutorials/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceImpl.java @@ -0,0 +1,33 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import javax.jws.WebService; + +@WebService(endpointInterface = "com.tuscanyscatours.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