diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-10 12:37:38 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-10 12:37:38 +0000 |
commit | 7c15e6611d5681311b318db073ac7651a72adf21 (patch) | |
tree | 7da24c44ad327518a97e2cd2b0fa63ea8813e106 /sca-java-1.x/trunk | |
parent | 353403e57d555188c9101348583c76e71d3fcc36 (diff) |
TUSCANY-3778 - changes to demonstrate the issues described in the JIRA. The failing tests are commented out.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1033436 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk')
8 files changed, 368 insertions, 87 deletions
diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java index 04fbe6934a..4ee6056438 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java @@ -23,6 +23,7 @@ import org.osoa.sca.annotations.Reference; import org.osoa.sca.annotations.Service; import yetanotherpackage.DBean; +import yetanotherpackage.HelloWorldException; import anotherpackage.BBean; import anotherpackage.CBean; @@ -64,5 +65,13 @@ public class HelloWorldClientImpl implements HelloWorldService { public String getGreetingsDBean(DBean bean){ return "Hello " + hwService.getGreetingsDBean(bean); - } + } + + public String getGreetingsException(String input) throws HelloWorldException { + return hwService.getGreetingsException(input); + } + + public byte[] getGreetingsByteArray(byte[] input) { + return input; + } } diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java index a92a819aaf..7dc779c930 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java @@ -23,6 +23,7 @@ import javax.jws.WebService; import org.osoa.sca.annotations.Service; import yetanotherpackage.DBean; +import yetanotherpackage.HelloWorldException; import anotherpackage.BBean; import anotherpackage.CBean; @@ -65,5 +66,14 @@ public class HelloWorldImpl implements HelloWorldService { return "Hello " + bean.getField1() + " " + bean.getField2() + " " + bean.getField3().getField1() + " " + bean.getField3().getField2(); - } + } + + public String getGreetingsException(String input) throws HelloWorldException { + throw new HelloWorldException("Hello " + input); + } + + public byte[] getGreetingsByteArray(byte[] input){ + System.out.println(String.valueOf(input)); + return input; + } } diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java index 6b0425d473..f62a998df2 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java @@ -23,6 +23,7 @@ import javax.jws.WebService; import org.osoa.sca.annotations.Remotable; import yetanotherpackage.DBean; +import yetanotherpackage.HelloWorldException; import anotherpackage.BBean; import anotherpackage.CBean; @@ -33,13 +34,20 @@ import anotherpackage.CBean; @WebService @Remotable public interface HelloWorldService { + + // primitives + public String getGreetings(String name); + byte[] getGreetingsByteArray(byte[] input); + String getGreetingsException(String input) throws HelloWorldException; - public String getGreetings(String name); + // beans public String getGreetingsBean(ABean bean); public String getGreetingsBeanArray(ABean[] bean); - //public String getGreetingsBeanVector(Vector<ABean> bean); public String getGreetingsBBean(BBean bean); public String getGreetingsCBean(CBean bean); public String getGreetingsDBean(DBean bean); + + // collections + //public String getGreetingsBeanVector(Vector<ABean> bean); } diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/yetanotherpackage/HelloWorldException.java b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/yetanotherpackage/HelloWorldException.java new file mode 100644 index 0000000000..caf0c357bb --- /dev/null +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/main/java/yetanotherpackage/HelloWorldException.java @@ -0,0 +1,44 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package yetanotherpackage;
+
+public class HelloWorldException extends Exception {
+
+ public HelloWorldException() {
+ }
+
+ public HelloWorldException(String message) {
+ super(message);
+ }
+
+ public HelloWorldException(Throwable cause) {
+ super(cause);
+ }
+
+ public HelloWorldException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+/*
+ public HelloWorldException(String message, String errorCode) {
+ super(message, errorCode);
+ }
+*/
+
+}
diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl b/sca-java-1.x/trunk/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl index 185aa2c649..a8bf30cb65 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl @@ -22,43 +22,74 @@ <wsdl:definitions name="HelloWorldServiceService" targetNamespace="http://helloworld/" xmlns="http://helloworld/" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/"> + xmlns:ns4="http://yetanotherpackage/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/"> <wsdl:types> + <xs:schema targetNamespace="http://test" version="1.0" + xmlns:__nnns="http://helloworld/" xmlns:tns="http://test" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:import namespace="http://helloworld/" /> + <xs:complexType name="aBean"> + <xs:sequence> + <xs:element minOccurs="0" name="field1" type="xs:string" /> + <xs:element minOccurs="0" name="field2" type="xs:string" /> + <xs:element minOccurs="0" name="field3" type="__nnns:bBean" /> + </xs:sequence> + </xs:complexType> + <xs:complexType final="#all" name="aBeanArray"> + <xs:sequence> + <xs:element maxOccurs="unbounded" minOccurs="0" name="item" + nillable="true" type="tns:aBean" /> + </xs:sequence> + </xs:complexType> + </xs:schema> + <xs:schema targetNamespace="http://yetanotherpackage/" + version="1.0" xmlns:tns="http://yetanotherpackage/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="HelloWorldException" type="tns:HelloWorldException" /> + <xs:complexType name="HelloWorldException"> + <xs:sequence> + <xs:element minOccurs="0" name="message" type="xs:string" /> + </xs:sequence> + </xs:complexType> + </xs:schema> <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://helloworld/" xmlns:ns0="http://test" xmlns:tns="http://helloworld/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://test" /> - <xs:element name="getGreetingsBean"> + <xs:element name="getGreetingsByteArrayResponse"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="arg0" nillable="true" - type="ns0:aBean" /> + <xs:element minOccurs="0" name="return" nillable="true" + type="xs:byte" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsDBean"> + <xs:element name="getGreetingsDBeanResponse"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="arg0" nillable="true" - type="tns:dBean" /> + <xs:element minOccurs="0" name="return" nillable="true" + type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetings"> + <xs:element name="getGreetingsResponse"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="arg0" nillable="true" + <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsCBean"> + <xs:element name="getGreetingsBeanResponse"> <xs:complexType> - <xs:sequence/> + <xs:sequence> + <xs:element minOccurs="0" name="return" nillable="true" + type="xs:string" /> + </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsDBeanResponse"> + <xs:element name="getGreetingsBeanArrayResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" nillable="true" @@ -66,31 +97,47 @@ </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsCBeanResponse"> + <xs:element name="getGreetingsBeanArray"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" - type="xs:string" /> + <xs:element maxOccurs="unbounded" minOccurs="0" name="arg0" + nillable="true" type="ns0:aBean" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsBBean"> + <xs:element name="getGreetingsBean"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="arg0" nillable="true" - type="tns:bBean" /> + type="ns0:aBean" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsResponse"> + <xs:element name="getGreetings"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" + <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsBeanResponse"> + <xs:element name="getGreetingsDBean"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="arg0" nillable="true" + type="tns:dBean" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="getGreetingsCBean"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="arg0" nillable="true" + type="" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="getGreetingsCBeanResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" nillable="true" @@ -98,7 +145,7 @@ </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsBeanArrayResponse"> + <xs:element name="getGreetingsExceptionResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" nillable="true" @@ -106,22 +153,39 @@ </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsBBeanResponse"> + <xs:element name="getGreetingsBBean"> <xs:complexType> <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" + <xs:element minOccurs="0" name="arg0" nillable="true" + type="tns:bBean" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="getGreetingsByteArray"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="arg0" nillable="true" + type="xs:byte" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="getGreetingsException"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="getGreetingsBeanArray"> + <xs:element name="getGreetingsBBeanResponse"> <xs:complexType> <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="arg0" - nillable="true" type="ns0:aBean" /> + <xs:element minOccurs="0" name="return" nillable="true" + type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> + <xs:complexType name="bBean"> <xs:sequence> <xs:element minOccurs="0" name="field1" type="xs:string" /> @@ -136,82 +200,86 @@ </xs:sequence> </xs:complexType> </xs:schema> - <xs:schema targetNamespace="http://test" version="1.0" - xmlns:__nnns="http://helloworld/" xmlns:tns="http://test" - xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:import namespace="http://helloworld/" /> - <xs:complexType name="aBean"> - <xs:sequence> - <xs:element minOccurs="0" name="field1" type="xs:string" /> - <xs:element minOccurs="0" name="field2" type="xs:string" /> - <xs:element minOccurs="0" name="field3" type="__nnns:bBean" /> - </xs:sequence> - </xs:complexType> - <xs:complexType final="#all" name="aBeanArray"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="item" - nillable="true" type="tns:aBean" /> - </xs:sequence> - </xs:complexType> - </xs:schema> </wsdl:types> - <wsdl:message name="getGreetingsBean"> - <wsdl:part name="getGreetingsBean" element="getGreetingsBean"> + <wsdl:message name="getGreetingsByteArrayResponse"> + <wsdl:part name="getGreetingsByteArrayResponse" element="getGreetingsByteArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="getGreetingsDBeanResponse"> + <wsdl:part name="getGreetingsDBeanResponse" element="getGreetingsDBeanResponse"> + + </wsdl:part> + </wsdl:message> + <wsdl:message name="HelloWorldException"> + <wsdl:part name="HelloWorldException" element="ns4:HelloWorldException"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="getGreetingsResponse"> + <wsdl:part name="getGreetingsResponse" element="getGreetingsResponse"> + </wsdl:part> + + </wsdl:message> + <wsdl:message name="getGreetingsBeanResponse"> + <wsdl:part name="getGreetingsBeanResponse" element="getGreetingsBeanResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="getGreetingsBeanArrayResponse"> + <wsdl:part name="getGreetingsBeanArrayResponse" element="getGreetingsBeanArrayResponse"> </wsdl:part> </wsdl:message> - <wsdl:message name="getGreetingsDBean"> - <wsdl:part name="getGreetingsDBean" element="getGreetingsDBean"> + <wsdl:message name="getGreetingsBeanArray"> + <wsdl:part name="getGreetingsBeanArray" element="getGreetingsBeanArray"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="getGreetingsBean"> + <wsdl:part name="getGreetingsBean" element="getGreetingsBean"> </wsdl:part> </wsdl:message> <wsdl:message name="getGreetings"> + <wsdl:part name="getGreetings" element="getGreetings"> </wsdl:part> </wsdl:message> + <wsdl:message name="getGreetingsDBean"> + <wsdl:part name="getGreetingsDBean" element="getGreetingsDBean"> + </wsdl:part> + </wsdl:message> <wsdl:message name="getGreetingsCBean"> <wsdl:part name="getGreetingsCBean" element="getGreetingsCBean"> - </wsdl:part> - </wsdl:message> - <wsdl:message name="getGreetingsDBeanResponse"> - <wsdl:part name="getGreetingsDBeanResponse" element="getGreetingsDBeanResponse"> </wsdl:part> </wsdl:message> <wsdl:message name="getGreetingsCBeanResponse"> <wsdl:part name="getGreetingsCBeanResponse" element="getGreetingsCBeanResponse"> </wsdl:part> </wsdl:message> + <wsdl:message name="getGreetingsExceptionResponse"> + <wsdl:part name="getGreetingsExceptionResponse" element="getGreetingsExceptionResponse"> + </wsdl:part> + </wsdl:message> <wsdl:message name="getGreetingsBBean"> <wsdl:part name="getGreetingsBBean" element="getGreetingsBBean"> </wsdl:part> </wsdl:message> - <wsdl:message name="getGreetingsResponse"> - <wsdl:part name="getGreetingsResponse" element="getGreetingsResponse"> + <wsdl:message name="getGreetingsByteArray"> + <wsdl:part name="getGreetingsByteArray" element="getGreetingsByteArray"> </wsdl:part> </wsdl:message> - <wsdl:message name="getGreetingsBeanResponse"> - <wsdl:part name="getGreetingsBeanResponse" element="getGreetingsBeanResponse"> - </wsdl:part> - </wsdl:message> - <wsdl:message name="getGreetingsBeanArrayResponse"> - <wsdl:part name="getGreetingsBeanArrayResponse" element="getGreetingsBeanArrayResponse"> + <wsdl:message name="getGreetingsException"> + <wsdl:part name="getGreetingsException" element="getGreetingsException"> </wsdl:part> </wsdl:message> <wsdl:message name="getGreetingsBBeanResponse"> <wsdl:part name="getGreetingsBBeanResponse" element="getGreetingsBBeanResponse"> - - </wsdl:part> - </wsdl:message> - <wsdl:message name="getGreetingsBeanArray"> - <wsdl:part name="getGreetingsBeanArray" element="getGreetingsBeanArray"> </wsdl:part> </wsdl:message> <wsdl:portType name="HelloWorldService"> + <wsdl:operation name="getGreetings"> <wsdl:input message="getGreetings"> - </wsdl:input> <wsdl:output message="getGreetingsResponse"> </wsdl:output> @@ -219,11 +287,30 @@ <wsdl:operation name="getGreetingsDBean"> <wsdl:input message="getGreetingsDBean"> </wsdl:input> + <wsdl:output message="getGreetingsDBeanResponse"> </wsdl:output> + </wsdl:operation> + <wsdl:operation name="getGreetingsByteArray"> + <wsdl:input message="getGreetingsByteArray"> + </wsdl:input> + <wsdl:output message="getGreetingsByteArrayResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="getGreetingsException"> + <wsdl:input message="getGreetingsException"> + </wsdl:input> + <wsdl:output message="getGreetingsExceptionResponse"> + </wsdl:output> +<!-- TUSCANY-3778 - corrected manually + <wsdl:fault name="HelloWorldException" message="ns4:HelloWorldException"> +--> + <wsdl:fault name="HelloWorldException" message="HelloWorldException"> + </wsdl:fault> </wsdl:operation> <wsdl:operation name="getGreetingsBean"> + <wsdl:input message="getGreetingsBean"> </wsdl:input> <wsdl:output message="getGreetingsBeanResponse"> @@ -231,9 +318,9 @@ </wsdl:operation> <wsdl:operation name="getGreetingsBeanArray"> <wsdl:input message="getGreetingsBeanArray"> - </wsdl:input> <wsdl:output message="getGreetingsBeanArrayResponse"> + </wsdl:output> </wsdl:operation> <wsdl:operation name="getGreetingsBBean"> @@ -241,9 +328,9 @@ </wsdl:input> <wsdl:output message="getGreetingsBBeanResponse"> </wsdl:output> - </wsdl:operation> <wsdl:operation name="getGreetingsCBean"> + <wsdl:input message="getGreetingsCBean"> </wsdl:input> <wsdl:output message="getGreetingsCBeanResponse"> @@ -251,10 +338,10 @@ </wsdl:operation> </wsdl:portType> <wsdl:binding name="HelloWorldServiceBinding" type="HelloWorldService"> - <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getGreetings"> + <SOAP:operation /> <wsdl:input> <SOAP:body use="literal" /> @@ -262,9 +349,9 @@ <wsdl:output> <SOAP:body use="literal" /> </wsdl:output> - </wsdl:operation> <wsdl:operation name="getGreetingsDBean"> + <SOAP:operation /> <wsdl:input> <SOAP:body use="literal" /> @@ -272,9 +359,19 @@ <wsdl:output> <SOAP:body use="literal" /> </wsdl:output> + </wsdl:operation> + <wsdl:operation name="getGreetingsByteArray"> + <SOAP:operation /> + <wsdl:input> + <SOAP:body use="literal" /> + </wsdl:input> + <wsdl:output> + <SOAP:body use="literal" /> + </wsdl:output> </wsdl:operation> - <wsdl:operation name="getGreetingsBean"> + <wsdl:operation name="getGreetingsException"> + <SOAP:operation /> <wsdl:input> <SOAP:body use="literal" /> @@ -282,17 +379,30 @@ <wsdl:output> <SOAP:body use="literal" /> </wsdl:output> + <wsdl:fault name="HelloWorldException"> + <SOAP:fault name="HelloWorldException" use="literal" /> + </wsdl:fault> </wsdl:operation> - <wsdl:operation name="getGreetingsBeanArray"> + <wsdl:operation name="getGreetingsBean"> <SOAP:operation /> <wsdl:input> <SOAP:body use="literal" /> </wsdl:input> <wsdl:output> <SOAP:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="getGreetingsBeanArray"> + <SOAP:operation /> + <wsdl:input> + <SOAP:body use="literal" /> + </wsdl:input> + <wsdl:output> + <SOAP:body use="literal" /> + </wsdl:output> </wsdl:operation> <wsdl:operation name="getGreetingsBBean"> <SOAP:operation /> @@ -301,8 +411,8 @@ </wsdl:input> <wsdl:output> <SOAP:body use="literal" /> - </wsdl:output> + </wsdl:output> </wsdl:operation> <wsdl:operation name="getGreetingsCBean"> <SOAP:operation /> @@ -311,8 +421,8 @@ </wsdl:input> <wsdl:output> <SOAP:body use="literal" /> - </wsdl:output> + </wsdl:output> </wsdl:operation> </wsdl:binding> diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java b/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java index 22f154fbf3..8d1694d1d7 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java @@ -20,9 +20,9 @@ package helloworld; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.fail; import java.io.IOException; -import java.net.HttpURLConnection; import java.net.URL; import javax.xml.namespace.QName; @@ -85,15 +85,16 @@ public class HttpTransportTestCase{ } @Test - public void testComponent1JAXWS() throws IOException { + public void testComponent1JAXWSwsgen() throws IOException { // talk to the service using JAXWS with WSDL generated from this service used wsgen // the idea here is to demonstrate that the service is providing a JAXWS compliant // interface QName serviceName = new QName("http://helloworld/", "HelloWorldImplService"); + QName portName = new QName("http://helloworld/", "HelloWorldImplPort"); URL wsdlLocation = this.getClass().getClassLoader().getResource("wsdl/HelloWorldImplService.wsdl"); Service webService = Service.create( wsdlLocation, serviceName ); - HelloWorldService wsProxy = (HelloWorldService) webService.getPort(HelloWorldService.class); + HelloWorldService wsProxy = (HelloWorldService) webService.getPort(portName, HelloWorldService.class); assertEquals("Hello Fred", wsProxy.getGreetings("Fred")); @@ -107,10 +108,24 @@ public class HttpTransportTestCase{ abean.setField3(bbean); assertEquals("Hello 3 4 1 2", wsProxy.getGreetingsDBean(abean)); +/* TUSCANY-3778 + String byteArrayString = "Hello World"; + assertEquals(byteArrayString, String.valueOf(wsProxy.getGreetingsByteArray(byteArrayString.getBytes()))); - // repeat the JAXWS call with WSDL generated by tuscany - - } + try { + wsProxy.getGreetingsException("Fred"); + fail("exception not returned"); + } catch(Exception ex) { + + } +*/ + } + + @Test + public void testComponent1JAXWStuscanygen() throws IOException { + // repeat the JAXWS call with WSDL generated by tuscany + + } @After public void stopServer() throws Exception { diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl index 5fa0d565b1..157c4a573a 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl @@ -45,7 +45,22 @@ <message name="getGreetingsDBeanResponse"> <part name="parameters" element="tns:getGreetingsDBeanResponse"/> </message> - <portType name="HelloWorldService"> + <message name="getGreetingsException"> + <part name="parameters" element="tns:getGreetingsException"/> + </message> + <message name="getGreetingsExceptionResponse"> + <part name="parameters" element="tns:getGreetingsExceptionResponse"/> + </message> + <message name="HelloWorldException"> + <part name="fault" element="tns:HelloWorldException"/> + </message> + <message name="getGreetingsByteArray"> + <part name="parameters" element="tns:getGreetingsByteArray"/> + </message> + <message name="getGreetingsByteArrayResponse"> + <part name="parameters" element="tns:getGreetingsByteArrayResponse"/> + </message> + <portType name="HelloWorldImpl"> <operation name="getGreetings"> <input message="tns:getGreetings"/> <output message="tns:getGreetingsResponse"/> @@ -70,8 +85,17 @@ <input message="tns:getGreetingsDBean"/> <output message="tns:getGreetingsDBeanResponse"/> </operation> + <operation name="getGreetingsException"> + <input message="tns:getGreetingsException"/> + <output message="tns:getGreetingsExceptionResponse"/> + <fault message="tns:HelloWorldException" name="HelloWorldException"/> + </operation> + <operation name="getGreetingsByteArray"> + <input message="tns:getGreetingsByteArray"/> + <output message="tns:getGreetingsByteArrayResponse"/> + </operation> </portType> - <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldService"> + <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <operation name="getGreetings"> <soap:operation soapAction=""/> @@ -127,6 +151,27 @@ <soap:body use="literal"/> </output> </operation> + <operation name="getGreetingsException"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="HelloWorldException"> + <soap:fault name="HelloWorldException" use="literal"/> + </fault> + </operation> + <operation name="getGreetingsByteArray"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> </binding> <service name="HelloWorldImplService"> <port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding"> diff --git a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd index 446492c371..ad2c2de492 100644 --- a/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd +++ b/sca-java-1.x/trunk/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd @@ -3,6 +3,8 @@ <xs:import namespace="http://test" schemaLocation="HelloWorldImplService_schema1.xsd"/> + <xs:element name="HelloWorldException" type="tns:HelloWorldException"/> + <xs:element name="getGreetings" type="tns:getGreetings"/> <xs:element name="getGreetingsBBean" type="tns:getGreetingsBBean"/> @@ -17,6 +19,10 @@ <xs:element name="getGreetingsBeanResponse" type="tns:getGreetingsBeanResponse"/> + <xs:element name="getGreetingsByteArray" type="tns:getGreetingsByteArray"/> + + <xs:element name="getGreetingsByteArrayResponse" type="tns:getGreetingsByteArrayResponse"/> + <xs:element name="getGreetingsCBean" type="tns:getGreetingsCBean"/> <xs:element name="getGreetingsCBeanResponse" type="tns:getGreetingsCBeanResponse"/> @@ -25,8 +31,30 @@ <xs:element name="getGreetingsDBeanResponse" type="tns:getGreetingsDBeanResponse"/> + <xs:element name="getGreetingsException" type="tns:getGreetingsException"/> + + <xs:element name="getGreetingsExceptionResponse" type="tns:getGreetingsExceptionResponse"/> + <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/> + <xs:complexType name="getGreetingsException"> + <xs:sequence> + <xs:element name="arg0" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="getGreetingsExceptionResponse"> + <xs:sequence> + <xs:element name="return" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="HelloWorldException"> + <xs:sequence> + <xs:element name="message" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="getGreetingsBeanArray"> <xs:sequence> <xs:element name="arg0" type="ns1:aBean" nillable="true" minOccurs="0" maxOccurs="unbounded"/> @@ -46,6 +74,18 @@ </xs:sequence> </xs:complexType> + <xs:complexType name="getGreetingsByteArray"> + <xs:sequence> + <xs:element name="arg0" type="xs:base64Binary" nillable="true" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="getGreetingsByteArrayResponse"> + <xs:sequence> + <xs:element name="return" type="xs:base64Binary" nillable="true" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="getGreetingsBBean"> <xs:sequence> <xs:element name="arg0" type="tns:bBean" minOccurs="0"/> |