diff options
Diffstat (limited to 'sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src')
5 files changed, 188 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..bf7209e7a8 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/java/helloworld/HelloWorldImpl.java @@ -0,0 +1,31 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 helloworld; + +import org.osoa.sca.annotations.Service; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + + public String getGreetings(String name) { + return "Hello " + name; + } + +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/java/helloworld/HelloWorldService.java b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..1f87f17d74 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/java/helloworld/HelloWorldService.java @@ -0,0 +1,26 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 helloworld; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +public interface HelloWorldService { + + public String getGreetings(String name); + +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/resources/sca.module b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/resources/sca.module new file mode 100644 index 0000000000..20139fced7 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/resources/sca.module @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+ name="helloworld">
+
+ <import.sdo wsdlLocation="wsdl/helloworld.wsdl"/>
+ <import.wsdl wsdlLocation="wsdl/helloworld.wsdl"/>
+
+ <entryPoint name="HelloWorldWebService">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)"/>
+ <binding.ws port="http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)"/>
+ <reference>HelloWorldServiceComponent/HelloWorldService</reference>
+ </entryPoint>
+
+ <component name="HelloWorldServiceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ </component>
+
+</module>
diff --git a/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/resources/wsdl/helloworld.wsdl b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/resources/wsdl/helloworld.wsdl new file mode 100644 index 0000000000..cbc15f58eb --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/resources/wsdl/helloworld.wsdl @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> +<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" + name="helloworld">
+ + <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+ + <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ + <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8080/sample-helloworldws/services/HelloWorldWebService"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..603eebabb1 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/samples/sca/helloworldws/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> + +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web +Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app> + <display-name>Tuscany HelloWorld Web Service Sample</display-name> + +</web-app> |