From 5963a2d3d6860fe57afc138f095bf2d2eb5a7b80 Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 7 Oct 2013 22:23:21 +0000 Subject: Official Tuscany 2.0.1 Release git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1530096 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/binding/ws/jaxws/external/service/Bar.java | 152 +++++++++++++++++++++ .../sca/binding/ws/jaxws/external/service/Foo.java | 88 ++++++++++++ .../jaxws/external/service/HelloWorldService.java | 64 +++++++++ .../service/HelloWorldServiceLauncher.java | 49 +++++++ 4 files changed, 353 insertions(+) create mode 100644 sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java create mode 100644 sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java create mode 100644 sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java create mode 100644 sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java (limited to 'sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca') diff --git a/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java new file mode 100644 index 0000000000..1f330aa441 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java @@ -0,0 +1,152 @@ +/* + * 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 org.apache.tuscany.sca.binding.ws.jaxws.external.service; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for bar complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="bar">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="b" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="s" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="x" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="y" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "bar", propOrder = { + "b", + "s", + "x", + "y" +}) +public class Bar { + + protected Boolean b; + protected String s; + protected int x; + protected Integer y; + + /** + * Gets the value of the b property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isB() { + return b; + } + + /** + * Sets the value of the b property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setB(Boolean value) { + this.b = value; + } + + /** + * Gets the value of the s property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getS() { + return s; + } + + /** + * Sets the value of the s property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setS(String value) { + this.s = value; + } + + /** + * Gets the value of the x property. + * + */ + public int getX() { + return x; + } + + /** + * Sets the value of the x property. + * + */ + public void setX(int value) { + this.x = value; + } + + /** + * Gets the value of the y property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getY() { + return y; + } + + /** + * Sets the value of the y property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setY(Integer value) { + this.y = value; + } + +} diff --git a/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java new file mode 100644 index 0000000000..1b22153169 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java @@ -0,0 +1,88 @@ +/* + * 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 org.apache.tuscany.sca.binding.ws.jaxws.external.service; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for foo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="foo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="bars" type="{http://ws.binding.sca.tuscany.apache.org/}bar" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "foo", propOrder = { + "bars" +}) +public class Foo { + + @XmlElement(nillable = true) + protected List bars; + + /** + * Gets the value of the bars property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the bars property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getBars().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Bar } + * + * + */ + public List getBars() { + if (bars == null) { + bars = new ArrayList(); + } + return this.bars; + } + +} diff --git a/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java new file mode 100644 index 0000000000..129365b5e4 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java @@ -0,0 +1,64 @@ +/* + * 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 org.apache.tuscany.sca.binding.ws.jaxws.external.service; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + +@WebService(name = "HelloWorldService", targetNamespace = "http://helloworld/external") +public class HelloWorldService { + + @WebMethod + @WebResult(name = "getGreetingsReturn", targetNamespace = "http://helloworld/external") + @RequestWrapper(localName = "getGreetings", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetings") + @ResponseWrapper(localName = "getGreetingsResponse", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetingsResponse") + public String getGreetings( @WebParam(name = "name", targetNamespace = "http://helloworld/external") + String name) { + System.out.println("Entering External Service HelloWorld.getGreetings: " + name); + String response = "Hello " + name; + System.out.println("Leaving External Service HelloWorld.getGreetings: " + response); + return response; + } + + public Foo getGreetingsComplex(Foo foo){ + System.out.println("Entering External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS()); + Foo response = foo; + Bar b3 = new Bar(); + b3.setS("simon"); + b3.setX(7); + b3.setY(new Integer(8)); + b3.setB(Boolean.TRUE); + response.getBars().add(b3); + System.out.println("Leaving External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS()); + return response; + } + + public String GetGreetingsCaps(String name) { + System.out.println("Entering External Service HelloWorld.GetGreetingsCaps: " + name); + String response = "Hello " + name; + System.out.println("Leaving External Service HelloWorld.GetGreetingsCaps: " + response); + return response; + } + +} diff --git a/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java new file mode 100644 index 0000000000..3a6266f1ef --- /dev/null +++ b/sca-java-2.x/tags/2.0.1/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java @@ -0,0 +1,49 @@ +/* + * 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 org.apache.tuscany.sca.binding.ws.jaxws.external.service; + +import javax.xml.ws.Endpoint; + +public class HelloWorldServiceLauncher { + + public Endpoint endpoint; + + public HelloWorldServiceLauncher(){ + + } + + public void createService(){ + System.out.println(">>> Starting external JAXWS service at http://localhost:8086/External/HelloWorld"); + + // default JVM JAXWS support. + endpoint= Endpoint.publish("http://localhost:8086/External/HelloWorld", + new HelloWorldService()); + } + + public void destoryService(){ + System.out.println(">>> Stopping external JAXWS service at http://localhost:8086/External/HelloWorld"); + endpoint.stop(); + } + + public static void main(String[] args) throws Exception { + HelloWorldServiceLauncher launcher = new HelloWorldServiceLauncher(); + launcher.createService(); + } +} -- cgit v1.2.3