diff options
Diffstat (limited to 'sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main')
5 files changed, 226 insertions, 0 deletions
diff --git a/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldClient.java b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..f9781fb48d --- /dev/null +++ b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldClient.java @@ -0,0 +1,47 @@ +/* + * 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 helloworld; + +import org.osoa.sca.CompositeContext; +import org.osoa.sca.CurrentCompositeContext; + +/** + * This client program shows how to create an SCA runtime, start it, locate the Eager Init service and invoke it. + */ +public final class HelloWorldClient { + private HelloWorldClient() { + } + + public static void main(String[] args) throws Exception { + String name = "World"; + + CompositeContext compositeContext = CurrentCompositeContext.getContext(); + + // Locate the Eager init service + HelloWorldService helloWorldService = + compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent"); + + // Invoke the HelloWorld service + String value = helloWorldService.getGreetings(name); + + System.out.println(value); + System.out.flush(); + + } +} diff --git a/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldImpl.java b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..0de3c70303 --- /dev/null +++ b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldImpl.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 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/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldService.java b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..8f23acd645 --- /dev/null +++ b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/java/helloworld/HelloWorldService.java @@ -0,0 +1,28 @@ +/* + * 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 helloworld; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +public interface HelloWorldService { + + String getGreetings(String name); + +} diff --git a/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/resources/META-INF/sca/default.scdl b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/resources/META-INF/sca/default.scdl new file mode 100644 index 0000000000..281cdd37ab --- /dev/null +++ b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/resources/META-INF/sca/default.scdl @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. + --> +<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="helloworldws"> + + <service name="HelloWorldWebService" target="http:///foo"> + <!-- interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)"/ --> + <interface.java interface="helloworld.HelloWorldService"/> + + +<!--FIXME the location attribute is a really bad hack here! does not follow to spec at all +--> + <binding.ws endpoint="http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)" + conformanceURIs="http://ws-i.org/profiles/basic/1.1" + location="wsdl/helloworld.wsdl" + /> + + <reference>HelloWorldServiceComponent</reference> + </service> + + <component name="HelloWorldServiceComponent"> + <implementation.java class="helloworld.HelloWorldImpl"/> + </component> + +</composite> diff --git a/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/resources/wsdl/helloworld.wsdl b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/resources/wsdl/helloworld.wsdl new file mode 100644 index 0000000000..21781bfc7f --- /dev/null +++ b/sandbox/old/contrib/binding-celtix/samples/helloworldws-celtix/src/main/resources/wsdl/helloworld.wsdl @@ -0,0 +1,77 @@ +<!-- + * 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. + --> +<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> |