From 01c85123402a1c9e7a0c777657fd46845c859d6d Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 9 Oct 2010 17:51:01 +0000 Subject: 2.0-M5.1 RC2 release tag git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1006201 13f79535-47bb-0310-9956-ffa450edef68 --- .../itest/ws/authentication-basic/pom.xml | 47 ++++++++ .../binding/ws/axis2/helloworld/HelloWorld.java | 29 +++++ .../ws/axis2/helloworld/HelloWorldClient.java | 35 ++++++ .../ws/axis2/helloworld/HelloWorldService.java | 45 ++++++++ .../main/resources/META-INF/sca-contribution.xml | 23 ++++ ....apache.tuscany.sca.definitions.xml.Definitions | 17 +++ .../binding/ws/axis2/helloworld/definitions.xml | 46 ++++++++ .../ws/axis2/helloworld/helloworld.composite | 45 ++++++++ .../binding/ws/axis2/helloworld/helloworld.wsdl | 90 +++++++++++++++ .../sca/binding/ws/axis2/HelloworldTestCase.java | 50 ++++++++ .../tags/2.0-M5.1-RC2/itest/ws/defaults/pom.xml | 47 ++++++++ .../apache/tuscany/sca/binding/ws/axis2/Bar.java | 58 ++++++++++ .../apache/tuscany/sca/binding/ws/axis2/Foo.java | 36 ++++++ .../tuscany/sca/binding/ws/axis2/HelloWorld.java | 29 +++++ .../sca/binding/ws/axis2/HelloWorldClient.java | 40 +++++++ .../sca/binding/ws/axis2/HelloWorldService.java | 42 +++++++ .../main/resources/META-INF/sca-contribution.xml | 23 ++++ .../sca/binding/ws/axis2/helloworld.composite | 41 +++++++ .../tuscany/sca/binding/ws/axis2/helloworld.wsdl | 90 +++++++++++++++ .../sca/binding/ws/axis2/DefaultsTestCase.java | 74 ++++++++++++ .../itest/ws/endpoint-references/pom.xml | 47 ++++++++ .../tuscany/sca/binding/ws/axis2/HelloWorld.java | 29 +++++ .../sca/binding/ws/axis2/HelloWorldComponent.java | 33 ++++++ .../sca/binding/ws/axis2/HelloWorldService.java | 28 +++++ .../sca/binding/ws/axis2/HelloWorld.composite | 48 ++++++++ .../tuscany/sca/binding/ws/axis2/helloworld.wsdl | 86 ++++++++++++++ .../sca/binding/ws/axis2/HelloWorldTestCase.java | 52 +++++++++ .../tags/2.0-M5.1-RC2/itest/ws/endpoints/pom.xml | 47 ++++++++ .../binding/ws/axis2/HelloWorldMultiService.java | 51 +++++++++ .../tuscany/sca/binding/ws/axis2/HelloWorldOM.java | 30 +++++ .../sca/binding/ws/axis2/HelloWorldOM2.java | 30 +++++ .../binding/ws/axis2/HelloWorldOMComponent.java | 34 ++++++ .../sca/binding/ws/axis2/HelloWorldOMService.java | 41 +++++++ .../binding/ws/axis2/DefaultMultiService.composite | 53 +++++++++ .../ws/axis2/DefaultSingleService.composite | 51 +++++++++ .../sca/binding/ws/axis2/WSDLExplicitURI.composite | 50 ++++++++ .../sca/binding/ws/axis2/WSDLRelativeURI.composite | 51 +++++++++ .../ws/axis2/helloworld-om-relative-uri.wsdl | 78 +++++++++++++ .../sca/binding/ws/axis2/helloworld-om-uri.wsdl | 78 +++++++++++++ .../sca/binding/ws/axis2/helloworld-om.wsdl | 78 +++++++++++++ .../ws/axis2/AbstractHelloWorldOMTestCase.java | 68 +++++++++++ .../ws/axis2/DefaultMultiServiceTestCase.java | 24 ++++ .../ws/axis2/DefaultSingleServiceTestCase.java | 24 ++++ .../binding/ws/axis2/WSDLExplicitURITestCase.java | 24 ++++ .../binding/ws/axis2/WSDLRelativeURITestCase.java | 24 ++++ .../tags/2.0-M5.1-RC2/itest/ws/http-ssl/README | 68 +++++++++++ .../tags/2.0-M5.1-RC2/itest/ws/http-ssl/pom.xml | 52 +++++++++ .../binding/ws/axis2/helloworld/HelloWorld.java | 29 +++++ .../ws/axis2/helloworld/HelloWorldClient.java | 35 ++++++ .../ws/axis2/helloworld/HelloWorldService.java | 30 +++++ .../main/resources/META-INF/sca-contribution.xml | 23 ++++ ....apache.tuscany.sca.definitions.xml.Definitions | 17 +++ .../binding/ws/axis2/helloworld/definitions.xml | 35 ++++++ .../ws/axis2/helloworld/helloworld.composite | 59 ++++++++++ .../binding/ws/axis2/helloworld/helloworld.wsdl | 90 +++++++++++++++ .../sca/binding/ws/axis2/helloworld/tuscany.jks | Bin 0 -> 1378 bytes .../sca/binding/ws/axis2/HTTPSTestCase.java | 57 ++++++++++ sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/pom.xml | 48 ++++++++ .../tags/2.0-M5.1-RC2/itest/ws/wsdl/pom.xml | 47 ++++++++ .../tuscany/sca/binding/ws/axis2/Account.java | 34 ++++++ .../sca/binding/ws/axis2/AccountService.java | 33 ++++++ .../sca/binding/ws/axis2/CustomerProfileData.java | 103 +++++++++++++++++ .../tuscany/sca/binding/ws/axis2/HelloWorld.java | 29 +++++ .../tuscany/sca/binding/ws/axis2/HelloWorldOM.java | 30 +++++ .../binding/ws/axis2/HelloWorldOMComponent.java | 34 ++++++ .../sca/binding/ws/axis2/HelloWorldOMService.java | 41 +++++++ .../sca/binding/ws/axis2/HelloWorldService.java | 28 +++++ .../tuscany/sca/binding/ws/axis2/customerdata.xsd | 36 ++++++ .../tuscany/sca/binding/ws/axis2/customerdefs.xsd | 27 +++++ .../tuscany/sca/binding/ws/axis2/customerinfo.xsd | 31 +++++ .../ws/axis2/helloworld-om-merged.composite | 43 +++++++ .../sca/binding/ws/axis2/helloworld-om-merged.wsdl | 59 ++++++++++ .../sca/binding/ws/axis2/helloworld-prec.composite | 46 ++++++++ .../sca/binding/ws/axis2/helloworld-prec.wsdl | 81 +++++++++++++ .../tuscany/sca/binding/ws/axis2/helloworld.wsdl | 86 ++++++++++++++ .../ws/axis2/questionmark-import-nested.wsdl | 70 ++++++++++++ .../sca/binding/ws/axis2/questionmark-import.wsdl | 49 ++++++++ .../sca/binding/ws/axis2/questionmark-include.wsdl | 94 +++++++++++++++ .../ws/axis2/questionmark-wsdl-import.composite | 31 +++++ .../ws/axis2/questionmark-wsdl-include.composite | 31 +++++ .../binding/ws/axis2/questionmark-wsdl.composite | 33 ++++++ .../ws/axis2/HelloWorldWSDLMergedTestCase.java | 62 ++++++++++ .../ws/axis2/QuestionMarkWSDLImportTestCase.java | 99 ++++++++++++++++ .../ws/axis2/QuestionMarkWSDLIncludeTestCase.java | 98 ++++++++++++++++ .../binding/ws/axis2/QuestionMarkWSDLTestCase.java | 126 +++++++++++++++++++++ .../binding/ws/axis2/UriPrecedenceTestCase.java | 73 ++++++++++++ 86 files changed, 4163 insertions(+) create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/README create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/UriPrecedenceTestCase.java (limited to 'sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws') diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/pom.xml new file mode 100644 index 0000000000..5383a7f36f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + + itest-ws-authentication-basic + Apache Tuscany SCA iTest WS with Authentication Basic + + + + + org.apache.tuscany.sca + tuscany-feature-webservice + 2.0-M5.1 + pom + + + + + + + ${artifactId} + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java new file mode 100644 index 0000000000..98eb6e361b --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.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.binding.ws.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorld { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..2c6c4fc92c --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.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.binding.ws.axis2.helloworld; + +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClient implements HelloWorld { + + @Reference + public HelloWorld helloWorldWS; + + public String getGreetings(String s) { + String response = helloWorldWS.getGreetings(s); + System.out.println("At client: " + response); + return response; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..885844260a --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.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.binding.ws.axis2.helloworld; + +import javax.security.auth.Subject; + +import org.oasisopen.sca.RequestContext; +import org.oasisopen.sca.annotation.Context; + +public class HelloWorldService implements HelloWorld { + + @Context + protected RequestContext requestContext; + + public String getGreetings(String name) { + Subject subject = requestContext.getSecuritySubject(); + String response = "Hello " + name + " "; + + if (subject == null){ + response += "null subject"; + } else { + response += subject.getPrincipals().iterator().next().getName(); + } + + System.out.println("At service: " + response); + return response; + } +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7e71dd465f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions new file mode 100644 index 0000000000..04fe620be4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions @@ -0,0 +1,17 @@ +# 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. +org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml new file mode 100644 index 0000000000..d4e651b271 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml @@ -0,0 +1,46 @@ + + + + + + + + myname + mypassword + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite new file mode 100644 index 0000000000..166565baa0 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + http://localhost:8085/services/HelloWorldWebService1 + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl new file mode 100644 index 0000000000..a352696b8e --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java new file mode 100644 index 0000000000..ef307f58bb --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.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.binding.ws.axis2; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorld; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public class HelloworldTestCase extends TestCase { + + private Node node; + private HelloWorld helloWorld; + + public void testCalculator() throws Exception { + assertEquals("Hello fred myname", helloWorld.getGreetings("fred")); + } + + @Override + protected void setUp() throws Exception { + node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes")); + node.start(); + helloWorld = node.getService(HelloWorld.class, "HelloWorldClient"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/pom.xml new file mode 100644 index 0000000000..1b8ed1833f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + + itest-ws-defaults + Apache Tuscany SCA iTest WS with Defaults + + + + + org.apache.tuscany.sca + tuscany-feature-webservice + 2.0-M5.1 + pom + + + + + + + ${artifactId} + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java new file mode 100644 index 0000000000..a1233f6d25 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import java.io.Serializable; + +public class Bar implements Serializable { + private static final long serialVersionUID = 1249963611910502668L; + + private String s; + private int x; + private Integer y; + + private Boolean b; + + public Boolean getB() { + return b; + } + public void setB(Boolean b) { + this.b = b; + } + public String getS() { + return s; + } + public void setS(String s) { + this.s = s; + } + public int getX() { + return x; + } + public void setX(int x) { + this.x = x; + } + public Integer getY() { + return y; + } + public void setY(Integer y) { + this.y = y; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java new file mode 100644 index 0000000000..0695ace7f4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import java.io.Serializable; + +public class Foo implements Serializable { + private static final long serialVersionUID = 4879476066850018458L; + + private Bar[] bars; + + public Bar[] getBars() { + return bars; + } + + public void setBars(Bar[] bars) { + this.bars = bars; + } +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java new file mode 100644 index 0000000000..f39566ccbf --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.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.binding.ws.axis2; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorld { + + String getGreetings(String s); + Foo getGreetingsComplex(Foo foo); +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java new file mode 100644 index 0000000000..332f825a51 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.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.binding.ws.axis2; + +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClient implements HelloWorld { + + @Reference + public HelloWorld helloWorldWS; + + public String getGreetings(String s) { + String response = helloWorldWS.getGreetings(s); + System.out.println("At client: " + response); + return response; + } + + public Foo getGreetingsComplex(Foo foo){ + Foo response = helloWorldWS.getGreetingsComplex(foo); + System.out.println("At client: " + response.getBars()[0].getS()); + return response; + } +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java new file mode 100644 index 0000000000..3bbf50a728 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class HelloWorldService implements HelloWorld { + + public String getGreetings(String s) { + String response = "Hello " + s; + System.out.println("At service: " + response); + return response; + } + + public Foo getGreetingsComplex(Foo foo){ + Foo response = foo; + Bar b3 = new Bar(); + b3.setS("simon"); + b3.setX(4); + b3.setY(new Integer(5)); + b3.setB(Boolean.TRUE); + response.getBars()[1] = b3; + System.out.println("At sevice: " + response.getBars()[0].getS()); + return response; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7e71dd465f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite new file mode 100644 index 0000000000..cae74697f1 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl new file mode 100644 index 0000000000..a352696b8e --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java new file mode 100644 index 0000000000..1e4c1fcbff --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.binding.ws.axis2.HelloWorld; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public class DefaultsTestCase extends TestCase { + + private Node node; + private HelloWorld helloWorld; + + @Override + protected void setUp() throws Exception { + node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes")); + node.start(); + helloWorld = node.getService(HelloWorld.class, "HelloWorldClient"); + } + + public void testCalculator() throws Exception { + assertEquals("Hello petra", helloWorld.getGreetings("petra")); + + Foo f = new Foo(); + Bar b1 = new Bar(); + b1.setS("petra"); + b1.setX(1); + b1.setY(new Integer(2)); + b1.setB(Boolean.TRUE); + Bar b2 = new Bar(); + b2.setS("beate"); + b2.setX(3); + b2.setY(new Integer(4)); + b2.setB(Boolean.FALSE); + f.setBars(new Bar[] { b1, b2} ); + + Foo f2 = helloWorld.getGreetingsComplex(f); + + assertEquals("petra", f2.getBars()[0].getS()); + assertEquals(1, f2.getBars()[0].getX()); + assertEquals(2, f2.getBars()[0].getY().intValue()); + assertTrue(f2.getBars()[0].getB().booleanValue()); + assertEquals("simon", f2.getBars()[1].getS()); + assertEquals(4, f2.getBars()[1].getX()); + assertEquals(5, f2.getBars()[1].getY().intValue()); + assertTrue(f2.getBars()[1].getB().booleanValue()); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/pom.xml new file mode 100644 index 0000000000..1e250ed0df --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + + itest-ws-endpoint-references + Apache Tuscany SCA iTest WS Endpoint References + + + + + org.apache.tuscany.sca + tuscany-feature-webservice + 2.0-M5.1 + pom + + + + + + + ${artifactId} + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java new file mode 100644 index 0000000000..d6db1c2d0b --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.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.binding.ws.axis2; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorld { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java new file mode 100644 index 0000000000..4ba7e67de2 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.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.binding.ws.axis2; + +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldComponent implements HelloWorld { + + @Reference + public HelloWorld helloWorldWS; + + public String getGreetings(String s) { + return helloWorldWS.getGreetings(s); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java new file mode 100644 index 0000000000..052b49ff55 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class HelloWorldService implements HelloWorld { + + public String getGreetings(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite new file mode 100644 index 0000000000..1b0af55874 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + http://localhost:8085/myService + + + + + + + + + + + http://localhost:8085/myService + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl new file mode 100644 index 0000000000..1a2272d7ee --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java new file mode 100644 index 0000000000..f1cfe30475 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.binding.ws.axis2.HelloWorld; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public class HelloWorldTestCase extends TestCase { + + private Node node; + private HelloWorld helloWorld; + + public void testCalculator() throws Exception { + assertEquals("Hello petra", helloWorld.getGreetings("petra")); + } + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite", new Contribution("test", contribution)); + node.start(); + helloWorld = node.getService(HelloWorld.class, "HelloWorldComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/pom.xml new file mode 100644 index 0000000000..5886e93df1 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + + itest-ws-endpoints + Apache Tuscany SCA iTest WS Endpoints + + + + + org.apache.tuscany.sca + tuscany-feature-webservice + 2.0-M5.1 + pom + + + + + + + ${artifactId} + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java new file mode 100644 index 0000000000..8f77c63213 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.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.binding.ws.axis2; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; + +public class HelloWorldMultiService implements HelloWorldOM, HelloWorldOM2 { + + public OMElement getGreetings(OMElement requestOM) { + String name = requestOM.getFirstElement().getText(); + + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); + OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); + responseOM.addChild(param); + param.addChild(omFactory.createOMText("Hello " + name)); + + return responseOM; + } + + public OMElement getGreetings2(OMElement requestOM) { + String name = requestOM.getFirstElement().getText(); + + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); + OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); + responseOM.addChild(param); + param.addChild(omFactory.createOMText("Hello2 " + name)); + + return responseOM; + } +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java new file mode 100644 index 0000000000..e248815805 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldOM { + + OMElement getGreetings(OMElement parmE); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java new file mode 100644 index 0000000000..9d0a4ce5b4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldOM2 { + + OMElement getGreetings2(OMElement parmE); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java new file mode 100644 index 0000000000..8439696fa8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldOMComponent implements HelloWorldOM { + + @Reference + public HelloWorldOM helloWorldWS; + + public OMElement getGreetings(OMElement om) { + return helloWorldWS.getGreetings(om); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java new file mode 100644 index 0000000000..5b8578c816 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; + +public class HelloWorldOMService implements HelloWorldOM { + + public OMElement getGreetings(OMElement requestOM) { + System.out.println(" **** getGreetings **** "); + String name = requestOM.getFirstElement().getText(); + + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); + OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); + responseOM.addChild(param); + param.addChild(omFactory.createOMText("Hello " + name)); + + return responseOM; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite new file mode 100644 index 0000000000..c7863a5ff8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite new file mode 100644 index 0000000000..63c6a89cfb --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite new file mode 100644 index 0000000000..9991a415f9 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite new file mode 100644 index 0000000000..1ea7ab5a36 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl new file mode 100644 index 0000000000..fe68755c47 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl new file mode 100644 index 0000000000..baa223f41c --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl new file mode 100644 index 0000000000..73ca02246d --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java new file mode 100644 index 0000000000..bad94bbbc3 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.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.binding.ws.axis2; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMText; +import org.apache.tuscany.sca.binding.ws.axis2.HelloWorldOM; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public abstract class AbstractHelloWorldOMTestCase extends TestCase { + + private Node node; + private HelloWorldOM helloWorld; + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode(getCompositeName(), new Contribution("test", contribution)); + node.start(); + helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent"); + } + + public void testCalculator() throws Exception { + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld"); + OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld"); + requestOM.addChild(parmE); + parmE.addChild(fac.createOMText("petra")); + OMElement responseOM = helloWorld.getGreetings(requestOM); + OMElement child = (OMElement)responseOM.getFirstElement(); + Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + + protected String getCompositeName() { + String className = this.getClass().getName(); + return className.substring(0, className.length() - 8).replace('.', '/') + ".composite"; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java new file mode 100644 index 0000000000..4ecf016e5a --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class DefaultMultiServiceTestCase extends AbstractHelloWorldOMTestCase { + // super class does it all getting composite based on this class name +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java new file mode 100644 index 0000000000..13163d62ab --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class DefaultSingleServiceTestCase extends AbstractHelloWorldOMTestCase { + // super class does it all getting composite based on this class name +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java new file mode 100644 index 0000000000..bb492557d4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class WSDLExplicitURITestCase extends AbstractHelloWorldOMTestCase { + // super class does it all getting composite based on this class name +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java new file mode 100644 index 0000000000..e038cc3116 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class WSDLRelativeURITestCase extends AbstractHelloWorldOMTestCase { + // super class does it all getting composite based on this class name +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/README b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/README new file mode 100644 index 0000000000..41dcb8680b --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/README @@ -0,0 +1,68 @@ +The module tests web service communications running over HTTPS. HTTPS is configured +in this embedded test environment by adding the confidentiality intent to both +reference and service and by configuring reference and service side policy sets +to configure the web service binding appropriately to enable SSL. + +When running the web service binding in a container that itself is configured +to provide SSL support these policy sets are not required. TODO can they themselves +detect that they are not required. + +The SSL configuration depends on public/private key pairs and a keystore. This is how +they are organized and generated + + +Generate Private/Public keys into a keystore for use at the server +------------------------------------------------------------------ + +keytool -genkey -keyalg RSA -sigalg MD5withRSA -keysize 1024 -alias TuscanyUser -dname "CN=Tuscany Service, OU=Tuscany, O=Apache, L=Hursley, S=Hampshire, C=UK" -storetype JKS -keystore tuscany.jks -validity 9999 -keypass tuscany -storepass tuscany + +View the contents of the key store that result +---------------------------------------------- + +keytool -list -v -keystore tuscany.jks -storepass tuscany + +Keystore type: JKS +Keystore provider: SUN + +Your keystore contains 1 entry + +Alias name: tuscanyuser +Creation date: 26-Feb-2010 +Entry type: PrivateKeyEntry +Certificate chain length: 1 +Certificate[1]: +Owner: CN=Tuscany Service, OU=Tuscany, O=Apache, L=Hursley, ST=Hampshire, C=UK +Issuer: CN=Tuscany Service, OU=Tuscany, O=Apache, L=Hursley, ST=Hampshire, C=UK +Serial number: 4b87b4d7 +Valid from: Fri Feb 26 11:47:35 GMT 2010 until: Mon Jul 13 12:47:35 BST 2037 +Certificate fingerprints: + MD5: C3:0C:D6:DF:F6:27:26:47:AD:41:44:CA:D7:98:FA:41 + SHA1: 2E:82:AD:F6:54:E0:C6:A5:47:5C:8C:9F:3B:5A:65:8E:F9:5A:40:07 + Signature algorithm name: MD5withRSA + Version: 3 + + +IN THIS EMBEDDED TEST THE FOLLOWING ARE NOT REQUIRED AS BOTH REFERENCE AND SERVICES +ARE RUNNING IN THE SAME JVM AND HAVE ACCESS TO THE SERVICE SIDE KEY STORE + +Generate the client side certificate +------------------------------------ + +keytool -export -alias TuscanyUser -file tuscany.cer -keystore tuscany.jks -storepass tuscany + +Print the contents of the generated certificate file +---------------------------------------------------- + +keytool -printcert -v -file tuscany.cer + +Owner: CN=Tuscany Service, OU=Tuscany, O=Apache, L=Hursley, ST=Hampshire, C=UK +Issuer: CN=Tuscany Service, OU=Tuscany, O=Apache, L=Hursley, ST=Hampshire, C=UK +Serial number: 4b87b4d7 +Valid from: Fri Feb 26 11:47:35 GMT 2010 until: Mon Jul 13 12:47:35 BST 2037 +Certificate fingerprints: + MD5: C3:0C:D6:DF:F6:27:26:47:AD:41:44:CA:D7:98:FA:41 + SHA1: 2E:82:AD:F6:54:E0:C6:A5:47:5C:8C:9F:3B:5A:65:8E:F9:5A:40:07 + Signature algorithm name: MD5withRSA + Version: 3 + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/pom.xml new file mode 100644 index 0000000000..b9d6acca36 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/pom.xml @@ -0,0 +1,52 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + + itest-ws-http-ssl + Apache Tuscany SCA iTest WS HTTP SSL + + + + + org.apache.tuscany.sca + tuscany-feature-webservice + 2.0-M5.1 + pom + + + + org.apache.tuscany.sca + tuscany-policy-security + 2.0-M5.1 + + + + + + ${artifactId} + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java new file mode 100644 index 0000000000..98eb6e361b --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.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.binding.ws.axis2.helloworld; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorld { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java new file mode 100644 index 0000000000..2c6c4fc92c --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.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.binding.ws.axis2.helloworld; + +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldClient implements HelloWorld { + + @Reference + public HelloWorld helloWorldWS; + + public String getGreetings(String s) { + String response = helloWorldWS.getGreetings(s); + System.out.println("At client: " + response); + return response; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..3662007984 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2.helloworld; + +public class HelloWorldService implements HelloWorld { + + public String getGreetings(String s) { + String response = "Hello " + s; + System.out.println("At service: " + response); + return response; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7e71dd465f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions new file mode 100644 index 0000000000..04fe620be4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions @@ -0,0 +1,17 @@ +# 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. +org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml new file mode 100644 index 0000000000..d7251590ba --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite new file mode 100644 index 0000000000..aa21221b30 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl new file mode 100644 index 0000000000..a352696b8e --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks new file mode 100644 index 0000000000..d67bccdf8b Binary files /dev/null and b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks differ diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java new file mode 100644 index 0000000000..2fc448aacc --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorld; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public class HTTPSTestCase extends TestCase { + + private Node node; + private HelloWorld helloWorld; + private HelloWorld helloWorld2; + private HelloWorld helloWorld3; + + @Override + protected void setUp() throws Exception { + node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes")); + node.start(); + helloWorld = node.getService(HelloWorld.class, "HelloWorldClient"); + helloWorld2 = node.getService(HelloWorld.class, "HelloWorldClient2"); + helloWorld3 = node.getService(HelloWorld.class, "HelloWorldClient3"); + } + + public void testCalculator() throws Exception { + assertEquals("Hello petra", helloWorld.getGreetings("petra")); + assertEquals("Hello petra", helloWorld2.getGreetings("petra")); + // TODO - check policy matching for unconfigure reference + //assertEquals("Hello petra", helloWorld3.getGreetings("petra")); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/pom.xml new file mode 100644 index 0000000000..ee9553f553 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/pom.xml @@ -0,0 +1,48 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + pom + itest-ws + Apache Tuscany SCA iTest WS + + + defaults + authentication-basic + http-ssl + wsdl + endpoints + endpoint-references + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/pom.xml b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/pom.xml new file mode 100644 index 0000000000..d1d0436bea --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M5.1 + ../pom.xml + + + itest-ws-wsdl + Apache Tuscany SCA iTest WS WSDL + + + + + org.apache.tuscany.sca + tuscany-feature-webservice + 2.0-M5.1 + pom + + + + + + + ${artifactId} + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java new file mode 100644 index 0000000000..963712c0c2 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +@Remotable +public interface Account { + + CustomerProfileData getCustomerProfile(String loginID); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java new file mode 100644 index 0000000000..ab5fc0f873 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.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.binding.ws.axis2; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class AccountService implements Account { + + public CustomerProfileData getCustomerProfile(String loginID) { + return new CustomerProfileData(loginID); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java new file mode 100644 index 0000000000..2574788dfa --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class CustomerProfileData { + + private String firstName; + private String lastName; + private String address; + private String email; + private String loginID; + private String password; + private int id; + + public CustomerProfileData(String loginID) { + firstName = "John"; + lastName = "Doe"; + address = "345 Main Street"; + email = "john@doe.org"; + this.loginID = loginID; + password = "hello"; + id = 1234; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getLoginID() { + return loginID; + } + + public void setLoginID(String loginID) { + this.loginID = loginID; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java new file mode 100644 index 0000000000..d6db1c2d0b --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.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.binding.ws.axis2; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorld { + + String getGreetings(String s); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java new file mode 100644 index 0000000000..e248815805 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloWorldOM { + + OMElement getGreetings(OMElement parmE); + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java new file mode 100644 index 0000000000..8439696fa8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMElement; +import org.oasisopen.sca.annotation.Reference; + +public class HelloWorldOMComponent implements HelloWorldOM { + + @Reference + public HelloWorldOM helloWorldWS; + + public OMElement getGreetings(OMElement om) { + return helloWorldWS.getGreetings(om); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java new file mode 100644 index 0000000000..5b8578c816 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; + +public class HelloWorldOMService implements HelloWorldOM { + + public OMElement getGreetings(OMElement requestOM) { + System.out.println(" **** getGreetings **** "); + String name = requestOM.getFirstElement().getText(); + + OMFactory omFactory = OMAbstractFactory.getOMFactory(); + OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); + OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); + responseOM.addChild(param); + param.addChild(omFactory.createOMText("Hello " + name)); + + return responseOM; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java new file mode 100644 index 0000000000..052b49ff55 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +public class HelloWorldService implements HelloWorld { + + public String getGreetings(String s) { + return "Hello " + s; + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd new file mode 100644 index 0000000000..421d5d6166 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd new file mode 100644 index 0000000000..24cf3eebad --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd new file mode 100644 index 0000000000..b78909142f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite new file mode 100644 index 0000000000..c520d2e3b2 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl new file mode 100644 index 0000000000..29be66fb71 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.composite new file mode 100644 index 0000000000..affe6addbe --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.composite @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.wsdl new file mode 100644 index 0000000000..5908c43e7d --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.wsdl @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl new file mode 100644 index 0000000000..1a2272d7ee --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl new file mode 100644 index 0000000000..686b08a1d4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl new file mode 100644 index 0000000000..105c82a411 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl new file mode 100644 index 0000000000..4b6f982c26 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite new file mode 100644 index 0000000000..aca50f466a --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite new file mode 100644 index 0000000000..9f84fab262 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite new file mode 100644 index 0000000000..b57d5f5b54 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java new file mode 100644 index 0000000000..b79ee7d254 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.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.binding.ws.axis2; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMText; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +public class HelloWorldWSDLMergedTestCase extends TestCase { + + private Node node; + private HelloWorldOM helloWorld; + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite", new Contribution("test", contribution)); + node.start(); + helloWorld = node.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent"); + } + + public void testHelloWorld() throws Exception { + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld"); + OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld"); + requestOM.addChild(parmE); + parmE.addChild(fac.createOMText("petra")); + OMElement responseOM = helloWorld.getGreetings(requestOM); + OMElement child = (OMElement)responseOM.getFirstElement(); + Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java new file mode 100644 index 0000000000..1814e2cc7f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.List; + +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.soap.SOAPAddress; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class QuestionMarkWSDLImportTestCase extends TestCase { + + private Node node; + + /** + * Tests ?wsdl works and returns the correct port endpoint from the WSDL + */ + public void testWSDLImportPortEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8086/AccountService?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); + wsdlReader.setFeature("javax.wsdl.verbose", false); + wsdlReader.setFeature("javax.wsdl.importDocuments", true); + + Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://account2/AccountService/Account", "AccountService")); + Port port = service.getPort("AccountSoapPort"); + + String endpoint = getEndpoint(port); + // String ip = HttpUtils.getIpAddress(); + assertEquals("http://localhost:8086/AccountService", endpoint); + } + + private String getEndpoint(Port port) { + List wsdlPortExtensions = port.getExtensibilityElements(); + for (final Object extension : wsdlPortExtensions) { + if (extension instanceof SOAPAddress) { + return ((SOAPAddress) extension).getLocationURI(); + } + } + throw new RuntimeException("no SOAPAddress"); + } + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite", new Contribution("test", contribution)); + node.start(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java new file mode 100644 index 0000000000..fb2ba66e6c --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.List; + +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.soap.SOAPAddress; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class QuestionMarkWSDLIncludeTestCase extends TestCase { + + private Node node; + + /** + * Tests ?wsdl works and returns the correct port endpoint from the WSDL + */ + public void testWSDLIncludePortEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8085/AccountService?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); + wsdlReader.setFeature("javax.wsdl.verbose", false); + wsdlReader.setFeature("javax.wsdl.importDocuments", true); + + Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://accounts/AccountService/Account", "AccountService")); + Port port = service.getPort("AccountSoapPort"); + + String endpoint = getEndpoint(port); + assertEquals("http://localhost:8085/AccountService", endpoint); + } + + private String getEndpoint(Port port) { + List wsdlPortExtensions = port.getExtensibilityElements(); + for (final Object extension : wsdlPortExtensions) { + if (extension instanceof SOAPAddress) { + return ((SOAPAddress) extension).getLocationURI(); + } + } + throw new RuntimeException("no SOAPAddress"); + } + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite", new Contribution("test", contribution)); + node.start(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java new file mode 100644 index 0000000000..55c2a4822d --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.List; + +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.soap.SOAPAddress; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; + +/** + * Test ?wsdl works and that the returned WSDL has the correct endpoint + * + * @version $Rev$ $Date$ + */ +public class QuestionMarkWSDLTestCase extends TestCase { + + private Node node; + + /** + * Tests ?wsdl works and returns the correct port endpoint from the WSDL + */ + public void testWSDLPortEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8085/services/HelloWorldWebService2?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); + wsdlReader.setFeature("javax.wsdl.verbose",false); + wsdlReader.setFeature("javax.wsdl.importDocuments",true); + + Definition definition = wsdlReader.readWSDL("http://localhost:8085/services/HelloWorldWebService2?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://helloworld/HelloWorldService/HelloWorld", + "HelloWorldService")); + Port port = service.getPort("HelloWorldSoapPort"); + + String endpoint = getEndpoint(port); + assertEquals("http://localhost:8085/services/HelloWorldWebService", endpoint); + } + + /** + * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI + */ + public void testCustomEndpoint() throws Exception { + InputStream inp = new URL("http://localhost:8085/foo/bar?wsdl").openStream(); + BufferedReader br = new BufferedReader(new InputStreamReader(inp)); + String line; + while((line = br.readLine()) != null) { + System.out.println(line); + } + br.close(); + + WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); + wsdlReader.setFeature("javax.wsdl.verbose",false); + wsdlReader.setFeature("javax.wsdl.importDocuments",true); + + Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl"); + assertNotNull(definition); + Service service = definition.getService(new QName("http://axis2.ws.binding.sca.tuscany.apache.org/", + "HelloWorldService")); + Port port = service.getPort("HelloWorldPort"); + + String endpoint = getEndpoint(port); + // TODO - used to get the real host here but WSDL seems to have localhost in it atm? + assertEquals("http://localhost:8085/foo/bar", endpoint); + } + + protected String getEndpoint(Port port) { + List wsdlPortExtensions = port.getExtensibilityElements(); + for (final Object extension : wsdlPortExtensions) { + if (extension instanceof SOAPAddress) { + return ((SOAPAddress) extension).getLocationURI(); + } + } + throw new RuntimeException("no SOAPAddress"); + } + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite", new Contribution("test", contribution)); + node.start(); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } + +} diff --git a/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/UriPrecedenceTestCase.java b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/UriPrecedenceTestCase.java new file mode 100644 index 0000000000..910f1fa9ef --- /dev/null +++ b/sca-java-2.x/tags/2.0-M5.1-RC2/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/UriPrecedenceTestCase.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.binding.ws.axis2; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMText; +import org.apache.tuscany.sca.node.Contribution; +import org.apache.tuscany.sca.node.ContributionLocationHelper; +import org.apache.tuscany.sca.node.Node; +import org.apache.tuscany.sca.node.NodeFactory; +import org.oasisopen.sca.ServiceRuntimeException; + +/** + * This test verifies that the Endpoint URI specified in the wsdl takes precedence over the URI specified + * in binding. Ref: WS Binding Specification V1.00 - Section 2.1.1 + * + * @version $Rev$ $Date$ + */ +public class UriPrecedenceTestCase extends TestCase { + + private Node node; + private HelloWorldOM helloWorld; + + public void testUriPrecedence() throws Exception { + OMFactory fac = OMAbstractFactory.getOMFactory(); + OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-prec", "helloworld"); + OMElement parmE = fac.createOMElement("name", "http://helloworld-prec", "helloworld"); + requestOM.addChild(parmE); + parmE.addChild(fac.createOMText("petra")); + try { + OMElement responseOM = helloWorld.getGreetings(requestOM); + OMElement child = (OMElement)responseOM.getFirstElement(); + Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); + } catch (ServiceRuntimeException e) { + fail("Endpoint URI from wsdl did not take precedence over URI in binding."); + } + } + + @Override + protected void setUp() throws Exception { + String contribution = "target/classes"; + node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/helloworld-prec.composite", new Contribution("test", contribution)); + node.start(); + helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent"); + } + + @Override + protected void tearDown() throws Exception { + node.stop(); + } +} -- cgit v1.2.3