diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-18 07:36:53 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-18 07:36:53 +0000 |
commit | 6c7ad7c110656f47273dc23228b41e46023492f3 (patch) | |
tree | 348f4838b71e73278bd01153e93db88e22e9c189 /branches/sca-java-1.5/vtest/wsbinding | |
parent | 5395b820e60118c68eab9c442af3c53e0e2d7f50 (diff) |
Create 1.5 branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@766260 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5/vtest/wsbinding')
126 files changed, 9311 insertions, 0 deletions
diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/pom.xml new file mode 100644 index 0000000000..9984d70fec --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-nowsdl</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-nowsdl-defaultbinding</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - No WSDL Default Binding</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java new file mode 100644 index 0000000000..cba68beb65 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/AService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java new file mode 100644 index 0000000000..43e35564b5 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java new file mode 100644 index 0000000000..8838c07899 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java new file mode 100644 index 0000000000..27eee2de0a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java new file mode 100644 index 0000000000..da767518ec --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/AServiceImpl.java @@ -0,0 +1,51 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference + public BService b1; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java new file mode 100644 index 0000000000..4402b76f3a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java new file mode 100644 index 0000000000..8392f5ed81 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java new file mode 100644 index 0000000000..8064abf235 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite new file mode 100644 index 0000000000..39d66fa365 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/main/resources/nowsdl.composite @@ -0,0 +1,61 @@ +<?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" + targetNamespace="http://vtest.wsbinding.nowsdl.defaultbinding" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="nowsdl.defaultbinding"> + + <component name="BComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService"/> + <binding.ws uri="http://localhost:8085/BComponent"/> + </service> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.CServiceImpl"/> + <service name="CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService"/> + <binding.ws uri="http://localhost:8085/CComponent"/> + </service> + </component> + + <component name="AComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService"/> + <binding.ws uri="http://localhost:8085/BComponent"/> + </reference> + </component> + + <component name="DComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.impl.DServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.BService"/> + <binding.ws uri="http://localhost:8085/BComponent"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.CService"/> + <binding.ws uri="http://localhost:8085/CComponent"/> + </reference> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java new file mode 100644 index 0000000000..b50774cfa9 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/defaultbinding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/defaultbinding/NoWsdlDefaultBindingTestCase.java @@ -0,0 +1,112 @@ +/* + * 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.vtest.wsbinding.nowsdl.defaultbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.defaultbinding.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.2.2 of SCA Web Services Binding V1.00 + * + * @TODO - will add following tests<br> + * <li>promoted service</li> + * <li>with complex type object</li> + */ +public class NoWsdlDefaultBindingTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "nowsdl.composite"; + protected static AService a; + protected static DService d; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + a = ServiceFinder.getService(AService.class, "AComponent"); + d = ServiceFinder.getService(DService.class, "DComponent"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 169-181:<br> + * 2.2.2 Examples Without a WSDL Document<br> + * The next example shows the simplest form of the binding element without + * WSDL document,<br> + * ...<br> + * which itself uses all the defaults.<br> + */ + @Test + public void testNoWsdl1() throws Exception { + String aName = a.getName(); + String b1Str1 = a.getB1String("string1"); + String b1Str2 = a.getB1String2("string2", "string3"); + int b1Int = a.getB1Int(4000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + } + + /** + * Lines 169-181:<br> + * Test two references using binding.ws but without WSDL documents.<br> + */ + @Test + public void testNoWsdl2() throws Exception { + String dName = d.getName(); + String b1Str1 = d.getB1String("string1"); + String b1Str2 = d.getB1String2("string2", "string3"); + String c1Str1 = d.getC1String("string5"); + String c1Str2 = d.getC1String2("string6", "string7"); + + int b1Int = d.getB1Int(4000); + float c1Float = d.getC1Float((float) 8.8); + + Integer c1Integer = d.getC1Integer(new Integer(9000)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9000), c1Integer); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml new file mode 100644 index 0000000000..aa361e4e97 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-nowsdl</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-nowsdl-multisoapbindings</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - No WSDL Multi Soap Bindings</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java new file mode 100644 index 0000000000..4acfc5ca3f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/AService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java new file mode 100644 index 0000000000..fa2f11b495 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java new file mode 100644 index 0000000000..b55df2c0ae --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java new file mode 100644 index 0000000000..e39103a436 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java new file mode 100644 index 0000000000..650d3295a6 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/AServiceImpl.java @@ -0,0 +1,51 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference + public BService b1; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java new file mode 100644 index 0000000000..69d993251b --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java new file mode 100644 index 0000000000..ddcfc01416 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java new file mode 100644 index 0000000000..a3081b3bf4 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite new file mode 100644 index 0000000000..8cd599354a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/main/resources/nowsdlmultisoapbindings.composite @@ -0,0 +1,135 @@ +<?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" + targetNamespace="http://vtest.wsbinding.nowsdl" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="nowsdl"> + + <component name="BComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws name="BServiceSOAP11" requires="SOAP.1_1" uri="http://localhost:8085/BService/soap11"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BService/soap12"/> + </service> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.CServiceImpl"/> + <service name="CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/> + <binding.ws name="CServiceSOAP12" requires="SOAP.1_2" uri="http://localhost:8085/CService/soap12"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/CService/soap11"/> + </service> + </component> + + <component name="AComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws/> + </reference> + </component> + + <component name="AComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws requires="SOAP"/> + </reference> + </component> + + <component name="AComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws requires="SOAP.1_1"/> + </reference> + </component> + + <component name="AComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws requires="SOAP.1_2"/> + </reference> + </component> + + <component name="DComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws requires="SOAP.1_1"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/> + <binding.ws requires="SOAP.1_2"/> + </reference> + </component> + + <component name="DComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws requires="SOAP.1_2"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/> + <binding.ws requires="SOAP.1_1"/> + </reference> + </component> + + <service name="BServicePromoted" promote="BComponentPromoted"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws name="BServicePromotedSOAP11" requires="SOAP.1_1" uri="http://localhost:8085/BServicePromoted/soap11"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServicePromoted/soap12"/> + </service> + + <service name="CServicePromoted" promote="CComponentPromoted"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/> + <binding.ws name="CServicePromotedSOAP12" requires="SOAP.1_2" uri="http://localhost:8085/CServicePromoted/soap12"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/CServicePromoted/soap11"/> + </service> + + <component name="BComponentPromoted"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.BServiceImpl"/> + </component> + + <component name="CComponentPromoted"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.CServiceImpl"/> + </component> + + <reference name="DComponent3B1" promote="DComponent3/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServicePromoted/soap12"/> + </reference> + + <reference name="DComponent3C1" promote="DComponent3/c1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.CService"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/CServicePromoted/soap11"/> + </reference> + + <component name="DComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.DServiceImpl"/> + <reference name="b1"/> + <reference name="c1"/> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java new file mode 100644 index 0000000000..ae058cf6c9 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/GeneratedWSDLTestCase.java @@ -0,0 +1,162 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.http.HTTPAddress; +import javax.wsdl.extensions.http.HTTPBinding; +import javax.wsdl.extensions.soap.SOAPAddress; +import javax.wsdl.extensions.soap.SOAPBinding; +import javax.wsdl.extensions.soap12.SOAP12Address; +import javax.wsdl.extensions.soap12.SOAP12Binding; + +import junit.framework.Assert; +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section 2.3.2 of SCA Web Services Binding V1.00 + */ +public class GeneratedWSDLTestCase { + + protected static String compositeName = "nowsdlmultisoapbindings.composite"; + protected static Definition cWSDL = null; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + cWSDL = ServiceFinder.getWSDLDefinition("CComponent", "CService"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + private Map getPorts(Definition wsdl, String service) { + String targetNamespace = wsdl.getTargetNamespace(); + HashMap sMap = (HashMap) wsdl.getServices(); + for (Iterator i = sMap.keySet().iterator(); i.hasNext();) { + Object k1 = i.next(); + Service s = (Service) sMap.get(k1); + String qName = "{" + targetNamespace + "}" + service; + if (s.getQName().toString().equals(qName)) { + return s.getPorts(); + } + // Don't why implmentation changed to add Service at the end of qname + if (s.getQName().toString().equals(qName + "Service")) { + return s.getPorts(); + } + } + return null; + } + + /** + * Lines 262-264:<br> + * The WSDL service has one or more ports for each web service binding on + * the SCA service that has a SOAP requirement, or that refers to an + * existing WSDL binding, depending on the requirements of the web service + * binding. Each of those ports has a single binding.<p> + * Each service has following bindings:<br> + * <li>SoapBinding - PortType and SOAP11</li> + * <li>SOAP12Binding - SOAP12</li> + * <li>HTTPBinding - Http</li> + * <br>and following ports:<br> + * <li>SoapAddress</li> + * <li>SOAP12Address</li> + * <li>HTTPAddress</li> + */ + @Test + @Ignore + // Only generate SOAP port and binding + public void testMultiSoapBindings4() throws Exception { + + Map pMap = getPorts(cWSDL, "CService"); + int numSoapPort = 0; + int numSoap12Port = 0; + int numHttpPort = 0; + for (Iterator iter = pMap.keySet().iterator(); iter.hasNext();) { + Object k2 = iter.next(); + Port p = (Port) pMap.get(k2); + List eeList = p.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object address = eeList.get(i); + if (address instanceof SOAPAddress) { + numSoapPort++; + } else if (address instanceof SOAP12Address) { + numSoap12Port++; + } else if (address instanceof HTTPAddress) { + numHttpPort++; + }; + } + } + + Map cMap = cWSDL.getBindings(); + int numSoapBinding = 0; + int numSoap12Binding = 0; + int numHttpBinding = 0; + for (Iterator iter = cMap.keySet().iterator(); iter.hasNext();) { + Object k1 = iter.next(); + Binding b = (Binding) cMap.get(k1); + List eeList = b.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object binding = eeList.get(i); + if (binding instanceof SOAPBinding) { + numSoapBinding++; + } else if (binding instanceof SOAP12Binding) { + numSoap12Binding++; + } else if (binding instanceof HTTPBinding) { + numHttpBinding++; + } + } + } + + System.out.println("testMultiSoapBindings4"); + System.out.println(" # of SOAPPort: " + numSoapPort); + System.out.println(" # of SOAP12Port: " + numSoap12Port); + System.out.println(" # of HTTPPort: " + numHttpPort); + System.out.println(" # of SOAPBinding: " + numSoapBinding); + System.out.println(" # of SOAP12Binding: " + numSoap12Binding); + System.out.println(" # of HTTPBinding: " + numHttpBinding); + + Assert.assertEquals(numSoapPort, 1); + Assert.assertTrue(numSoap12Port > 0); + Assert.assertTrue(numSoapBinding > 0); + Assert.assertEquals(numSoap12Binding, 1); + // Skipped to test HTTP + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java new file mode 100644 index 0000000000..5dbb696bf5 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/multisoapbindings/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/multisoapbindings/NoWsdlMultiSoapBindingsTestCase.java @@ -0,0 +1,213 @@ +/* + * 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.vtest.wsbinding.nowsdl.multisoapbindings; + +import junit.framework.Assert; +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.2.2 and 2.3.2 of SCA Web Services + * Binding V1.00 + */ +public class NoWsdlMultiSoapBindingsTestCase { + + protected static String compositeName = "nowsdlmultisoapbindings.composite"; + protected static AService a1; + protected static AService a2; + protected static AService a3; + protected static AService a4; + protected static DService d1; + protected static DService d2; + protected static DService d3; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + a1 = ServiceFinder.getService(AService.class, "AComponent1"); + a2 = ServiceFinder.getService(AService.class, "AComponent2"); + a3 = ServiceFinder.getService(AService.class, "AComponent3"); + a4 = ServiceFinder.getService(AService.class, "AComponent4"); + d1 = ServiceFinder.getService(DService.class, "DComponent1"); + d2 = ServiceFinder.getService(DService.class, "DComponent2"); + d3 = ServiceFinder.getService(DService.class, "DComponent3"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 201-225:<br> + * The next example shows the use of the binding element without a WSDL + * document, with multiple SOAP bindings with non-default values. The SOAP + * 1.2 binding name defaults to the service name, the SOAP 1.1 binding is + * given an explicit name. The reference has a web service binding which + * uses SOAP 1.2, but otherwise uses all the defaults for SOAP binding. + * The reference binding name defaults to the reference name.<p> + * Line 253:<br> + * <li>soap</li> + * ...<br> + * version, including multiple versions.<br> + * <p> + * AComponent1 - no requires<br> + * AComponent2 - requires = soap<br> + * AComponent3 - requires = soap.1_1<br> + * AComponent4 - requires = soap.1_2<br> + */ + @Test + public void testMultiSoapBindings1() throws Exception { + + String aName = a1.getName(); + String b1Str1 = a1.getB1String("string1"); + String b1Str2 = a1.getB1String2("string2", "string3"); + int b1Int = a1.getB1Int(1000); + + System.out.println("AComponent1: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(1000, b1Int); + + aName = a2.getName(); + b1Str1 = a2.getB1String("string1"); + b1Str2 = a2.getB1String2("string2", "string3"); + b1Int = a2.getB1Int(2000); + + System.out.println("AComponent2: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(2000, b1Int); + + aName = a3.getName(); + b1Str1 = a3.getB1String("string1"); + b1Str2 = a3.getB1String2("string2", "string3"); + b1Int = a3.getB1Int(3000); + + System.out.println("AComponent3: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(3000, b1Int); + + aName = a4.getName(); + b1Str1 = a4.getB1String("string1"); + b1Str2 = a4.getB1String2("string2", "string3"); + b1Int = a4.getB1Int(4000); + + System.out.println("AComponent4: " + aName + ", " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + + } + + /** + * Lines 201-225, 262-264:<br> + * The WSDL service has one or more ports for each web service binding on + * the SCA service that has a SOAP requirement, or that refers to an + * existing WSDL binding, depending on the requirements of the web service + * binding. Each of those ports has a single binding.<br> + * <p> + * Test multiple SOAP bindings with two references which use different versions.<br> + */ + @Test + public void testMultiSoapBindings2() throws Exception { + + String dName = d1.getName(); + String b1Str1 = d1.getB1String("string1"); + String b1Str2 = d1.getB1String2("string2", "string3"); + String c1Str1 = d1.getC1String("string5"); + String c1Str2 = d1.getC1String2("string6", "string7"); + int b1Int = d1.getB1Int(4000); + float c1Float = d1.getC1Float((float) 8.8); + Integer c1Integer = d1.getC1Integer(new Integer(9001)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9001), c1Integer); + + dName = d2.getName(); + b1Str1 = d2.getB1String("string1"); + b1Str2 = d2.getB1String2("string2", "string3"); + c1Str1 = d2.getC1String("string5"); + c1Str2 = d2.getC1String2("string6", "string7"); + b1Int = d2.getB1Int(4000); + c1Float = d2.getC1Float((float) 8.8); + c1Integer = d2.getC1Integer(new Integer(9002)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9002), c1Integer); + } + + /** + * Lines 201-225, 262-264:<br> + * Test multiple SOAP bindings with promoted services and references.<br> + */ + @Test + public void testMultiSoapBindings3() throws Exception { + + String dName = d3.getName(); + String b1Str1 = d3.getB1String("string1"); + String b1Str2 = d3.getB1String2("string2", "string3"); + String c1Str1 = d3.getC1String("string5"); + String c1Str2 = d3.getC1String2("string6", "string7"); + int b1Int = d3.getB1Int(4000); + float c1Float = d3.getC1Float((float) 8.8); + Integer c1Integer = d3.getC1Integer(new Integer(9003)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9003), c1Integer); + + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/pom.xml new file mode 100644 index 0000000000..357adbc934 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/pom.xml @@ -0,0 +1,69 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-nowsdl</artifactId> + <packaging>pom</packaging> + + <name>Apache Tuscany SCA Web Service Binding Verification Tests - No WSDL</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-utilities</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + </dependencies> + + <profiles> + <profile> + <id>default</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <modules> + <module>defaultbinding</module> + <module>soapversion</module> + <module>multisoapbindings</module> + <module>promoted</module> + </modules> + </profile> + </profiles> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/pom.xml new file mode 100644 index 0000000000..8a8ae46b8d --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-nowsdl</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-nowsdl-promoted</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - No WSDL Promoted Service and Reference</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java new file mode 100644 index 0000000000..6ab6fbb8f5 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/AService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java new file mode 100644 index 0000000000..f3c42008aa --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java new file mode 100644 index 0000000000..1215d9d41f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BServiceSOAP { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java new file mode 100644 index 0000000000..774b68bf6d --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP11.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BServiceSOAP11 { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java new file mode 100644 index 0000000000..952df7ccfe --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/BServiceSOAP12.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BServiceSOAP12 { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java new file mode 100644 index 0000000000..9111b5c3a9 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java new file mode 100644 index 0000000000..5aa508d8f1 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java new file mode 100644 index 0000000000..055283bfad --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/AServiceImpl.java @@ -0,0 +1,51 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference + public BService b1; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java new file mode 100644 index 0000000000..8f776672de --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java new file mode 100644 index 0000000000..7a5d91d762 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP11Impl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11; +import org.osoa.sca.annotations.Service; + +@Service(BServiceSOAP11.class) +public class BServiceSOAP11Impl implements BServiceSOAP11 { + + public String getName() { + return "BServiceSOAP11"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java new file mode 100644 index 0000000000..121de12d3c --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAP12Impl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12; +import org.osoa.sca.annotations.Service; + +@Service(BServiceSOAP12.class) +public class BServiceSOAP12Impl implements BServiceSOAP12 { + + public String getName() { + return "BServiceSOAP12"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java new file mode 100644 index 0000000000..f05c8852f6 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/BServiceSOAPImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP; +import org.osoa.sca.annotations.Service; + +@Service(BServiceSOAP.class) +public class BServiceSOAPImpl implements BServiceSOAP { + + public String getName() { + return "BServiceSOAP"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java new file mode 100644 index 0000000000..746b0a357f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java new file mode 100644 index 0000000000..5be411b286 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite new file mode 100644 index 0000000000..f79df5bf8f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/main/resources/nowsdlpromoted.composite @@ -0,0 +1,246 @@ +<?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" + targetNamespace="http://vtest.wsbinding.nowsdl.promoted" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="nowsdl.promoted"> + + <service name="BService" promote="BComponent"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/> + <binding.ws uri="http://localhost:8085/BService"/> + </service> + + <service name="BServiceSOAP" promote="BComponentSOAP"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP"/> + </service> + + <service name="BServiceSOAP11" promote="BComponentSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP11"/> + </service> + + <service name="BServiceSOAP12" promote="BComponentSOAP12"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP12"/> + </service> + + <service name="CService" promote="CComponent"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CService"/> + </service> + + <component name="BComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceImpl"/> + </component> + + <component name="BComponentSOAP"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceSOAPImpl"/> + </component> + + <component name="BComponentSOAP11"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceSOAP11Impl"/> + </component> + + <component name="BComponentSOAP12"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.BServiceSOAP12Impl"/> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.CServiceImpl"/> + </component> + + <reference name="AComponent1B1" promote="AComponent1/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/> + <binding.ws uri="http://localhost:8085/BService"/> + </reference> + + <reference name="AComponent2B1" promote="AComponent2/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BService"/> + </reference> + + <reference name="AComponent3B1" promote="AComponent3/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BService"/> + </reference> + + <reference name="AComponent4B1" promote="AComponent4/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BService"/> + </reference> + + <reference name="AComponent5B1" promote="AComponent5/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/> + <binding.ws uri="http://localhost:8085/BServiceSOAP"/> + </reference> + + <reference name="AComponent6B1" promote="AComponent6/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP"/> + </reference> + + <reference name="AComponent7B1" promote="AComponent7/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP"/> + </reference> + + <reference name="AComponent8B1" promote="AComponent8/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP"/> + </reference> + + <reference name="AComponent9B1" promote="AComponent9/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/> + <binding.ws uri="http://localhost:8085/BServiceSOAP11"/> + </reference> + + <reference name="AComponent10B1" promote="AComponent10/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP11"/> + </reference> + + <reference name="AComponent11B1" promote="AComponent11/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP11"/> + </reference> + + <reference name="AComponent12B1" promote="AComponent12/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP11"/> + </reference> + + <reference name="AComponent13B1" promote="AComponent13/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/> + <binding.ws uri="http://localhost:8085/BServiceSOAP12"/> + </reference> + + <reference name="AComponent14B1" promote="AComponent14/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BServiceSOAP12"/> + </reference> + + <reference name="AComponent15B1" promote="AComponent15/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP12"/> + </reference> + + <reference name="AComponent16B1" promote="AComponent16/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP12"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BServiceSOAP12"/> + </reference> + + <reference name="DComponentB1" promote="DComponent/b1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BServiceSOAP11"/> + </reference> + + <reference name="DComponentC1" promote="DComponent/c1"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.CService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CService"/> + </reference> + + <component name="AComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent5"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent6"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent7"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent8"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent9"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent10"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent11"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent12"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent13"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent14"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent15"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="AComponent16"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.AServiceImpl"/> + <reference name="b1"/> + </component> + + <component name="DComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.impl.DServiceImpl"/> + <reference name="b1"/> + <reference name="c1"/> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java new file mode 100644 index 0000000000..ae7dafa46e --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted1TestCase.java @@ -0,0 +1,85 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import junit.framework.Assert; +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.AService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.3.1 and 2.3.3.1 of SCA Web Services Binding + * V1.00 + */ +public class NoWsdlPromoted1TestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "nowsdlpromoted.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 251-253, 287-291:<br> + * <li>soap</li> + * This indicates that a SOAP binding is required. The SOAP binding may be + * of any SOAP version, including multiple versions.<br> + * <br> + * 2.3.3.1 SOAP versions<br> + * Where a web service binding requires a specific SOAP version, then a + * single WSDL port and SOAP binding of the appropriate version is + * generated. Where no specific SOAP version is required, then one or more + * WSDL ports with associated SOAP bindings may be generated, depending on + * the level(s) supported in the target runtime.<br> + * <p> + * Tests promoted services and references<br> + */ + @Test + public void testSoapVersion1() throws Exception { + + for (int i = 0; i < 8; i++) { + AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1)); + String aName = a.getName(); + String b1Str1 = a.getB1String("string1"); + String b1Str2 = a.getB1String2("string2", "string3"); + int b1Int = a.getB1Int(i * 1000 + 1000); + System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(i * 1000 + 1000, b1Int); + } + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java new file mode 100644 index 0000000000..a4744b9007 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/promoted/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/promoted/NoWsdlPromoted2TestCase.java @@ -0,0 +1,118 @@ +/* + * 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.vtest.wsbinding.nowsdl.promoted; + +import junit.framework.Assert; +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.promoted.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.3.1 and 2.3.3.1 of SCA Web Services Binding + * V1.00 + */ +public class NoWsdlPromoted2TestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "nowsdlpromoted.composite"; + protected static DService d; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + d = ServiceFinder.getService(DService.class, "DComponent"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 254-257, 287-291:<br> + * <li>soap.1_1</li><br> + * A SOAP 1.1 binding only is required.<br> + * <li>soap.1_2</li><br> + * A SOAP 1.2 binding only is required.<br> + * <br> + * 2.3.3.1 SOAP versions<br> + * Where a web service binding requires a specific SOAP version, then a + * single WSDL port and SOAP binding of the appropriate version is + * generated. Where no specific SOAP version is required, then one or more + * WSDL ports with associated SOAP bindings may be generated, depending on + * the level(s) supported in the target runtime.<br> + * <p> + * Tests promoted services and references<br> + */ + @Test + public void testSoapVersion2() throws Exception { + + for (int i = 8; i < 16; i++) { + AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1)); + String aName = a.getName(); + String b1Str1 = a.getB1String("string1"); + String b1Str2 = a.getB1String2("string2", "string3"); + int b1Int = a.getB1Int(i * 1000 + 1000); + System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(i * 1000 + 1000, b1Int); + } + } + + /** + * Lines 254-257, 287-291:<br> + * Test two references using binding.ws with 2 different SOAP versions + * and without WSDL document.<br> + */ + @Test + public void testSoapVersion3() throws Exception { + String dName = d.getName(); + String b1Str1 = d.getB1String("string1"); + String b1Str2 = d.getB1String2("string2", "string3"); + String c1Str1 = d.getC1String("string5"); + String c1Str2 = d.getC1String2("string6", "string7"); + + int b1Int = d.getB1Int(4000); + float c1Float = d.getC1Float((float) 8.8); + + Integer c1Integer = d.getC1Integer(new Integer(9000)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9000), c1Integer); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/pom.xml new file mode 100644 index 0000000000..0fd0c643ab --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-nowsdl</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-nowsdl-soapversion</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - No WSDL SOAP Version</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java new file mode 100644 index 0000000000..d5204634a6 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/AService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java new file mode 100644 index 0000000000..034aad7781 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java new file mode 100644 index 0000000000..1c345428b3 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BServiceSOAP { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java new file mode 100644 index 0000000000..74dcccd898 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP11.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BServiceSOAP11 { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java new file mode 100644 index 0000000000..a86922ef4f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/BServiceSOAP12.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BServiceSOAP12 { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java new file mode 100644 index 0000000000..a809795657 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java new file mode 100644 index 0000000000..2c1642ff14 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java new file mode 100644 index 0000000000..657be52e7d --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/AServiceImpl.java @@ -0,0 +1,51 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference + public BService b1; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java new file mode 100644 index 0000000000..fb079fa8bc --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java new file mode 100644 index 0000000000..9f0e76ec10 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP11Impl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11; +import org.osoa.sca.annotations.Service; + +@Service(BServiceSOAP11.class) +public class BServiceSOAP11Impl implements BServiceSOAP11 { + + public String getName() { + return "BServiceSOAP11"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java new file mode 100644 index 0000000000..91e4ffbd7e --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAP12Impl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12; +import org.osoa.sca.annotations.Service; + +@Service(BServiceSOAP12.class) +public class BServiceSOAP12Impl implements BServiceSOAP12 { + + public String getName() { + return "BServiceSOAP12"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java new file mode 100644 index 0000000000..b8cd38bb09 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/BServiceSOAPImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP; +import org.osoa.sca.annotations.Service; + +@Service(BServiceSOAP.class) +public class BServiceSOAPImpl implements BServiceSOAP { + + public String getName() { + return "BServiceSOAP"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java new file mode 100644 index 0000000000..250694dc36 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java new file mode 100644 index 0000000000..9f6c29c643 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite new file mode 100644 index 0000000000..61a658ab55 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/main/resources/nowsdlsoapversion.composite @@ -0,0 +1,205 @@ +<?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" + targetNamespace="http://vtest.wsbinding.nowsdl.soapversion" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="nowsdl.soapversion"> + + <component name="BComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/> + <binding.ws uri="http://localhost:8085/BComponent"/> + </service> + </component> + + <component name="BComponentSOAP"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceSOAPImpl"/> + <service name="BServiceSOAP"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP"/> + </service> + </component> + + <component name="BComponentSOAP11"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceSOAP11Impl"/> + <service name="BServiceSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP11"/> + </service> + </component> + + <component name="BComponentSOAP12"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.BServiceSOAP12Impl"/> + <service name="BServiceSOAP12"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP12"/> + </service> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.CServiceImpl"/> + <service name="CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CComponent"/> + </service> + </component> + + <component name="AComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/> + <binding.ws uri="http://localhost:8085/BComponent"/> + </reference> + </component> + + <component name="AComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BComponent"/> + </reference> + </component> + + <component name="AComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponent"/> + </reference> + </component> + + <component name="AComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponent/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponent"/> + </reference> + </component> + + <component name="AComponent5"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP/BServiceSOAP"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/> + <binding.ws uri="http://localhost:8085/BComponentSOAP"/> + </reference> + </component> + + <component name="AComponent6"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP/BServiceSOAP"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP"/> + </reference> + </component> + + <component name="AComponent7"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP/BServiceSOAP"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP"/> + </reference> + </component> + + <component name="AComponent8"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP/BServiceSOAP"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP"/> + </reference> + </component> + + <component name="AComponent9"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP11/BServiceSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/> + <binding.ws uri="http://localhost:8085/BComponentSOAP11"/> + </reference> + </component> + + <component name="AComponent10"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP11/BServiceSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP11"/> + </reference> + </component> + + <component name="AComponent11"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP11/BServiceSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP11"/> + </reference> + </component> + + <component name="AComponent12"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP11/BServiceSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP11"/> + </reference> + </component> + + <component name="AComponent13"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP12/BServiceSOAP12"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/> + <binding.ws uri="http://localhost:8085/BComponentSOAP12"/> + </reference> + </component> + + <component name="AComponent14"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP12/BServiceSOAP12"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/> + <binding.ws requires="SOAP" uri="http://localhost:8085/BComponentSOAP12"/> + </reference> + </component> + + <component name="AComponent15"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP12/BServiceSOAP12"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP12"/> + </reference> + </component> + + <component name="AComponent16"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.AServiceImpl"/> + <reference name="b1" target="BComponentSOAP12/BServiceSOAP12"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP12"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/BComponentSOAP12"/> + </reference> + </component> + + <component name="DComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.impl.DServiceImpl"/> + <reference name="b1" target="BComponentSOAP11/BServiceSOAP11"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BServiceSOAP11"/> + <binding.ws requires="SOAP.1_1" uri="http://localhost:8085/BComponentSOAP11"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService"/> + <binding.ws requires="SOAP.1_2" uri="http://localhost:8085/CComponent"/> + </reference> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java new file mode 100644 index 0000000000..edd0d91072 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/GeneratedWSDLTestCase.java @@ -0,0 +1,438 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.wsdl.Binding; +import javax.wsdl.BindingInput; +import javax.wsdl.BindingOperation; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.extensions.http.HTTPAddress; +import javax.wsdl.extensions.http.HTTPBinding; +import javax.wsdl.extensions.http.HTTPOperation; +import javax.wsdl.extensions.soap.SOAPAddress; +import javax.wsdl.extensions.soap.SOAPBinding; +import javax.wsdl.extensions.soap.SOAPBody; +import javax.wsdl.extensions.soap.SOAPHeader; +import javax.wsdl.extensions.soap.SOAPHeaderFault; +import javax.wsdl.extensions.soap.SOAPOperation; +import javax.wsdl.extensions.soap12.SOAP12Address; +import javax.wsdl.extensions.soap12.SOAP12Binding; +import javax.wsdl.extensions.soap12.SOAP12Body; +import javax.wsdl.extensions.soap12.SOAP12Header; +import javax.wsdl.extensions.soap12.SOAP12HeaderFault; +import javax.wsdl.extensions.soap12.SOAP12Operation; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.BService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.CService; + + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.3.2, 2.3.3, 2.3.3.1, and 2.3.4 of SCA + * Web Services Binding V1.00 + */ +public class GeneratedWSDLTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "nowsdlsoapversion.composite"; + protected static Definition bWSDL = null; + protected static Definition cWSDL = null; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + bWSDL = ServiceFinder.getWSDLDefinition("BComponent", "BService"); + cWSDL = ServiceFinder.getWSDLDefinition("CComponent", "CService"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 260-262:<br> + * A separate WSDL document is generated for each SCA service. Each has + * its own unique target namespace. This is to ensure that bindings on + * different services of the same component do not clash.<br> + */ + @Test + @Ignore("TUSCANY-2607") + // Don't know why target namespaces are same + public void testSoapVersion4() throws Exception { + String cTargetNamespace = cWSDL.getTargetNamespace(); + String bTargetNamespace = bWSDL.getTargetNamespace(); + Assert.assertFalse(bTargetNamespace.equals(cTargetNamespace)); + } + + /** + * Lines 271-273:<br> + * The target namespace of the WSDL document, and of the service, ports and + * generated binding elements is:<br> + * Base System URI for HTTP / Component Name / Service Name<br> + */ + @Test + @Ignore("TUSCANY-2607") + // The target namespace does not follow the convention + public void testSoapVersion5() throws Exception { + String bTargetNamespace = bWSDL.getTargetNamespace(); + String cTargetNamespace = cWSDL.getTargetNamespace(); + Assert.assertTrue(bTargetNamespace.endsWith("BComponent/BService")); + Assert.assertTrue(cTargetNamespace.endsWith("CComponent/CService")); + } + + private Map getPorts(Definition wsdl, String service) { + String targetNamespace = wsdl.getTargetNamespace(); + HashMap sMap = (HashMap) wsdl.getServices(); + for (Iterator i = sMap.keySet().iterator(); i.hasNext();) { + Object k1 = i.next(); + Service s = (Service) sMap.get(k1); + String qName = "{" + targetNamespace + "}" + service; + if (s.getQName().toString().equals(qName)) { + return s.getPorts(); + } + // Don't why implmentation changed to add Service at the end of qname + if (s.getQName().toString().equals(qName + "Service")) { + return s.getPorts(); + } + } + return null; + } + + /** + * Lines 262-264, 290-291:<br> + * The WSDL service has one or more ports for each web service binding on + * the SCA service that has a SOAP requirement, or that refers to an + * existing WSDL binding, depending on the requirements of the web service + * binding. Each of those ports has a single binding.<br> + * <p> + * 2.3.3.1 SOAP versions<br> + * Where no specific SOAP version is required, then one or more WSDL ports + * with associated SOAP bindings may be generated, depending on the level(s) + * supported in the target runtime.<br> + * <p> + * BComponent/BService is not specified a SOAP version. + * It should have following bindings:<br> + * <li>SoapBinding - PortType and SOAP11</li> + * <li>SOAP12Binding - SOAP12</li> + * <li>HTTPBinding - Http</li> + * <br>and following ports:<br> + * <li>SoapAddress</li> + * <li>SOAP12Address</li> + * <li>HTTPAddress</li> + + */ + @Test + public void testSoapVersion6() throws Exception { + + Map pMap = getPorts(bWSDL, "BService"); + int numSoapPort = 0; + int numSoap12Port = 0; + int numHttpPort = 0; + for (Iterator iter = pMap.keySet().iterator(); iter.hasNext();) { + Object k2 = iter.next(); + Port p = (Port) pMap.get(k2); + List eeList = p.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object address = eeList.get(i); + if (address instanceof SOAPAddress) { + numSoapPort++; + } else if (address instanceof SOAP12Address) { + numSoap12Port++; + } else if (address instanceof HTTPAddress) { + numHttpPort++; + } else { + System.out.println("address:" + address.getClass()); + } + } + } + + Map bMap = bWSDL.getBindings(); + int numSoapBinding = 0; + int numSoap12Binding = 0; + int numHttpBinding = 0; + for (Iterator iter = bMap.keySet().iterator(); iter.hasNext();) { + Object k1 = iter.next(); + Binding b = (Binding) bMap.get(k1); + List eeList = b.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object binding = eeList.get(i); + if (binding instanceof SOAPBinding) { + numSoapBinding++; + } else if (binding instanceof SOAP12Binding) { + numSoap12Binding++; + } else if (binding instanceof HTTPBinding) { + numHttpBinding++; + } + } + } + + System.out.println("testSoapVersion6"); + System.out.println(" # of SOAPPort: " + numSoapPort); + System.out.println(" # of SOAP12Port: " + numSoap12Port); + System.out.println(" # of HTTPPort: " + numHttpPort); + System.out.println(" # of SOAPBinding: " + numSoapBinding); + System.out.println(" # of SOAP12Binding: " + numSoap12Binding); + System.out.println(" # of HTTPBinding: " + numHttpBinding); + + Assert.assertEquals(numSoapPort, 1); + Assert.assertEquals(numSoap12Port, 0); + Assert.assertTrue(numSoapBinding > 0); + Assert.assertEquals(numSoap12Binding, 0); + // Skipped to test HTTP + + } + + /** + * Lines 275-284:<br> + * 2.3.3 WSDL Bindings<br> + * The binding elements in the generated WSDL document are either defined + * within the document, derived from the requirements of the binding, or + * are imported from existing WSDL documents.<br> + * Generated bindings have the following fixed assumptions:<br> + * <li>use="literal" for input and output messages</li> + * <li>style="document" for the binding</li> + * <li>All faults map to soap:faults</li> + * <li>No header or headerFault elements are generated</li> + * <li>The transport is "http://schemas.xmlsoap.org/soap/http", unless the + * system provides intents for alternative transports<br> + * <p> + */ + @Test + public void testSoapVersion7() throws Exception { + Map bMap = bWSDL.getBindings(); + for (Iterator iter = bMap.keySet().iterator(); iter.hasNext();) { + Object k1 = iter.next(); + Binding b = (Binding) bMap.get(k1); + List eeList = b.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object binding = eeList.get(i); + if (binding instanceof SOAPBinding) { + SOAPBinding sb = (SOAPBinding) binding; + Assert.assertEquals(sb.getStyle(), "document"); + Assert.assertEquals(sb.getTransportURI(), "http://schemas.xmlsoap.org/soap/http"); + } else if (binding instanceof SOAP12Binding) { + SOAP12Binding sb = (SOAP12Binding) binding; + Assert.assertEquals(sb.getStyle(), "document"); + Assert.assertEquals(sb.getTransportURI(), "http://schemas.xmlsoap.org/soap/http"); + } else if (binding instanceof HTTPBinding) { + } + } + List operations = b.getBindingOperations(); + for (int i = 0; i < eeList.size(); i++) { + BindingOperation bop = (BindingOperation) operations.get(i); + + List oeeList = bop.getExtensibilityElements(); + for (int j = 0; j < eeList.size(); j++) { + Object op = oeeList.get(j); + if (op instanceof SOAPOperation) { + SOAPOperation sop = (SOAPOperation) op; + if (sop.getStyle() != null) + Assert.assertEquals(sop.getStyle(), "document"); + } else if (op instanceof SOAP12Operation) { + SOAP12Operation sop = (SOAP12Operation) op; + Assert.assertEquals(sop.getStyle(), "document"); + } else if (op instanceof HTTPOperation) { + // HTTPOperation hop = (HTTPOperation) op; + } + } + + BindingInput bInput = (BindingInput) bop.getBindingInput(); + List bInputList = bInput.getExtensibilityElements(); + for (int j = 0; j < eeList.size(); j++) { + Object body = bInputList.get(j); + if (body instanceof SOAPBody) { + SOAPBody sBody = (SOAPBody) body; + Assert.assertEquals(sBody.getUse(), "literal"); + } else if (body instanceof SOAP12Body) { + SOAP12Body sBody = (SOAP12Body) body; + Assert.assertEquals(sBody.getUse(), "literal"); + } else { + Assert.assertFalse(body instanceof SOAPHeader); + Assert.assertFalse(body instanceof SOAP12Header); + Assert.assertFalse(body instanceof SOAPHeaderFault); + Assert.assertFalse(body instanceof SOAP12HeaderFault); + } + } + + BindingOutput bOutput = (BindingOutput) bop.getBindingOutput(); + List bOutputList = bOutput.getExtensibilityElements(); + for (int j = 0; j < eeList.size(); j++) { + Object body = bOutputList.get(j); + if (body instanceof SOAPBody) { + SOAPBody sBody = (SOAPBody) body; + Assert.assertEquals(sBody.getUse(), "literal"); + } else if (body instanceof SOAP12Body) { + SOAP12Body sBody = (SOAP12Body) body; + Assert.assertEquals(sBody.getUse(), "literal"); + } else { + Assert.assertFalse(body instanceof SOAPHeader); + Assert.assertFalse(body instanceof SOAP12Header); + Assert.assertFalse(body instanceof SOAPHeaderFault); + Assert.assertFalse(body instanceof SOAP12HeaderFault); + } + } + + Map bFaults = bop.getBindingFaults(); + if (bFaults.size() > 0) + System.out.println("WARNING: Skipped to test binding faults"); + + } + } + } + + /** + * Lines 288-289:<br> + * 2.3.3.1 SOAP versions<br> + * Where a web service binding requires a specific SOAP version, then a + * single WSDL port and SOAP binding of the appropriate version is + * generated. + */ + @Test + public void testSoapVersion8() throws Exception { + + Map pMap = getPorts(cWSDL, "CService"); + int numSoapPort = 0; + int numSoap12Port = 0; + int numHttpPort = 0; + for (Iterator iter = pMap.keySet().iterator(); iter.hasNext();) { + Object k2 = iter.next(); + Port p = (Port) pMap.get(k2); + List eeList = p.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object address = eeList.get(i); + if (address instanceof SOAPAddress) { + numSoapPort++; + } else if (address instanceof SOAP12Address) { + numSoap12Port++; + } else if (address instanceof HTTPAddress) { + numHttpPort++; + }; + } + } + + Map cMap = cWSDL.getBindings(); + int numSoapBinding = 0; + int numSoap12Binding = 0; + int numHttpBinding = 0; + for (Iterator iter = cMap.keySet().iterator(); iter.hasNext();) { + Object k1 = iter.next(); + Binding b = (Binding) cMap.get(k1); + List eeList = b.getExtensibilityElements(); + for (int i = 0; i < eeList.size(); i++) { + Object binding = eeList.get(i); + if (binding instanceof SOAPBinding) { + numSoapBinding++; + } else if (binding instanceof SOAP12Binding) { + numSoap12Binding++; + } else if (binding instanceof HTTPBinding) { + numHttpBinding++; + } + } + } + + System.out.println("testSoapVersion8"); + System.out.println(" # of SOAPPort: " + numSoapPort); + System.out.println(" # of SOAP12Port: " + numSoap12Port); + System.out.println(" # of HTTPPort: " + numHttpPort); + System.out.println(" # of SOAPBinding: " + numSoapBinding); + System.out.println(" # of SOAP12Binding: " + numSoap12Binding); + System.out.println(" # of HTTPBinding: " + numHttpBinding); + + Assert.assertTrue(numSoap12Port > 0); + Assert.assertTrue(numSoap12Binding > 0); + Assert.assertEquals(numSoapPort, 0); + Assert.assertEquals(numSoapBinding, 0); + // Skipped to test HTTP + } + + private boolean testOperation(Operation op, Method m[]) { + for (int i = 0; i < m.length; i++) { + if(m[i].getName().equals(op.getName())) { + Assert.assertNotNull(op.getInput()); + Assert.assertNotNull(op.getOutput()); + return true; + } + } + return false; + } + + /** + * Lines 293-296:<br> + * 2.3.4 WSDL PortType<br> + * An SCA service has a single interface. This interface is always imported + * into the generated WSDL document. This may be done directly for + * WSDL-defined interfaces, or indirectly via a WSDL generated from the + * interface type for the service.<br> + */ + @Test + public void testSoapVersion9() throws Exception { + Method bMethod[] = BService.class.getMethods(); + Map bPTMap = bWSDL.getPortTypes(); + Assert.assertEquals(bPTMap.size(), 1); + for (Iterator iter = bPTMap.keySet().iterator(); iter.hasNext();) { + PortType pt = (PortType) bPTMap.get(iter.next()); + List opList = pt.getOperations(); + Assert.assertEquals(bMethod.length, opList.size()); + for (int i = 0; i < opList.size(); i++) { + Operation op = (Operation) opList.get(i); + Assert.assertTrue(testOperation(op, bMethod)); + } + } + + Method cMethod[] = CService.class.getMethods(); + Map cPTMap = cWSDL.getPortTypes(); + Assert.assertEquals(cPTMap.size(), 1); + for (Iterator iter = cPTMap.keySet().iterator(); iter.hasNext();) { + PortType pt = (PortType) cPTMap.get(iter.next()); + List opList = pt.getOperations(); + Assert.assertEquals(cMethod.length, opList.size()); + for (int i = 0; i < opList.size(); i++) { + Operation op = (Operation) opList.get(i); + Assert.assertTrue(testOperation(op, cMethod)); + } + } + } + + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java new file mode 100644 index 0000000000..896b5a3d89 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlNoSoapVersionTestCase.java @@ -0,0 +1,84 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import junit.framework.Assert; +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.AService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.3.1 and 2.3.3.1 of SCA Web Services Binding + * V1.00 + */ +public class NoWsdlNoSoapVersionTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "nowsdlsoapversion.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 251-253, 287-291:<br> + * <li>soap</li> + * This indicates that a SOAP binding is required. The SOAP binding may be + * of any SOAP version, including multiple versions.<br> + * <br> + * 2.3.3.1 SOAP versions<br> + * Where a web service binding requires a specific SOAP version, then a + * single WSDL port and SOAP binding of the appropriate version is + * generated. Where no specific SOAP version is required, then one or more + * WSDL ports with associated SOAP bindings may be generated, depending on + * the level(s) supported in the target runtime.<br> + * <p> + */ + @Test + public void testSoapVersion1() throws Exception { + + for (int i = 0; i < 8; i++) { + AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1)); + String aName = a.getName(); + String b1Str1 = a.getB1String("string1"); + String b1Str2 = a.getB1String2("string2", "string3"); + int b1Int = a.getB1Int(i * 1000 + 1000); + System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(i * 1000 + 1000, b1Int); + } + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java new file mode 100644 index 0000000000..c65f7e8e52 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/nowsdl/soapversion/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/nowsdl/soapversion/NoWsdlSoapVersionTestCase.java @@ -0,0 +1,121 @@ +/* + * 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.vtest.wsbinding.nowsdl.soapversion; + +import junit.framework.Assert; +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.AService; +import org.apache.tuscany.sca.vtest.wsbinding.nowsdl.soapversion.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element without WSDL document + * described in section section 2.3.1, 2.3.2 and 2.3.3.1 of SCA Web Services + * Binding V1.00 + */ +public class NoWsdlSoapVersionTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "nowsdlsoapversion.composite"; + protected static DService d; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + d = ServiceFinder.getService(DService.class, "DComponent"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 254-257:<br> + * <li>soap.1_1</li><br> + * A SOAP 1.1 binding only is required.<br> + * <li>soap.1_2</li><br> + * A SOAP 1.2 binding only is required.<br> + * <br> + * 2.3.3.1 SOAP versions<br> + * Where a web service binding requires a specific SOAP version, then a + * single WSDL port and SOAP binding of the appropriate version is + * generated. Where no specific SOAP version is required, then one or more + * WSDL ports with associated SOAP bindings may be generated, depending on + * the level(s) supported in the target runtime.<br> + * <p> + */ + @Test + public void testSoapVersion2() throws Exception { + + for (int i = 8; i < 16; i++) { + AService a = ServiceFinder.getService(AService.class, "AComponent" + (i+1)); + String aName = a.getName(); + String b1Str1 = a.getB1String("string1"); + String b1Str2 = a.getB1String2("string2", "string3"); + int b1Int = a.getB1Int(i * 1000 + 1000); + System.out.println(i + " - " + aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(i * 1000 + 1000, b1Int); + } + } + + /** + * Lines 254-257, 287-291, 260-262:<br> + * A separate WSDL document is generated for each SCA service. Each has + * its own unique target namespace. This is to ensure that bindings on + * different services of the same component do not clash.<br> + * <p> + * Test two references using binding.ws with 2 different SOAP versions + * and without WSDL document.<br> + */ + @Test + public void testSoapVersion3() throws Exception { + String dName = d.getName(); + String b1Str1 = d.getB1String("string1"); + String b1Str2 = d.getB1String2("string2", "string3"); + String c1Str1 = d.getC1String("string5"); + String c1Str2 = d.getC1String2("string6", "string7"); + + int b1Int = d.getB1Int(4000); + float c1Float = d.getC1Float((float) 8.8); + + Integer c1Integer = d.getC1Integer(new Integer(9000)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9000), c1Integer); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/pom.xml new file mode 100644 index 0000000000..d77dd9d812 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/pom.xml @@ -0,0 +1,68 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-vtest</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding</artifactId> + <packaging>pom</packaging> + <name>Apache Tuscany SCA Web Service Binding Verification Tests</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-utilities</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + + </dependencies> + + <profiles> + <profile> + <id>default</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <modules> + <module>service</module> + <module>nowsdl</module> + <module>wsdlelement</module> + </modules> + </profile> + </profiles> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/service/pom.xml new file mode 100644 index 0000000000..d03b2b4e81 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-service</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - Service</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java new file mode 100644 index 0000000000..397f6b4c5a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AClientService.java @@ -0,0 +1,29 @@ +/* + * 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.vtest.wsbinding; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AClientService. + */ +@Remotable +public interface AClientService { + public String getGreetingsForward(String name); +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java new file mode 100644 index 0000000000..b97e0cfebb --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/AService.java @@ -0,0 +1,29 @@ +/* + * 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.vtest.wsbinding; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + public String getGreetings(String name); +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java new file mode 100644 index 0000000000..8d9e6de816 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AClientServiceImpl.java @@ -0,0 +1,38 @@ +/* + * 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.vtest.wsbinding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.AClientService; +import org.apache.tuscany.sca.vtest.wsbinding.AService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AClientService.class) +public class AClientServiceImpl implements AClientService { + + @Reference + protected AService aService; + + public String getGreetingsForward(String name) { + return aService.getGreetings(name); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.java new file mode 100644 index 0000000000..450da9cbcf --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/impl/AServiceImpl.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 org.apache.tuscany.sca.vtest.wsbinding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.AService; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + public String getGreetings(String name) { + return "Hello " + name; + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/aservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/aservice.wsdl new file mode 100644 index 0000000000..e7953eb2b4 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/aservice.wsdl @@ -0,0 +1,139 @@ +<?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. +--> +<wsdl:definitions targetNamespace="http://wsbinding.vtest.sca.tuscany.apache.org" + xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" + xmlns:ns0="http://wsbinding.vtest.sca.tuscany.apache.org" + xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" + xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" + xmlns:ns1="http://org.apache.axis2/xsd" + xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:types> + <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://wsbinding.vtest.sca.tuscany.apache.org" xmlns:ns="http://wsbinding.vtest.sca.tuscany.apache.org"> + <xs:element name="getGreetings"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="getGreetingsResponse"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:schema> + </wsdl:types> + + <wsdl:message name="getGreetingsRequest"> + <wsdl:part name="parameters" element="ns0:getGreetings"/> + </wsdl:message> + + <wsdl:message name="getGreetingsResponse"> + <wsdl:part name="parameters" element="ns0:getGreetingsResponse"/> + </wsdl:message> + + <wsdl:portType name="AServicePortType"> + <wsdl:operation name="getGreetings"> + <wsdl:input message="ns0:getGreetingsRequest" wsaw:Action="urn:getGreetings"/> + <wsdl:output message="ns0:getGreetingsResponse" wsaw:Action="urn:getGreetingsResponse"/> + </wsdl:operation> + </wsdl:portType> + + <wsdl:binding name="AServiceSOAP12Binding" type="ns0:AServicePortType"> + <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="getGreetings"> + <soap12:operation soapAction="urn:getGreetings" style="document"/> + <wsdl:input> + <soap12:body use="literal"/> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:binding name="AServicePortTypeBinding" type="ns0:AServicePortType"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="getGreetings"> + <soap:operation soapAction=""/> + <wsdl:input> + <soap:body use="literal"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:binding name="AServiceHttpBinding" type="ns0:AServicePortType"> + <http:binding verb="POST"/> + <wsdl:operation name="getGreetings"> + <http:operation location="AService/getGreetings"/> + <wsdl:input> + <mime:content part="getGreetings" type="text/xml"/> + </wsdl:input> + <wsdl:output> + <mime:content part="getGreetings" type="text/xml"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:binding name="AServiceSOAP11Binding" type="ns0:AServicePortType"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="getGreetings"> + <soap:operation soapAction="urn:getGreetings" style="document"/> + <wsdl:input> + <soap:body use="literal"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="AServicePortTypeService"> + <wsdl:port name="AServicePortTypePort" binding="ns0:AServicePortTypeBinding"> + <soap:address location="http://localhost:8085/AService"/> + </wsdl:port> + </wsdl:service> + + <wsdl:service name="AService"> + <wsdl:port name="AServiceHttpport" binding="ns0:AServiceHttpBinding"> + <http:address location="http://localhost:8085/AService/httpport"/> + </wsdl:port> + <wsdl:port name="AServiceSOAP12port_http" binding="ns0:AServiceSOAP12Binding"> + <soap12:address location="http://localhost:8085/AService/soap12port"/> + </wsdl:port> + <wsdl:port name="AServiceSOAP11port_http" binding="ns0:AServiceSOAP11Binding"> + <soap:address location="http://localhost:8085/AService/soap11port"/> + </wsdl:port> + <wsdl:port name="AServiceSOAP12port_http_null" binding="ns0:AServiceSOAP12Binding"> + <soap12:address location=""/> + </wsdl:port> + <wsdl:port name="AServiceSOAP12port_http_wsdl" binding="ns0:AServiceSOAP12Binding"> + <soap12:address location="inWsdl"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite new file mode 100644 index 0000000000..0d92174442 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/endpoint-uri-resolution.composite @@ -0,0 +1,103 @@ +<?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"
+ targetNamespace="http://vtest"
+ name="endpoint-uri-resolution">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
+ <service name="AService">
+ <binding.ws name="bnd1" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http)"
+ uri="http://localhost:8085/AService/soap12portxxx"/>
+ <binding.ws name="bnd2" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)"
+ uri="http://localhost:8085/AService/endpointrefxxx">
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>http://localhost:8085/AService/endpointref</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ <binding.ws name="bnd3" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http_null)"
+ uri="http://localhost:8085/AService/uriInBinding"/>
+ <!-- binding.ws name="bnd4" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http_null)"/-->
+ <binding.ws name="bnd5" uri="http://localhost:8085/AService/noWsdlElement"/>
+ <binding.ws name="bnd6" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http_wsdl)"
+ uri="http://localhost:8085/AService/endpointref6"/>
+ <binding.ws name="bnd7" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)"
+ uri="http://localhost:8085/AService/endpointref7">
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>inAddress</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ <binding.ws name="bnd8" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP12Binding)"
+ uri="http://localhost:8085/AService/endpointref8">
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address></wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ </service>
+ </component>
+ <component name="AClientComponent1">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/soap12port"/>
+ </reference>
+ </component>
+ <component name="AClientComponent2">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/endpointref"/>
+ </reference>
+ </component>
+ <component name="AClientComponent3">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/uriInBinding"/>
+ </reference>
+ </component>
+ <component name="AClientComponent4">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AComponent"/>
+ </reference>
+ </component>
+ <component name="AClientComponent5">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/noWsdlElement"/>
+ </reference>
+ </component>
+ <component name="AClientComponent6">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/endpointref6/inWsdl"/>
+ </reference>
+ </component>
+ <component name="AClientComponent7">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/endpointref7/inAddress"/>
+ </reference>
+ </component>
+ <component name="AClientComponent8">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/endpointref8"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/endpointreference.composite b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/endpointreference.composite new file mode 100644 index 0000000000..3ba152b7b8 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/endpointreference.composite @@ -0,0 +1,40 @@ +<?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"
+ targetNamespace="http://vtest"
+ name="endpointreference">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
+ <service name="AService">
+ <binding.ws wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)">
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>http://localhost:8085/AService/endpointref</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ </service>
+ </component>
+ <component name="AClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/endpointref"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite new file mode 100644 index 0000000000..85c604070a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlbinding.composite @@ -0,0 +1,45 @@ +<?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"
+ targetNamespace="http://vtest"
+ name="wsdlbinding">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
+ <service name="AService">
+ <binding.ws name="bnd11" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP11Binding)"
+ uri="http://localhost:8085/AService/bnd11"/>
+ <binding.ws name="bnd12" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.binding(AServiceSOAP12Binding)"
+ uri="http://localhost:8085/AService/bnd12"/>
+ </service>
+ </component>
+ <component name="AClientBnd11Component">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/bnd11"/>
+ </reference>
+ </component>
+ <component name="AClientBnd12Component">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/bnd12"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite new file mode 100644 index 0000000000..0c11c79efe --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlendpoint.composite @@ -0,0 +1,37 @@ +<?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"
+ targetNamespace="http://vtest"
+ name="wsdlendpoint">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
+ <service name="AService">
+ <binding.ws wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.endpoint(AService/AServiceEndPoint)"
+ uri="http://localhost:8085/AService/endpoint"/>
+ </service>
+ </component>
+ <component name="AClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/endpoint"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlport.composite b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlport.composite new file mode 100644 index 0000000000..859b93bec4 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlport.composite @@ -0,0 +1,43 @@ +<?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"
+ targetNamespace="http://vtest"
+ name="wsdlport">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
+ <service name="AService">
+ <binding.ws name="p11" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP11port_http)"/>
+ <binding.ws name="p12" wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.port(AService/AServiceSOAP12port_http)"/>
+ </service>
+ </component>
+ <component name="AClientP11Component">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/soap11port"/>
+ </reference>
+ </component>
+ <component name="AClientP12Component">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/soap12port"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlservice.composite b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlservice.composite new file mode 100644 index 0000000000..fa96e650de --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/main/resources/wsdlservice.composite @@ -0,0 +1,43 @@ +<?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"
+ targetNamespace="http://vtest"
+ name="wsdlservice">
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AServiceImpl"/>
+ <service name="AService">
+ <binding.ws wsdlElement="http://wsbinding.vtest.sca.tuscany.apache.org#wsdl.service(AService)"
+ uri="http://localhost:8085/AComponent"/>
+ </service>
+ </component>
+ <component name="AClientS11Component">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/soap11port"/>
+ </reference>
+ </component>
+ <component name="AClientS12Component">
+ <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.impl.AClientServiceImpl"/>
+ <reference name="aService">
+ <binding.ws uri="http://localhost:8085/AService/soap12port"/>
+ </reference>
+ </component>
+</composite>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java new file mode 100644 index 0000000000..d858daaf78 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointReferenceTestCase.java @@ -0,0 +1,67 @@ +/* + * 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.vtest.wsbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests EndpointReference element specified in service binding.ws as per Web + * Services Binding Specification v1.00 - Sec 2.1 - Lines 61 to 65. + */ +public class EndpointReferenceTestCase { + + protected static String compositeName = "endpointreference.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 61-65 + * <p> + * /binding.ws/wsa:EndpointReference – optional WS-Addressing [6] + * EndpointReference that specifies the endpoint for the service or + * reference. When this element is present along with the wsdlElement + * attribute on the parent element, the wsdlElement attribute value MUST be + * of the ‘Binding’ form as specified above, i.e. <WSDL-namespace- + * URI>#wsdl.binding(<binding-name>). + */ + @Test + public void testWsdlBinding() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java new file mode 100644 index 0000000000..49f9db248f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/EndpointUriResolutionTestCase.java @@ -0,0 +1,209 @@ +/* + * 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.vtest.wsbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests "Endpoint URI resolution" for service binding.ws as per Web Services + * Binding Specification v1.00 - Sec 2.1.1 - Lines 70 to 85. + */ +public class EndpointUriResolutionTestCase { + + protected static String compositeName = "endpoint-uri-resolution.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 71-78 + * <p> + * The rules for resolving the URI at which an SCA service is hosted, or SCA + * reference targets, when used with binding.ws (in precedence order) are: + * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI + * specified by the wsa:Address element of the wsa:EndpointReference, 2. The + * explicitly stated URI in the "uri" attribute of the binding.ws element, + * which may be relative, 3. The implicit URI as defined by the Assembly + * specification + * <p> + * This method tests that URI in the endpoint takes precedence. + */ + @Test + public void testUriInEndpoint() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent1"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 71-78 + * <p> + * The rules for resolving the URI at which an SCA service is hosted, or SCA + * reference targets, when used with binding.ws (in precedence order) are: + * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI + * specified by the wsa:Address element of the wsa:EndpointReference, 2. The + * explicitly stated URI in the "uri" attribute of the binding.ws element, + * which may be relative, 3. The implicit URI as defined by the Assembly + * specification + * <p> + * This method tests that URI in the EndpointReference takes precedence. + */ + @Test + public void testUriInEndpointReference() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent2"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 71-78 + * <p> + * The rules for resolving the URI at which an SCA service is hosted, or SCA + * reference targets, when used with binding.ws (in precedence order) are: + * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI + * specified by the wsa:Address element of the wsa:EndpointReference, 2. The + * explicitly stated URI in the "uri" attribute of the binding.ws element, + * which may be relative, 3. The implicit URI as defined by the Assembly + * specification + * <p> + * This method tests that explicitly stated URI in the "uri" attribute of + * binding.ws takes precedence. + */ + @Test + public void testUriInBindingWs() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent3"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 71-78 + * <p> + * The rules for resolving the URI at which an SCA service is hosted, or SCA + * reference targets, when used with binding.ws (in precedence order) are: + * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI + * specified by the wsa:Address element of the wsa:EndpointReference, 2. The + * explicitly stated URI in the "uri" attribute of the binding.ws element, + * which may be relative, 3. The implicit URI as defined by the Assembly + * specification + * <p> + * This method tests that implicit URI is used. + */ + @Ignore("TUSCANY-2523 - Port 8080 conflicts with Continuum") + @Test + public void testImplicitUri() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent4"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 71-78 + * <p> + * The rules for resolving the URI at which an SCA service is hosted, or SCA + * reference targets, when used with binding.ws (in precedence order) are: + * 1. The URIs in the endpoint(s) of the referenced WSDL or The URI + * specified by the wsa:Address element of the wsa:EndpointReference, 2. The + * explicitly stated URI in the "uri" attribute of the binding.ws element, + * which may be relative, 3. The implicit URI as defined by the Assembly + * specification + * <p> + * This method tests that explicitly stated URI in the "uri" attribute of + * the binding.ws is used in the absence of a wsdlElement. + */ + @Test + public void testNoWsdlElement() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent5"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 79-83 + * <p> + * The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a + * relative URI, in which case it is relative to the URI defined in (2) or + * (3). The wsa:Address element can be the empty relative URI, in which case + * it uses the URI defined in (2) or (3) directly. This allows the EPR + * writer to specify reference parameters, metadata and other EPR contents + * while allowing the URI to be chosen by the deployer. + * <p> + * This method tests that the relative URI specified in WSDL endpoint is + * used along with the explicit URI specified in the "uri" attribute of + * binding.ws element. + */ + @Test + public void testRelativeUriInWsdl() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent6"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 79-83 + * <p> + * The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a + * relative URI, in which case it is relative to the URI defined in (2) or + * (3). The wsa:Address element can be the empty relative URI, in which case + * it uses the URI defined in (2) or (3) directly. This allows the EPR + * writer to specify reference parameters, metadata and other EPR contents + * while allowing the URI to be chosen by the deployer. + * <p> + * This method tests that the relative URI specified in wsa:Address is used + * along with the explicit URI specified in the "uri" attribute of + * binding.ws element. + */ + @Test + public void testRelativeUriInAddress() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent7"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + /** + * Lines 79-83 + * <p> + * The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a + * relative URI, in which case it is relative to the URI defined in (2) or + * (3). The wsa:Address element can be the empty relative URI, in which case + * it uses the URI defined in (2) or (3) directly. This allows the EPR + * writer to specify reference parameters, metadata and other EPR contents + * while allowing the URI to be chosen by the deployer. + * <p> + * This method tests that when wsa:Address is empty, the explicit URI + * specified in the "uri" attribute of binding.ws element is used. + */ + @Test + public void testEmptyAddressElement() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent8"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java new file mode 100644 index 0000000000..292de8b654 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlBindingTestCase.java @@ -0,0 +1,68 @@ +/* + * 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.vtest.wsbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests wsdlElement specified on service binding.ws as per Web Services Binding Specification v1.00 - Sec 2.1 + * - Lines 35 to 54. + */ +public class WsdlBindingTestCase { + + protected static String compositeName = "wsdlbinding.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 50-54 + * <p> + * Binding: + * <WSDL-namespace-URI>#wsdl.binding(<binding-name>) + * In this case, the identified WSDL binding must have an equivalent PortType with the SCA + * service or reference. In this case the endpoint address URI for the SCA service or + * reference must be provided via the URI attribute on the binding. + */ + @Test + public void testWsdlBinding() throws Exception { + AClientService aClientBnd11 = ServiceFinder.getService(AClientService.class, "AClientBnd11Component"); + Assert.assertEquals("Hello Pandu", aClientBnd11.getGreetingsForward("Pandu")); + AClientService aClientBnd12 = ServiceFinder.getService(AClientService.class, "AClientBnd12Component"); + Assert.assertEquals("Hello Pandu", aClientBnd12.getGreetingsForward("Pandu")); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java new file mode 100644 index 0000000000..842da87bd4 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlEndpointTestCase.java @@ -0,0 +1,66 @@ +/* + * 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.vtest.wsbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests wsdlElement specified on service binding.ws as per Web Services Binding + * Specification v1.00 - Sec 2.1 - Lines 35 to 54. + */ +public class WsdlEndpointTestCase { + + protected static String compositeName = "wsdlendpoint.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 46-49 + * <p> + * Endpoint (WSDL 2.0): <WSDL-namespace-URI>#wsdl.endpoint(<service-name>/<endpoint-name>) + * In this case, the identified endpoint in the WSDL 2.0 Service must have + * an equivalent PortType with the SCA service or reference. + */ + @Test + @Ignore("WSDL2.0 Support") + public void testWsdlEndpoint() throws Exception { + AClientService aClient = ServiceFinder.getService(AClientService.class, "AClientComponent"); + Assert.assertEquals("Hello Pandu", aClient.getGreetingsForward("Pandu")); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java new file mode 100644 index 0000000000..0545cef776 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlPortTestCase.java @@ -0,0 +1,66 @@ +/* + * 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.vtest.wsbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests wsdlElement specified on service binding.ws as per Web Services Binding + * Specification v1.00 - Sec 2.1 - Lines 35 to 54. + */ +public class WsdlPortTestCase { + + protected static String compositeName = "wsdlport.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 42-45 + * <p> + * Port (WSDL 1.1): <WSDL-namespace-URI>#wsdl.port(<service-name>/<port-name>) + * In this case, the identified port in the WSDL 1.1 Service must have an + * equivalent PortType with the SCA service or reference. + */ + @Test + public void testWsdlPort() throws Exception { + AClientService aClientP11 = ServiceFinder.getService(AClientService.class, "AClientP11Component"); + Assert.assertEquals("Hello Pandu", aClientP11.getGreetingsForward("Pandu")); + AClientService aClientP12 = ServiceFinder.getService(AClientService.class, "AClientP12Component"); + Assert.assertEquals("Hello Pandu", aClientP12.getGreetingsForward("Pandu")); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java new file mode 100644 index 0000000000..aa2b2fac7a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/WsdlServiceTestCase.java @@ -0,0 +1,69 @@ +/* + * 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.vtest.wsbinding; + +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests wsdlElement specified on service binding.ws as per Web Services Binding + * Specification v1.00 - Sec 2.1 - Lines 35 to 54. + */ +public class WsdlServiceTestCase { + + protected static String compositeName = "wsdlservice.composite"; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 38-41 + * <p> + * Service: <WSDL-namespace-URI>#wsdl.service(<service-name>) In this case, + * all the endpoints in the WSDL Service that have equivalent PortTypes with + * the SCA service or reference must be available to the SCA service or + * reference. + */ + @Test + @Ignore("TUSCANY-2298") + public void testWsdlService() throws Exception { + AClientService aClientS11 = ServiceFinder.getService(AClientService.class, "AClientS11Component"); + Assert.assertEquals("Hello Pandu", aClientS11.getGreetingsForward("Pandu")); + AClientService aClientS12 = ServiceFinder.getService(AClientService.class, "AClientS12Component"); + Assert.assertEquals("Hello Pandu", aClientS12.getGreetingsForward("Pandu")); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/pom.xml new file mode 100644 index 0000000000..413e621986 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-wsdlelement</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-wsdlelement-binding</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - WSDL wsdlElement wsdl.binding</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java new file mode 100644 index 0000000000..49d12876e5 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/AService.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getB2String(String aString); + + public int getB2Int(int i); +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java new file mode 100644 index 0000000000..b303f09dbc --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.java new file mode 100644 index 0000000000..7089663cf1 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/BService2.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 org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService2 { + + public String getString(String aString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java new file mode 100644 index 0000000000..56f7415208 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java new file mode 100644 index 0000000000..90a78d3f0f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java new file mode 100644 index 0000000000..ce5adf2cc5 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/AServiceImpl.java @@ -0,0 +1,63 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.AService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference(required=false) + public BService b1; + + @Reference(required=false) + public BService2 b2; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getB2String(String aString) { + return b2.getString(aString); + } + + public int getB2Int(int i) { + return b2.getInt(i); + } + +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java new file mode 100644 index 0000000000..4040108542 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BService2Impl.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2; +import org.osoa.sca.annotations.Service; + +@Service(BService2.class) +public class BService2Impl implements BService2 { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java new file mode 100644 index 0000000000..66c9cb4136 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java new file mode 100644 index 0000000000..ecdfbd59e2 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java new file mode 100644 index 0000000000..06470f29f9 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements DService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl new file mode 100644 index 0000000000..8ce0fbaeb8 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/bservice.wsdl @@ -0,0 +1,228 @@ +<?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.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.binding.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsdlelement" targetNamespace="http://vtest.wsbinding.wsdlelement.binding.bservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.binding.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getString">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getStringResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getString2">
+ <xsd:complexType>
+ <xsd:sequence>
<xsd:element name="in1" type="xsd:string"></xsd:element> + <xsd:element name="in2" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2Response"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getInt"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in" type="xsd:int"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getIntResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:int"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getStringRequest">
+ <wsdl:part element="tns:getString" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getStringResponse">
+ <wsdl:part element="tns:getStringResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getString2Request">
+ <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntRequest"> + <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntResponse"> + <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringRequest"> + <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringResponse"> + <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntRequest"> + <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntResponse"> + <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:portType name="BService1PortType">
+ <wsdl:operation name="getString">
+ <wsdl:input message="tns:getStringRequest"/>
+ <wsdl:output message="tns:getStringResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <wsdl:input message="tns:getString2Request"></wsdl:input> + <wsdl:output message="tns:getString2Response"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getInt"> + <wsdl:input message="tns:getIntRequest"></wsdl:input> + <wsdl:output message="tns:getIntResponse"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType>
+ <wsdl:portType name="BService2PortType">
+ <wsdl:operation name="getString">
+ <wsdl:input message="tns:getStringRequest"></wsdl:input> + <wsdl:output message="tns:getStringResponse"></wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <wsdl:input message="tns:getIntRequest"></wsdl:input> + <wsdl:output message="tns:getIntResponse"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="BService1SOAPBinding"
+ type="tns:BService1PortType">
<soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getString">
<soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString" />
<wsdl:input>
<soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
<soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString2" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getInt"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getInt" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding>
+ <wsdl:binding name="BService2SOAPBinding"
+ type="tns:BService2PortType">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="getString"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getInt" /> + <wsdl:input> + <soap:body use="literal" />
+ </wsdl:input> + <wsdl:output> + <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation> + </wsdl:binding> + <wsdl:binding name="BService3SOAP12Binding"
+ type="tns:BService1PortType">
+ <soap12:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getString">
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getString2" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.bservice/getInt" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="BService">
+ <wsdl:port binding="tns:BService1SOAPBinding" name="BService1SOAP">
+ <soap:address location=""/>
+ </wsdl:port>
+ <wsdl:port name="BService2SOAP"
+ binding="tns:BService2SOAPBinding">
+ <soap:address location="" />
+ </wsdl:port>
+ <wsdl:port name="BService3SOAP12"
+ binding="tns:BService3SOAP12Binding">
+ <soap12:address location=""></soap12:address>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="BService2">
+ <wsdl:port name="BService2Port" binding="tns:BService2SOAPBinding">
+ <soap:address location="" />
+ </wsdl:port>
+ </wsdl:service> +</wsdl:definitions>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl new file mode 100644 index 0000000000..ff151faa7a --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/cservice.wsdl @@ -0,0 +1,173 @@ +<?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.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.binding.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CService" targetNamespace="http://vtest.wsbinding.wsdlelement.binding.cservice">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.binding.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getFloat">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:float"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getFloatResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:float"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getInteger">
+ <xsd:complexType>
+ <xsd:sequence>
<xsd:element name="in" type="xsd:integer"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getIntegerResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:integer"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in1" type="xsd:string"></xsd:element> + <xsd:element name="in2" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2Response"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getStringResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getFloatRequest">
+ <wsdl:part element="tns:getFloat" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getFloatResponse">
+ <wsdl:part element="tns:getFloatResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getIntegerRequest">
+ <wsdl:part name="parameters" element="tns:getInteger"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntegerResponse"> + <wsdl:part name="parameters" element="tns:getIntegerResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Request"> + <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringRequest"> + <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringResponse"> + <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Request"> + <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:portType name="CServicePortType">
+ <wsdl:operation name="getFloat">
+ <wsdl:input message="tns:getFloatRequest"/>
+ <wsdl:output message="tns:getFloatResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getInteger">
+ <wsdl:input message="tns:getIntegerRequest"></wsdl:input> + <wsdl:output message="tns:getIntegerResponse"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString"> + <wsdl:input message="tns:getStringRequest"></wsdl:input> + <wsdl:output message="tns:getStringResponse"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString2"> + <wsdl:input message="tns:getString2Request"></wsdl:input> + <wsdl:output message="tns:getString2Response"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType>
+ <wsdl:binding name="CServiceSOAPBinding"
+ type="tns:CServicePortType">
<soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getFloat">
<soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getFloat" />
<wsdl:input>
<soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
<soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInteger">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getInteger" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getString" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString2"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.binding.cservice/getString2" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding>
+ <wsdl:service name="CService">
+ <wsdl:port binding="tns:CServiceSOAPBinding" name="CServiceSOAP">
+ <soap:address location=""/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite new file mode 100644 index 0000000000..6b97b5e602 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/main/resources/wsdlelement.binding.composite @@ -0,0 +1,114 @@ +<?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" + targetNamespace="http://vtest.wsbinding.wsdlelement.binding" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="wsdlelement.binding"> + + <component name="BComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService1SOAPBinding)" + uri="http://localhost:8085/BComponent1"/> + </service> + </component> + + <component name="BComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)" + uri="http://localhost:8085/BComponent2"/> + </service> + </component> + + <component name="BComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BService2Impl"/> + <service name="BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)" + uri="http://localhost:8085/BComponent3"/> + </service> + </component> + + <component name="BComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService3SOAP12Binding)" + uri="http://localhost:8085/BComponent4"/> + </service> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.CServiceImpl"/> + <service name="CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.cservice#wsdl.binding(CServiceSOAPBinding)" + uri="http://localhost:8085/CComponent"/> + </service> + </component> + + <component name="AComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/> + <reference name="b1" target="BComponent1/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService1SOAPBinding)" uri="http://localhost:8085/BComponent1"/> + </reference> + </component> + + <component name="AComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/> + <reference name="b1" target="BComponent2/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent2"/> + </reference> + </component> + + <component name="AComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/> + <reference name="b2" target="BComponent3/BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent3"/> + </reference> + </component> + + <component name="AComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.AServiceImpl"/> + <reference name="b1" target="BComponent4/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService3SOAP12Binding)" uri="http://localhost:8085/BComponent4"/> + </reference> + </component> + + <component name="DComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.impl.DServiceImpl"/> + <reference name="b1" target="BComponent1/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.bservice#wsdl.binding(BService1SOAPBinding)" uri="http://localhost:8085/BComponent1"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.CService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.binding.cservice#wsdl.binding(CServiceSOAPBinding)" uri="http://localhost:8085/CComponent"/> + </reference> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java new file mode 100644 index 0000000000..f30cf38654 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/binding/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/binding/WsdlElementBindingTestCase.java @@ -0,0 +1,190 @@ +/* + * 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.vtest.wsbinding.wsdlelement.binding; + +import static org.junit.Assert.fail; +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.AService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.binding.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element wsdl.binding with WSDL + * document described in section section 2.1 of SCA Web Services Binding + * V1.00<br> + */ +public class WsdlElementBindingTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "wsdlelement.binding.composite"; + protected static AService a1; + protected static AService a2; + protected static AService a3; + protected static AService a4; + protected static DService d; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + a1 = ServiceFinder.getService(AService.class, "AComponent1"); + a2 = ServiceFinder.getService(AService.class, "AComponent2"); + a3 = ServiceFinder.getService(AService.class, "AComponent3"); + a4 = ServiceFinder.getService(AService.class, "AComponent4"); + d = ServiceFinder.getService(DService.class, "DComponent1"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 50-54:<br> + * Binding:<br> + * <WSDL-namespace-URI>#wsdl.binding(<binding-name>)<br> + * In this case, the identified WSDL binding must have an equivalent + * PortType with the SCA service or reference. In this case the endpoint + * address URI for the SCA service or reference must be provided via the + * URI attribute on the binding.<br> + * <br> + * Tests wsdl.binding(BService1SOAPBinding)<br> + */ + @Test + public void testWsdlElementBinding1() throws Exception { + String aName = a1.getName(); + String b1Str1 = a1.getB1String("string1"); + String b1Str2 = a1.getB1String2("string2", "string3"); + int b1Int = a1.getB1Int(1000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(1000, b1Int); + } + + /** + * Lines 50-54:<br> + * Binding:<br> + * <br> + * Tests wsdl.binding(BService2SOAPBinding) with BService where the binding + * does not define getString2, so exceptions are expected.<br> + */ + @Test + public void testWsdlElementBinding2() throws Exception { + String aName = a2.getName(); + System.out.println(aName + ": "); + try { + a2.getB1String("string1"); + fail("Should not be able to call getString"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + try { + a2.getB1String2("string2", "string3"); + fail("Should not be able to call getString2"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + try { + a2.getB1Int(2000); + fail("Should not be able to call getInt"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + } + + /** + * Lines 50-54:<br> + * Binding:<br> + * <br> + * Tests wsdl.binding(BService2SOAPBinding) with BService2<br> + */ + @Test + public void testWsdlElementBinding3() throws Exception { + String aName = a3.getName(); + String b2Str1 = a3.getB2String("string1"); + int b2Int = a3.getB2Int(3000); + + System.out.println(aName + ": " + b2Str1 + ", " + b2Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b2Str1); + Assert.assertEquals(3000, b2Int); + } + + /** + * Lines 50-54:<br> + * Binding:<br> + * <br> + * Tests two references using wsdl.binding.<br> + */ + @Test + public void testWsdlElementBinding4() throws Exception { + String dName = d.getName(); + String b1Str1 = d.getB1String("string1"); + String b1Str2 = d.getB1String2("string2", "string3"); + String c1Str1 = d.getC1String("string5"); + String c1Str2 = d.getC1String2("string6", "string7"); + + int b1Int = d.getB1Int(4000); + float c1Float = d.getC1Float((float) 8.8); + + Integer c1Integer = d.getC1Integer(new Integer(9000)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9000), c1Integer); + } + + /** + * Lines 50-54:<br> + * Binding:<br> + * <br> + * Tests wsdl.binding(BService3SOAP12Binding) which uses SOAP 1.2<br> + */ + @Test + public void testWsdlElementBinding5() throws Exception { + String aName = a4.getName(); + String b1Str1 = a4.getB1String("string1"); + String b1Str2 = a4.getB1String2("string2", "string3"); + int b1Int = a4.getB1Int(5000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(5000, b1Int); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/pom.xml new file mode 100644 index 0000000000..616f8d3fa6 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/pom.xml @@ -0,0 +1,68 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-wsdlelement</artifactId> + <packaging>pom</packaging> + <name>Apache Tuscany SCA Web Service Binding Verification Tests - wsdlElement</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-utilities</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + + </dependencies> + + <profiles> + <profile> + <id>default</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <modules> + <module>service</module> + <module>port</module> + <module>binding</module> + </modules> + </profile> + </profiles> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/pom.xml new file mode 100644 index 0000000000..45c76e629b --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-wsdlelement</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-wsdlelement-port</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - WSDL wsdlElement wsdl.port</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java new file mode 100644 index 0000000000..a0ed87249f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/AService.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getB2String(String aString); + + public int getB2Int(int i); +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java new file mode 100644 index 0000000000..1bdabeaea7 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.java new file mode 100644 index 0000000000..3952d8c792 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/BService2.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 org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService2 { + + public String getString(String aString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java new file mode 100644 index 0000000000..244907fa19 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java new file mode 100644 index 0000000000..519374c1bd --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java new file mode 100644 index 0000000000..558ddcbb49 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/AServiceImpl.java @@ -0,0 +1,62 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.AService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference(required=false) + public BService b1; + + @Reference(required=false) + public BService2 b2; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getB2String(String aString) { + return b2.getString(aString); + } + + public int getB2Int(int i) { + return b2.getInt(i); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java new file mode 100644 index 0000000000..b1dd73edc8 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BService2Impl.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2; +import org.osoa.sca.annotations.Service; + +@Service(BService2.class) +public class BService2Impl implements BService2 { + + public String getName() { + return "BService2"; + } + + public String getString(String aString) { + return aString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java new file mode 100644 index 0000000000..b132fca45b --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java new file mode 100644 index 0000000000..ca3ec62b83 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java new file mode 100644 index 0000000000..767deae23f --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements DService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl new file mode 100644 index 0000000000..d5c8d72dc1 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/bservice.wsdl @@ -0,0 +1,238 @@ +<?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.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.port.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsdlelement" targetNamespace="http://vtest.wsbinding.wsdlelement.port.bservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.port.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getString">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getStringResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getString2">
+ <xsd:complexType>
+ <xsd:sequence>
<xsd:element name="in1" type="xsd:string"></xsd:element> + <xsd:element name="in2" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2Response"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getInt"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in" type="xsd:int"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getIntResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getStringRequest">
+ <wsdl:part element="tns:getString" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getStringResponse">
+ <wsdl:part element="tns:getStringResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getString2Request">
+ <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntRequest"> + <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntResponse"> + <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringRequest"> + <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringResponse"> + <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntRequest"> + <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntResponse"> + <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:portType name="BService1PortType">
+ <wsdl:operation name="getString">
+ <wsdl:input message="tns:getStringRequest"/>
+ <wsdl:output message="tns:getStringResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <wsdl:input message="tns:getString2Request"></wsdl:input> + <wsdl:output message="tns:getString2Response"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getInt"> + <wsdl:input message="tns:getIntRequest"></wsdl:input> + <wsdl:output message="tns:getIntResponse"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType>
+ <wsdl:portType name="BService2PortType">
+ <wsdl:operation name="getString">
+ <wsdl:input message="tns:getStringRequest"></wsdl:input> + <wsdl:output message="tns:getStringResponse"></wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <wsdl:input message="tns:getIntRequest"></wsdl:input> + <wsdl:output message="tns:getIntResponse"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="BService1SOAPBinding"
+ type="tns:BService1PortType">
<soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getString">
<soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString" />
<wsdl:input>
<soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
<soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString2" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getInt"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getInt" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding>
+ <wsdl:binding name="BService2SOAPBinding"
+ type="tns:BService2PortType">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="getString"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getInt" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding> + <wsdl:binding name="BService3SOAP12Binding"
+ type="tns:BService1PortType">
+
+ <soap12:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getString">
+
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString" />
+ <wsdl:input>
+
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getString2" />
+ <wsdl:input>
+
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.bservice/getInt" />
+ <wsdl:input>
+
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="BService">
+ <wsdl:port binding="tns:BService1SOAPBinding" name="BService1SOAP">
+ <soap:address location=""/>
+ </wsdl:port>
+ <wsdl:port name="BService2SOAP"
+ binding="tns:BService2SOAPBinding">
+ <soap:address location="" />
+ </wsdl:port>
+ <wsdl:port name="BService3SOAP12"
+ binding="tns:BService3SOAP12Binding">
+ <soap12:address location=""></soap12:address>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="BService2">
+ <wsdl:port name="BService2Port" binding="tns:BService2SOAPBinding">
+ <soap:address location="" />
+ </wsdl:port>
+ </wsdl:service> +</wsdl:definitions>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl new file mode 100644 index 0000000000..8a715a2081 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/cservice.wsdl @@ -0,0 +1,173 @@ +<?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.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.port.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CService" targetNamespace="http://vtest.wsbinding.wsdlelement.port.cservice">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.port.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getFloat">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:float"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getFloatResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:float"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getInteger">
+ <xsd:complexType>
+ <xsd:sequence>
<xsd:element name="in" type="xsd:integer"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getIntegerResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:integer"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in1" type="xsd:string"></xsd:element> + <xsd:element name="in2" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2Response"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getStringResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getFloatRequest">
+ <wsdl:part element="tns:getFloat" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getFloatResponse">
+ <wsdl:part element="tns:getFloatResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getIntegerRequest">
+ <wsdl:part name="parameters" element="tns:getInteger"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntegerResponse"> + <wsdl:part name="parameters" element="tns:getIntegerResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Request"> + <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringRequest"> + <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringResponse"> + <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Request"> + <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:portType name="CServicePortType">
+ <wsdl:operation name="getFloat">
+ <wsdl:input message="tns:getFloatRequest"/>
+ <wsdl:output message="tns:getFloatResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getInteger">
+ <wsdl:input message="tns:getIntegerRequest"></wsdl:input> + <wsdl:output message="tns:getIntegerResponse"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString"> + <wsdl:input message="tns:getStringRequest"></wsdl:input> + <wsdl:output message="tns:getStringResponse"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString2"> + <wsdl:input message="tns:getString2Request"></wsdl:input> + <wsdl:output message="tns:getString2Response"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType>
+ <wsdl:binding name="CServiceSOAPBinding"
+ type="tns:CServicePortType">
<soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getFloat">
<soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getFloat" />
<wsdl:input>
<soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
<soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInteger">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getInteger" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getString" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString2"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.port.cservice/getString2" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding>
+ <wsdl:service name="CService">
+ <wsdl:port binding="tns:CServiceSOAPBinding" name="CServiceSOAP">
+ <soap:address location=""/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite new file mode 100644 index 0000000000..5b9b77683e --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/main/resources/wsdlelement.port.composite @@ -0,0 +1,115 @@ +<?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" + targetNamespace="http://vtest.wsbinding.wsdlelement.port" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="wsdlelement.port"> + + + <component name="BComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService1SOAP)" + uri="http://localhost:8085/BComponent1"/> + </service> + </component> + + <component name="BComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService2SOAP)" + uri="http://localhost:8085/BComponent2"/> + </service> + </component> + + <component name="BComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BService2Impl"/> + <service name="BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService2/BService2Port)" + uri="http://localhost:8085/BComponent3"/> + </service> + </component> + + <component name="BComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService3SOAP12)" + uri="http://localhost:8085/BComponent4"/> + </service> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.CServiceImpl"/> + <service name="CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.cservice#wsdl.port(CService/CServiceSOAP)" + uri="http://localhost:8085/CComponent"/> + </service> + </component> + + <component name="AComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/> + <reference name="b1" target="BComponent1/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent1"/> + </reference> + </component> + + <component name="AComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/> + <reference name="b1" target="BComponent2/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService2SOAP)" uri="http://localhost:8085/BComponent2"/> + </reference> + </component> + + <component name="AComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/> + <reference name="b2" target="BComponent3/BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService2/BService2Port)" uri="http://localhost:8085/BComponent3"/> + </reference> + </component> + + <component name="AComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.AServiceImpl"/> + <reference name="b1" target="BComponent4/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService3SOAP12)" uri="http://localhost:8085/BComponent4"/> + </reference> + </component> + + <component name="DComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.impl.DServiceImpl"/> + <reference name="b1" target="BComponent1/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent1"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.CService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.port.cservice#wsdl.port(CService/CServiceSOAP)" uri="http://localhost:8085/CComponent"/> + </reference> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java new file mode 100644 index 0000000000..0db579002b --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/port/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/port/WsdlElementPortTestCase.java @@ -0,0 +1,188 @@ +/* + * 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.vtest.wsbinding.wsdlelement.port; + +import static org.junit.Assert.fail; +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.AService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.port.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element wsdl.port with WSDL + * document described in section section 2.1 of SCA Web Services Binding + * V1.00<br> + */ +public class WsdlElementPortTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "wsdlelement.port.composite"; + protected static AService a1; + protected static AService a2; + protected static AService a3; + protected static AService a4; + protected static DService d; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + a1 = ServiceFinder.getService(AService.class, "AComponent1"); + a2 = ServiceFinder.getService(AService.class, "AComponent2"); + a3 = ServiceFinder.getService(AService.class, "AComponent3"); + a4 = ServiceFinder.getService(AService.class, "AComponent4"); + d = ServiceFinder.getService(DService.class, "DComponent1"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 42-45:<br> + * Port (WSDL 1.1):<br> + * <WSDL-namespace-URI>#wsdl.port(<service-name>/<port-name>) + * In this case, the identified port in the WSDL 1.1 Service must have an + * equivalent PortType with the SCA service or reference.<br> + * <br> + * Test wsdl.port(BService/BService1SOAP)<br> + */ + @Test + public void testWsdlElementPort1() throws Exception { + String aName = a1.getName(); + String b1Str1 = a1.getB1String("string1"); + String b1Str2 = a1.getB1String2("string2", "string3"); + int b1Int = a1.getB1Int(1000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(1000, b1Int); + } + + /** + * Lines 42-45:<br> + * Port (WSDL 1.1):<br> + * <br> + * Tests wsdl.port(BService/BService2SOAP) with BService where the port + * does not define getString2, so exceptions are expected.<br> + */ + @Test + public void testWsdlElementPort2() throws Exception { + String aName = a2.getName(); + System.out.println(aName + ": "); + try { + a2.getB1String("string1"); + fail("Should not be able to call getString"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + try { + a2.getB1String2("string2", "string3"); + fail("Should not be able to call getString2"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + try { + a2.getB1Int(2000); + fail("Should not be able to call getInt"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + } + + /** + * Lines 42-45:<br> + * Port (WSDL 1.1):<br> + * <br> + * Tests wsdl.port(BService/BService2SOAP) with BService2<br> + */ + @Test + public void testWsdlElementPort3() throws Exception { + String aName = a3.getName(); + String b2Str1 = a3.getB2String("string1"); + int b2Int = a3.getB2Int(1000); + + System.out.println(aName + ": " + b2Str1 + ", " + b2Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b2Str1); + Assert.assertEquals(1000, b2Int); + } + + /** + * Lines 42-45:<br> + * Port (WSDL 1.1):<br> + * <br> += * Tests two references using wsdl.port.<br> + */ + @Test + public void testWsdlElementPort4() throws Exception { + String dName = d.getName(); + String b1Str1 = d.getB1String("string1"); + String b1Str2 = d.getB1String2("string2", "string3"); + String c1Str1 = d.getC1String("string5"); + String c1Str2 = d.getC1String2("string6", "string7"); + + int b1Int = d.getB1Int(4000); + float c1Float = d.getC1Float((float) 8.8); + + Integer c1Integer = d.getC1Integer(new Integer(9000)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9000), c1Integer); + } + + /** + * Lines 42-45:<br> + * Port (WSDL 1.1):<br> + * <br> += * Tests wsdl.port(BService/BService3SOAP12) which uses SOAP 1.2<br> + */ + @Test + public void testWsdlElementPort5() throws Exception { + String aName = a4.getName(); + String b1Str1 = a4.getB1String("string1"); + String b1Str2 = a4.getB1String2("string2", "string3"); + int b1Int = a4.getB1Int(5000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(5000, b1Int); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/pom.xml b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/pom.xml new file mode 100644 index 0000000000..a8cafc5088 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/pom.xml @@ -0,0 +1,58 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>vtest-wsbinding-wsdlelement</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>vtest-wsbinding-wsdlelement-service</artifactId> + <name>Apache Tuscany SCA vTest Web Service Binding Verification Tests - WSDL wsdlElement wsdl.service</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-tomcat</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + </dependencies> +</project> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java new file mode 100644 index 0000000000..69b709ae95 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/AService.java @@ -0,0 +1,50 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for AService. + */ +@Remotable +public interface AService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getB2String(String aString); + + public int getB2Int(int i); + + public String getB3String(String aString); + + public int getB3Int(int i); + + public String getB4String(String aString); + + public String getB4String2(String aString, String bString); + + public int getB4Int(int i); +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java new file mode 100644 index 0000000000..852f36e0c1 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService.java @@ -0,0 +1,35 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.java new file mode 100644 index 0000000000..bfcacdaa21 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/BService2.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 org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface BService2 { + + public String getString(String aString); + + public int getInt(int i); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java new file mode 100644 index 0000000000..5ceab40d0e --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/CService.java @@ -0,0 +1,37 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service; + +import org.osoa.sca.annotations.Remotable; + +/** + * Simple Service used by another service + */ +@Remotable +public interface CService { + + public String getString(String aString); + + public String getString2(String aString, String bString); + + public Integer getInteger(Integer i); + + public float getFloat(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java new file mode 100644 index 0000000000..5182ee3029 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/DService.java @@ -0,0 +1,45 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for DService. + */ +@Remotable +public interface DService { + + public String getName(); + + public String getB1String(String aString); + + public String getB1String2(String aString, String bString); + + public int getB1Int(int i); + + public String getC1String(String aString); + + public String getC1String2(String aString, String bString); + + public Integer getC1Integer(Integer i); + + public float getC1Float(float f); + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.java new file mode 100644 index 0000000000..e89cf21215 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/AServiceImpl.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.vtest.wsbinding.wsdlelement.service.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.AService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements AService. + */ +@Service(AService.class) +public class AServiceImpl implements AService { + + @Reference(required=false) + public BService b1; + + @Reference(required=false) + public BService2 b2; + + @Reference(required=false) + public BService2 b3; + + @Reference(required=false) + public BService b4; + + public String getName() { + return "AService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getB2String(String aString) { + return b2.getString(aString); + } + + public int getB2Int(int i) { + return b2.getInt(i); + } + + public String getB3String(String aString) { + return b3.getString(aString); + } + + public int getB3Int(int i) { + return b3.getInt(i); + } + + public String getB4String(String aString) { + return b4.getString(aString); + } + + public String getB4String2(String aString, String bString) { + return b4.getString2(aString, bString); + } + + public int getB4Int(int i) { + return b4.getInt(i); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java new file mode 100644 index 0000000000..b8c23433eb --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BService2Impl.java @@ -0,0 +1,40 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2; +import org.osoa.sca.annotations.Service; + +@Service(BService2.class) +public class BService2Impl implements BService2 { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java new file mode 100644 index 0000000000..cbbf8222e6 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/BServiceImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService; +import org.osoa.sca.annotations.Service; + +@Service(BService.class) +public class BServiceImpl implements BService { + + public String getName() { + return "BService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public int getInt(int i) { + return i; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java new file mode 100644 index 0000000000..29a22f31bd --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/CServiceImpl.java @@ -0,0 +1,48 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService; +import org.osoa.sca.annotations.Service; + +@Service(CService.class) +public class CServiceImpl implements CService { + + public String getName() { + return "CService"; + } + + public String getString(String aString) { + return aString; + } + + public String getString2(String aString, String bString) { + return aString + bString; + } + + public Integer getInteger(Integer i) { + return i; + } + + public float getFloat(float f) { + return f; + } + +} diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java new file mode 100644 index 0000000000..87654e7188 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/impl/DServiceImpl.java @@ -0,0 +1,70 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service.impl; + +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.DService; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * This class implements DService. + */ +@Service(DService.class) +public class DServiceImpl implements DService { + + @Reference + public BService b1; + + @Reference + public CService c1; + + public String getName() { + return "DService"; + } + + public String getB1String(String aString) { + return b1.getString(aString); + } + + public String getB1String2(String aString, String bString) { + return b1.getString2(aString, bString); + } + + public int getB1Int(int i) { + return b1.getInt(i); + } + + public String getC1String(String aString) { + return c1.getString(aString); + } + + public String getC1String2(String aString, String bString) { + return c1.getString2(aString, bString); + } + + public Integer getC1Integer(Integer i) { + return c1.getInteger(i); + } + + public float getC1Float(float f) { + return c1.getFloat(f); + } +}
\ No newline at end of file diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl new file mode 100644 index 0000000000..521f077c46 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/bservice.wsdl @@ -0,0 +1,225 @@ +<?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.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.service.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsdlelement" targetNamespace="http://vtest.wsbinding.wsdlelement.service.bservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.service.bservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getString">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getStringResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getString2">
+ <xsd:complexType>
+ <xsd:sequence>
<xsd:element name="in1" type="xsd:string"></xsd:element> + <xsd:element name="in2" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2Response"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getInt"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in" type="xsd:int"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getIntResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:int"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getStringRequest">
+ <wsdl:part element="tns:getString" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getStringResponse">
+ <wsdl:part element="tns:getStringResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getString2Request">
+ <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntRequest"> + <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntResponse"> + <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringRequest"> + <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringResponse"> + <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntRequest"> + <wsdl:part name="parameters" element="tns:getInt"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntResponse"> + <wsdl:part name="parameters" element="tns:getIntResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:portType name="BService1PortType">
+ <wsdl:operation name="getString">
+ <wsdl:input message="tns:getStringRequest"/>
+ <wsdl:output message="tns:getStringResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <wsdl:input message="tns:getString2Request"></wsdl:input> + <wsdl:output message="tns:getString2Response"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getInt"> + <wsdl:input message="tns:getIntRequest"></wsdl:input> + <wsdl:output message="tns:getIntResponse"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType>
+ <wsdl:portType name="BService2PortType">
+ <wsdl:operation name="getString">
+ <wsdl:input message="tns:getStringRequest"></wsdl:input> + <wsdl:output message="tns:getStringResponse"></wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <wsdl:input message="tns:getIntRequest"></wsdl:input> + <wsdl:output message="tns:getIntResponse"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="BService1SOAPBinding"
+ type="tns:BService1PortType">
<soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getString">
<soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString" />
<wsdl:input>
<soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
<soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString2" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getInt"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getInt" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding>
+ <wsdl:binding name="BService2SOAPBinding"
+ type="tns:BService2PortType">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="getString"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getInt" /> + <wsdl:input> + <soap:body use="literal" />
+ </wsdl:input> + <wsdl:output> + <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation> + </wsdl:binding> + <wsdl:binding name="BService3SOAP12Binding"
+ type="tns:BService1PortType">
+ <soap12:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getString">
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getString2">
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getString2" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInt">
+ <soap12:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.bservice/getInt" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="BService">
+ <wsdl:port binding="tns:BService1SOAPBinding" name="BService1SOAP">
+ <soap:address location=""/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="BService2">
+ <wsdl:port name="BService2Port" binding="tns:BService2SOAPBinding">
+ <soap:address location="" />
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="BService3">
+ <wsdl:port name="BService3SOAP12" binding="tns:BService3SOAP12Binding">
+ <soap12:address location=""></soap12:address> + </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl new file mode 100644 index 0000000000..bdf294b473 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/cservice.wsdl @@ -0,0 +1,173 @@ +<?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.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://vtest.wsbinding.wsdlelement.service.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CService" targetNamespace="http://vtest.wsbinding.wsdlelement.service.cservice">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://vtest.wsbinding.wsdlelement.service.cservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getFloat">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="in" type="xsd:float"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getFloatResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:float"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getInteger">
+ <xsd:complexType>
+ <xsd:sequence>
<xsd:element name="in" type="xsd:integer"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getIntegerResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:integer"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in1" type="xsd:string"></xsd:element> + <xsd:element name="in2" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString2Response"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getString"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="in" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + <xsd:element name="getStringResponse"> + <xsd:complexType> + <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"></xsd:element> + </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element> + </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getFloatRequest">
+ <wsdl:part element="tns:getFloat" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getFloatResponse">
+ <wsdl:part element="tns:getFloatResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="getIntegerRequest">
+ <wsdl:part name="parameters" element="tns:getInteger"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getIntegerResponse"> + <wsdl:part name="parameters" element="tns:getIntegerResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Request"> + <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringRequest"> + <wsdl:part name="parameters" element="tns:getString"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getStringResponse"> + <wsdl:part name="parameters" element="tns:getStringResponse"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Request"> + <wsdl:part name="parameters" element="tns:getString2"></wsdl:part>
+ </wsdl:message> + <wsdl:message name="getString2Response"> + <wsdl:part name="parameters" element="tns:getString2Response"></wsdl:part>
+ </wsdl:message> + <wsdl:portType name="CServicePortType">
+ <wsdl:operation name="getFloat">
+ <wsdl:input message="tns:getFloatRequest"/>
+ <wsdl:output message="tns:getFloatResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getInteger">
+ <wsdl:input message="tns:getIntegerRequest"></wsdl:input> + <wsdl:output message="tns:getIntegerResponse"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString"> + <wsdl:input message="tns:getStringRequest"></wsdl:input> + <wsdl:output message="tns:getStringResponse"></wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString2"> + <wsdl:input message="tns:getString2Request"></wsdl:input> + <wsdl:output message="tns:getString2Response"></wsdl:output>
+ </wsdl:operation> + </wsdl:portType>
+ <wsdl:binding name="CServiceSOAPBinding"
+ type="tns:CServicePortType">
<soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getFloat">
<soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getFloat" />
<wsdl:input>
<soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
<soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getInteger">
+ <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getInteger" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getString" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + <wsdl:operation name="getString2"> + <soap:operation
+ soapAction="http://vtest.wsbinding.wsdlelement.service.cservice/getString2" /> + <wsdl:input>
+ <soap:body use="literal" /> + </wsdl:input> + <wsdl:output>
+ <soap:body use="literal" /> + </wsdl:output>
+ </wsdl:operation> + </wsdl:binding>
+ <wsdl:service name="CService">
+ <wsdl:port binding="tns:CServiceSOAPBinding" name="CServiceSOAP">
+ <soap:address location=""/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite new file mode 100644 index 0000000000..9801ecd037 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/main/resources/wsdlelement.service.composite @@ -0,0 +1,145 @@ +<?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" + targetNamespace="http://vtest.wsbinding.wsdlelement.service" + xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance" + name="wsdlelement.service"> + + <component name="BComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService)" uri="http://localhost:8085/BComponent1"/> + </service> + </component> + + <component name="BComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent2"/> + </service> + </component> + + <component name="BComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BService2Impl"/> + <service name="BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent3"/> + </service> + </component> + + <component name="BComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent4"/> + </service> + </component> + + <component name="BComponent5"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BService2Impl"/> + <service name="BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent5"/> + </service> + </component> + + <component name="BComponent6"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.BServiceImpl"/> + <service name="BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService3)" uri="http://localhost:8085/BComponent6"/> + </service> + </component> + + <component name="CComponent"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.CServiceImpl"/> + <service name="CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.cservice#wsdl.service(CService)" uri="http://localhost:8085/CComponent"/> + </service> + </component> + + <component name="AComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/> + <reference name="b1" target="BComponent1/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService)" uri="http://localhost:8085/BComponent1"/> + </reference> + </component> + + <component name="AComponent2"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/> + <reference name="b1" target="BComponent2/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent2"/> + </reference> + </component> + + <component name="AComponent3"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/> + <reference name="b2" target="BComponent3/BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent3"/> + </reference> + </component> + + <component name="AComponent4"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/> + <reference name="b1" target="BComponent4/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.port(BService/BService1SOAP)" uri="http://localhost:8085/BComponent4"/> + </reference> + <reference name="b2" target="BComponent3/BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService2)" uri="http://localhost:8085/BComponent3"/> + </reference> + <reference name="b3" target="BComponent5/BService2"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService2"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.binding(BService2SOAPBinding)" uri="http://localhost:8085/BComponent5"/> + </reference> + <reference name="b4" target="BComponent6/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService3)" uri="http://localhost:8085/BComponent6"/> + </reference> + </component> + + <component name="AComponent5"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.AServiceImpl"/> + <reference name="b1" target="BComponent6/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService3)" uri="http://localhost:8085/BComponent6"/> + </reference> + </component> + + <component name="DComponent1"> + <implementation.java class="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.impl.DServiceImpl"/> + <reference name="b1" target="BComponent1/BService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.BService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.bservice#wsdl.service(BService)" uri="http://localhost:8085/BComponent1"/> + </reference> + <reference name="c1" target="CComponent/CService"> + <interface.java interface="org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.CService"/> + <binding.ws wsdlElement="http://vtest.wsbinding.wsdlelement.service.cservice#wsdl.service(CService)" uri="http://localhost:8085/CComponent"/> + </reference> + </component> + +</composite> diff --git a/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java new file mode 100644 index 0000000000..22d2a80244 --- /dev/null +++ b/branches/sca-java-1.5/vtest/wsbinding/wsdlelement/service/src/test/java/org/apache/tuscany/sca/vtest/wsbinding/wsdlelement/service/WsdlElementServiceTestCase.java @@ -0,0 +1,235 @@ +/* + * 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.vtest.wsbinding.wsdlelement.service; + +import static org.junit.Assert.fail; +import junit.framework.Assert; + +import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.AService; +import org.apache.tuscany.sca.vtest.wsbinding.wsdlelement.service.DService; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests the simplest form of the binding element wsdl.service with WSDL + * document described in section section 2.1 of SCA Web Services Binding + * V1.00<br> + */ +public class WsdlElementServiceTestCase { + + protected static ServiceFinder serviceFinder; + protected static String compositeName = "wsdlelement.service.composite"; + protected static AService a1; + protected static AService a2; + protected static AService a3; + protected static AService a4; + protected static AService a5; + protected static DService d; + + @BeforeClass + public static void init() throws Exception { + try { + System.out.println("Setting up"); + ServiceFinder.init(compositeName); + a1 = ServiceFinder.getService(AService.class, "AComponent1"); + a2 = ServiceFinder.getService(AService.class, "AComponent2"); + a3 = ServiceFinder.getService(AService.class, "AComponent3"); + a4 = ServiceFinder.getService(AService.class, "AComponent4"); + a5 = ServiceFinder.getService(AService.class, "AComponent5"); + d = ServiceFinder.getService(DService.class, "DComponent1"); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Lines 38-41:<br> + * Service:<br> + * <WSDL-namespace-URI>#wsdl.service(<service-name>)<br> + * In this case, all the endpoints in the WSDL Service that have equivalent + * PortTypes with the SCA service or reference must be available to the SCA + * service or reference.<br> + * <br> + * Tests wsdl.service(BService)<br> + */ + @Test + public void testWsdlElementService1() throws Exception { + String aName = a1.getName(); + String b1Str1 = a1.getB1String("string1"); + String b1Str2 = a1.getB1String2("string2", "string3"); + int b1Int = a1.getB1Int(1000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(1000, b1Int); + } + + /** + * Lines 38-41:<br> + * Service:<br> + * <br> + * Tests wsdl.service(BService2) with with BService where the service + * does not define getString2, so exceptions are expected.<br> + */ + @Test + public void testWsdlElementService2() throws Exception { + String aName = a2.getName(); + System.out.println(aName + ": "); + try { + a2.getB1String("string1"); + fail("Should not be able to call getString"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + try { + a2.getB1String2("string2", "string3"); + fail("Should not be able to call getString2"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + try { + a2.getB1Int(2000); + fail("Should not be able to call getInt"); + } catch (Exception e) { + System.out.println(" Exception is expected: " + e.toString()); + } + } + + /** + * Lines 38-41:<br> + * Service:<br> + * <br> + * Tests wsdl.service(BService2) with BService2<br> + */ + @Test + public void testWsdlElementService3() throws Exception { + String aName = a3.getName(); + String b2Str1 = a3.getB2String("string1"); + int b2Int = a3.getB2Int(1000); + + System.out.println(aName + ": " + b2Str1 + ", " + b2Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b2Str1); + Assert.assertEquals(1000, b2Int); + } + + /** + * Lines 38-41:<br> + * Service:<br> + * <br> + * Tests two references using wsdl.service.<br> + */ + @Test + public void testWsdlElementService4() throws Exception { + String dName = d.getName(); + String b1Str1 = d.getB1String("string1"); + String b1Str2 = d.getB1String2("string2", "string3"); + String c1Str1 = d.getC1String("string5"); + String c1Str2 = d.getC1String2("string6", "string7"); + + int b1Int = d.getB1Int(4000); + float c1Float = d.getC1Float((float) 8.8); + + Integer c1Integer = d.getC1Integer(new Integer(9000)); + + System.out.println(dName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int + ", " + c1Str1 + ", " + c1Str2 + ", " + c1Float + ", " + c1Integer); + Assert.assertEquals("DService", dName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(4000, b1Int); + Assert.assertEquals("string5", c1Str1); + Assert.assertEquals("string6string7", c1Str2); + Assert.assertEquals((float) 8.8, c1Float); + Assert.assertEquals(new Integer(9000), c1Integer); + } + + /** + * Lines 38-41:<br> + * Service:<br> + * <br> + * Tests mixed bindings of using wsdl.port, wsdl.service, wsdl.binding, + * and soap 1.2 + * <br> + */ + @Test + public void testWsdlElementService5() throws Exception { + String aName = a4.getName(); + String b1Str1 = a4.getB1String("port"); + String b1Str2 = a4.getB1String2("string1", "string2"); + int b1Int = a4.getB1Int(1000); + System.out.println(aName); + System.out.println(" b1: " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("port", b1Str1); + Assert.assertEquals("string1string2", b1Str2); + Assert.assertEquals(1000, b1Int); + + String b2Str1 = a4.getB2String("service"); + int b2Int = a4.getB2Int(2000); + System.out.println(" b2: " + b2Str1 + ", " + b2Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("service", b2Str1); + Assert.assertEquals(2000, b2Int); + + String b3Str1 = a4.getB3String("binding"); + int b3Int = a4.getB3Int(3000); + System.out.println(" b3: " + b3Str1 + ", " + b3Int); + Assert.assertEquals("binding", b3Str1); + Assert.assertEquals(3000, b3Int); + + String b4Str1 = a4.getB4String("soap12"); + String b4Str2 = a4.getB4String2("string3", "string4"); + int b4Int = a4.getB4Int(4000); + System.out.println(" b4: " + b4Str1 + ", " + b4Str2 + ", " + b4Int); + Assert.assertEquals("soap12", b4Str1); + Assert.assertEquals("string3string4", b4Str2); + Assert.assertEquals(4000, b4Int); + + } + + /** + * Lines 38-41:<br> + * Service:<br> + * <br> + * Tests wsdl.service(BService3) which uses SOAP 1.2<br> + */ + @Test + public void testWsdlElementService6() throws Exception { + String aName = a5.getName(); + String b1Str1 = a5.getB1String("string1"); + String b1Str2 = a5.getB1String2("string2", "string3"); + int b1Int = a5.getB1Int(6000); + + System.out.println(aName + ": " + b1Str1 + ", " + b1Str2 + ", " + b1Int); + Assert.assertEquals("AService", aName); + Assert.assertEquals("string1", b1Str1); + Assert.assertEquals("string2string3", b1Str2); + Assert.assertEquals(6000, b1Int); + } + + @AfterClass + public static void destroy() throws Exception { + System.out.println("Cleaning up"); + ServiceFinder.cleanup(); + } +} |