diff options
Diffstat (limited to 'branches/sca-java-1.3.2/tools/java2wsdl/src/test')
13 files changed, 1093 insertions, 0 deletions
diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java new file mode 100644 index 0000000000..135b374357 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.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.tools.java2wsdl.generate; + +import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; + +public class CustomerValue { + + public int getValue(String custId, String stockSymbol) { + return 0; + } + + public Customer getCustomerDetails(String custId) { + return new Customer(); + } + + public String noArgsServiceMethod() { + return new String(); + } + + private void privateServiceMethod() { + + } + +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java new file mode 100644 index 0000000000..dfebd77215 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.tools.java2wsdl.generate; + +import org.apache.tuscany.tools.java2wsdl.generate.account.Account; +import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; + +public class CustomerWithAccount { + + private Customer customer = new Customer(); + + private Account[] accounts; + + public int getValue(String custId, String stockSymbol) { + return 123; + } + + public Customer getCustomerDetails(String custId) { + return customer; + } + + public Account getCustomerAccount(String custId, String accountId) { + return accounts[0]; + } + + public Account[] getAccounts() { + return accounts; + } + + public void setAccounts(Account[] accounts) { + this.accounts = accounts; + } +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java new file mode 100644 index 0000000000..5406025643 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/ExampleService.java @@ -0,0 +1,31 @@ +/*
+ * 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.tools.java2wsdl.generate;
+
+import org.osoa.sca.annotations.OneWay;
+
+public interface ExampleService {
+
+ void sayHelloTwoWay(String name);
+
+ @OneWay
+ void sayHelloOneWay(String name);
+
+ String getGreeting();
+}
diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java new file mode 100644 index 0000000000..c587252d23 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java @@ -0,0 +1,114 @@ +/* + * 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.tools.java2wsdl.generate; + +import java.io.File; + +import junit.framework.TestCase; + +/** + * A JUnit test case to test the Tuscany Java 2 WSDL Generation + */ +public class TuscanyJava2WSDLTestCase extends TestCase { + + /** + * setup the pre-requisites for the test case to run + * + * @exception Exception + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + /** + * @exception Exception + */ + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + + /** + * Simple WSDL generation test. + */ + public void testSimpleWSDLGeneration() { + String[] arguments = + new String[] {"-cn", "org.apache.tuscany.tools.java2wsdl.generate.CustomerValue", + "-o", "target/java2wsdl-source", "-xc", + "org.apache.tuscany.tools.java2wsdl.generate.extra.GoldCustomer"}; + + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/CustomerValue.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + /** + * Test WSDL generation where a parameter Object[] is involved. + */ + public void testWsdlGeneration2() { + + String[] arguments = + new String[] {"-cn", "org.apache.tuscany.tools.java2wsdl.generate.CustomerWithAccount", + "-o", "target/java2wsdl-source",}; + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/CustomerWithAccount.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + public void testWsdlGeneration_SDO_Static() { + // tests for SDOs where XSD exist. Hence no XSDs must be generated + String[] arguments = + new String[] {"-cn", "org.soapinterop.CreditScoreDocLit", + "-o", "target/java2wsdl-source", + "-ixsd", "[http://www.example.org/creditscore/doclit/," + "http://www.example.org/creditscore/doclit/xsd]"}; + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/CreditScoreDocLit.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + /** + * Test WSDL generation for a service interface. + */ + public void testServiceWSDLGeneration() { + String[] arguments = + new String[] {"-cn", "org.apache.tuscany.tools.java2wsdl.generate.ExampleService", + "-o", "target/java2wsdl-source"}; + + Java2WSDL.main(arguments); + + File file = new File("target/java2wsdl-source/ExampleService.wsdl"); + assertTrue(file.exists() && file.isFile()); + } + + /** + * Test WSDL generation from a java interface and then generate the java + * interface using the generated WSDL. + */ + public void _testRoundTrip() { + // TODO implement round trip + // this should re-generate java interfaces from the generated wsdl + // and compile (?) the generated java code. + // fail(); + + } +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java new file mode 100644 index 0000000000..bf49d98888 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java @@ -0,0 +1,53 @@ +/* + * 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.tools.java2wsdl.generate.account; + +import java.math.BigDecimal; + +public class Account { + int accountType; + + String accountNo; + + BigDecimal balance; + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public int getAccountType() { + return accountType; + } + + public void setAccountType(int accountType) { + this.accountType = accountType; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java new file mode 100644 index 0000000000..cf83095852 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.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.tools.java2wsdl.generate.customer; + +public class Customer { + private String name = ""; + + public int custType = 0; + + public String getName() { + return name; + } +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java new file mode 100644 index 0000000000..901da8e551 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.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.tools.java2wsdl.generate.extra; + +import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; + +public class GoldCustomer extends Customer { + public String goldCustNumber = ""; + + public String getGoldCustNumber() { + return goldCustNumber; + } + + public void setGoldCustNumber(String goldCustNumber) { + this.goldCustNumber = goldCustNumber; + } +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java new file mode 100644 index 0000000000..78a64dcc64 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.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.soapinterop; + +public interface CreditScoreDocLit { + public org.example.creditscore.doclit.CreditReport getCreditScore(org.example.creditscore.doclit.Customer param0) + throws java.rmi.RemoteException; +} diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/AccountService.wsdl b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/AccountService.wsdl new file mode 100644 index 0000000000..6f2fed1e2a --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/AccountService.wsdl @@ -0,0 +1,242 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.bigbank.com/Account/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/Account/"
+ targetNamespace="http://www.bigbank.com/Account/" + name="AccountService">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.bigbank.com/Account/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:account="http://www.bigbank.com/Account/" + xmlns:sdojava="commonj.sdo/java" + sdojava:package="org.apache.tuscany.samples.bigbank.account">
+
+ <xsd:element name="getAccountReportWrapped0">
+ <xsd:complexType>
+ <xsd:sequence>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getAccountReportWrapped0Response">
+ <xsd:complexType>
+ <xsd:sequence>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="getAccountReportWrapped1"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="customerID" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element>
+ <xsd:element name="getAccountReportWrapped1Response"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="accountReport" type="account:AccountReport"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> +
+ <xsd:element name="getAccountReportWrappedN">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerID" type="xsd:string"/>
+ <xsd:element name="customerID2" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="getAccountReportWrappedNResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="accountReport" type="account:AccountReport"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="getAccountReportBare0" type="xsd:string"/>
+ <xsd:element name="getAccountReportBare0Response" type="xsd:int"/>
+
+ <xsd:element name="getAccountReportBare1Simple" type="xsd:string"/>
+ <xsd:element name="getAccountReportBare1SimpleResponse" type="xsd:int"/>
+
+ <xsd:element name="getAccountReportBare1Complex" type="account:AccountRequest"/>
+ <xsd:element name="getAccountReportBare1ComplexResponse" type="account:AccountReport"/>
+
+ <xsd:complexType name="AccountRequest">
+ <xsd:sequence>
+ <xsd:element name="customerID" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="AccountReport">
+ <xsd:sequence>
+ <xsd:element name="accountSummaries" type="account:AccountSummary" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AccountSummary">
+ <xsd:attribute name="accountNumber" type="xsd:string"/>
+ <xsd:attribute name="accountType" type="xsd:string"/>
+ <xsd:attribute name="balance" type="xsd:float"/>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getAccountReportWrapped0Request">
+ <wsdl:part element="account:getAccountReportWrapped0" name="getAccountReportWrapped0Request"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportWrapped0Response">
+ <wsdl:part element="account:getAccountReportWrapped0Response" name="getAccountReportWrapped0Response"/>
+ </wsdl:message>
+
+ <wsdl:message name="getAccountReportWrapped1Request">
+ <wsdl:part element="account:getAccountReportWrapped1" name="getAccountReportWrapped1Request"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportWrapped1Response">
+ <wsdl:part element="account:getAccountReportWrapped1Response" name="getAccountReportWrapped1Response"/>
+ </wsdl:message>
+
+ <wsdl:message name="getAccountReportWrappedNRequest">
+ <wsdl:part element="account:getAccountReportWrappedN" name="getAccountReportWrappedNRequest"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportWrappedNResponse">
+ <wsdl:part element="account:getAccountReportWrappedNResponse" name="getAccountReportWrappedNResponse"/>
+ </wsdl:message>
+
+ <wsdl:message name="getAccountReportBare0Request">
+ </wsdl:message>
+ <wsdl:message name="getAccountReportBare0Response">
+ </wsdl:message>
+
+ <wsdl:message name="getAccountReportBare1SimpleRequest">
+ <wsdl:part element="account:getAccountReportBare1Simple" name="getAccountReportBare1SimpleRequest"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportBare1SimpleResponse">
+ <wsdl:part element="account:getAccountReportBare1SimpleResponse" name="getAccountReportBare1SimpleResponse"/>
+ </wsdl:message>
+
+ <wsdl:message name="getAccountReportBare1ComplexRequest">
+ <wsdl:part element="account:getAccountReportBare1Complex" name="getAccountReportBare1ComplexRequest"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportBare1ComplexResponse">
+ <wsdl:part element="account:getAccountReportBare1ComplexResponse" name="getAccountReportBare1ComplexResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Account_Service">
+ <wsdl:operation name="getAccountReportWrapped0">
+ <wsdl:input message="tns:getAccountReportWrapped0Request"/>
+ <wsdl:output message="tns:getAccountReportWrapped0Response"/>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportWrapped1">
+ <wsdl:input message="tns:getAccountReportWrapped1Request"/>
+ <wsdl:output message="tns:getAccountReportWrapped1Response"/>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportWrappedN">
+ <wsdl:input message="tns:getAccountReportWrappedNRequest"/>
+ <wsdl:output message="tns:getAccountReportWrappedNResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportBare0">
+ <wsdl:input message="tns:getAccountReportBare0Request"/>
+ <wsdl:output message="tns:getAccountReportBare0Response"/>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportBare1Simple">
+ <wsdl:input message="tns:getAccountReportBare1SimpleRequest"/>
+ <wsdl:output message="tns:getAccountReportBare1SimpleResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportBare1Complex">
+ <wsdl:input message="tns:getAccountReportBare1ComplexRequest"/>
+ <wsdl:output message="tns:getAccountReportBare1ComplexResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AccountServiceSOAP" type="tns:Account_Service">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getAccountReportWrapped0">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReportWrapped0"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportWrapped1">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReportWrapped1"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportWrappedN">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReportWrappedN"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportBare0">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReportBare0"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportBare1Simple">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReportBare1Simple"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getAccountReportBare1Complex">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReportBare1Complex"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="AccountService">
+ <wsdl:port binding="tns:AccountServiceSOAP"
+ name="AccountServiceSOAP">
+ <soap:address location="http://localhost:8085/sample-account/services/AccountService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl new file mode 100644 index 0000000000..09d1a58589 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.example.org/creditscore/doclit/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditScore"
+ targetNamespace="http://www.example.org/creditscore/doclit/">
+ <wsdl:types>
+ <xsd:schema
+ targetNamespace="http://www.example.org/creditscore/doclit/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="getCreditScoreRequest" type="tns:Customer" />
+ <xsd:complexType name="Customer">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ <xsd:element name="firstName" type="xsd:string" />
+ <xsd:element name="lastName" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="getCreditScoreResponse" type="tns:CreditReport"/>
+ <xsd:complexType name="CreditReport">
+ <xsd:sequence>
+ <xsd:element name="score" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getCreditScoreResponse">
+ <wsdl:part element="tns:getCreditScoreResponse"
+ name="getCreditScoreResponse" />
+ </wsdl:message>
+ <wsdl:message name="getCreditScoreRequest">
+ <wsdl:part element="tns:getCreditScoreRequest"
+ name="getCreditScoreRequest" />
+ </wsdl:message>
+ <wsdl:portType name="CreditScoreDocLit">
+ <wsdl:operation name="getCreditScore">
+ <wsdl:input message="tns:getCreditScoreRequest" />
+ <wsdl:output message="tns:getCreditScoreResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CreditScoreDocLitSOAP" type="tns:CreditScoreDocLit">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getCreditScore">
+ <soap:operation
+ soapAction="http://www.example.org/creditscore/doclit/getCreditScore" />
+ <wsdl:input>
+ <soap:body parts="getCreditScoreRequest" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body parts="getCreditScoreResponse" use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="CreditScore">
+ <wsdl:port binding="tns:CreditScoreDocLitSOAP"
+ name="CreditScoreDocLitSOAP">
+ <soap:address location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/helloworld.wsdl b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/helloworld.wsdl new file mode 100644 index 0000000000..051f604bb2 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/helloworld.wsdl @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + --> +<wsdl:definitions targetNamespace="http://helloworldaxis.samples.tuscany.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://helloworldaxis.samples.tuscany.apache.org" xmlns:intf="http://helloworldaxis.samples.tuscany.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="stockquote"> + <!--WSDL created by Apache Axis version: 1.2.1 +Built on Jun 14, 2005 (09:15:57 EDT)--> + <wsdl:types> + <schema elementFormDefault="qualified" + xmlns:hello="http://helloworldaxis.samples.tuscany.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://helloworldaxis.samples.tuscany.apache.org" xmlns="http://www.w3.org/2001/XMLSchema"> + <complexType name="ComplexGreetings"> + <sequence> + <element name="greet1" type="xsd:string"/> + <element name="greet2" type="xsd:double"/> + </sequence> + </complexType> + <element name="getGreetings"> + <complexType> + <sequence> + <element name="in0" type="xsd:string"/> + <element name="in1" type="xsd:double"/> + <element name="in2" type="hello:ComplexGreetings"/> + </sequence> + <xsd:attribute name="language" type="xsd:string"/> + </complexType> + </element> + <element name="getGreetingsResponse"> + <complexType> + <sequence> + <element name="getGreetingsReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="getGreetingsRequest"> + + <wsdl:part element="impl:getGreetings" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getGreetingsResponse"> + + <wsdl:part element="impl:getGreetingsResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="HelloWorldServiceImpl"> + + <wsdl:operation name="getGreetings"> + + <wsdl:input message="impl:getGreetingsRequest" name="getGreetingsRequest"/> + + <wsdl:output message="impl:getGreetingsResponse" name="getGreetingsResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="helloworldSoapBinding" type="impl:HelloWorldServiceImpl"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="getGreetings"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getGreetingsRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getGreetingsResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="HelloWorldServiceImplService"> + + <wsdl:port binding="impl:helloworldSoapBinding" name="helloworld"> + + <!-- Tuscany SCA Service --> +<!-- + <wsdlsoap:address location="http://localhost:8080/tuscany-samples-helloworldws-service/services/HelloWorldService"/> +--> + <wsdlsoap:address location="http://localhost:9876/tuscany-samples-helloworldws-service/services/HelloWorldService"/> + + <!-- Axis Web Service --> + <!-- + <wsdlsoap:address location="http://localhost:8081/helloworldaxissvc-incubating-M1/services/helloworld"/> + --> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/interopdoc.wsdl b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/interopdoc.wsdl new file mode 100644 index 0000000000..820c26ca34 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/interopdoc.wsdl @@ -0,0 +1,180 @@ +<?xml version="1.0"?> +<!-- + * 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. + --> +<definitions name="InteropTestDoc" targetNamespace="http://soapinterop.org/" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://soapinterop.org/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + + <xsd:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/" xmlns:interop="http://soapinterop.org/"> + + <xsd:element name="SingleTag"> + <xsd:complexType> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="SingleTag"/> + <xsd:element name="SingleTagResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="SingleTag" type="interop:SingleTag"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="SimpleDocument"> + <xsd:complexType> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleDocument"> + <xsd:simpleContent> + <xsd:extension base="xsd:string"/> + </xsd:simpleContent> + </xsd:complexType> + <xsd:element name="SimpleDocumentResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="SimpleDocument" type="interop:SimpleDocument"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="ComplexDocument"> + <xsd:complexType> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="ComplexDocument"> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="simpleDoc" type="interop:ArrayOfSimpleDocument"/> + <xsd:element minOccurs="0" maxOccurs="1" name="child" type="interop:ChildDocument"/> + </xsd:sequence> + <xsd:attribute name="AnAttribute" type="xsd:string"/> + </xsd:complexType> + <xsd:complexType name="ArrayOfSimpleDocument"> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="unbounded" name="SimpleDocument" nillable="true" type="interop:SimpleDocument"/> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="ChildDocument"> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="childSimpleDoc" type="interop:ArrayOfSimpleDocument"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="ComplexDocumentResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element minOccurs="0" maxOccurs="1" name="ComplexDocument" type="interop:ComplexDocument"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + </xsd:schema> + + </types> + + <message name="SingleTagSoapIn"> + <part name="parameters" element="tns:SingleTag"/> + </message> + <message name="SingleTagSoapOut"> + <part name="outputDoc" element="tns:SingleTagResponse"/> + </message> + <message name="SimpleDocumentSoapIn"> + <part name="parameters" element="tns:SimpleDocument"/> + </message> + <message name="SimpleDocumentSoapOut"> + <part name="outputDoc" element="tns:SimpleDocumentResponse"/> + </message> + <message name="ComplexDocumentSoapIn"> + <part name="parameters" element="tns:ComplexDocument"/> + </message> + <message name="ComplexDocumentSoapOut"> + <part name="outputDoc" element="tns:ComplexDocumentResponse"/> + </message> + + <portType name="DocTestPortType"> + + <operation name="SingleTag"> + <input message="tns:SingleTagSoapIn"/> + <output message="tns:SingleTagSoapOut"/> + </operation> + <operation name="SimpleDocument"> + <input message="tns:SimpleDocumentSoapIn"/> + <output message="tns:SimpleDocumentSoapOut"/> + </operation> + <operation name="ComplexDocument"> + <input message="tns:ComplexDocumentSoapIn"/> + <output message="tns:ComplexDocumentSoapOut"/> + </operation> + + </portType> + + <binding name="doc_test_binding" type="tns:DocTestPortType"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <operation name="SingleTag"> + <soap:operation soapAction="http://soapinterop.org/SingleTag"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + + <operation name="SimpleDocument"> + <soap:operation soapAction="http://soapinterop.org/SimpleDocument"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + + <operation name="ComplexDocument"> + <soap:operation soapAction="http://soapinterop.org/ComplexDocument"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + + <service name="interopDocSvc"> + + <port name="interopDocPort" binding="tns:doc_test_binding"> + <soap:address location="http://www.whitemesa.net/interopdoc"/> + </port> + + </service> + +</definitions> diff --git a/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/sequences.xsd b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/sequences.xsd new file mode 100644 index 0000000000..a565f3fa65 --- /dev/null +++ b/branches/sca-java-1.3.2/tools/java2wsdl/src/test/resources/sequences.xsd @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + --> +<xsd:schema xmlns:seq="http://www.example.com/sequences" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://www.example.com/sequences"> + + <xsd:element name="mixedStockQuote" type="seq:MixedQuote" /> + <xsd:element name="rc" type="seq:RepeatingChoice" /> + <xsd:element name="mrc" type="seq:MixedRepeatingChoice" /> + <xsd:element name="rc2" type="seq:TwoRCs" /> + <xsd:element name="mrc2" type="seq:TwoRCsMixed" /> + + + + <xsd:complexType mixed="true" name="MixedQuote"> + <xsd:sequence> + <xsd:element name="symbol" type="xsd:string" /> + <xsd:element name="companyName" type="xsd:string" /> + <xsd:element name="price" type="xsd:decimal" /> + <xsd:element name="open1" type="xsd:decimal" /> + <xsd:element name="high" type="xsd:decimal" /> + <xsd:element name="low" type="xsd:decimal" /> + <xsd:element name="volume" type="xsd:double" /> + <xsd:element name="change1" type="xsd:double" /> + <xsd:element maxOccurs="unbounded" minOccurs="0" + name="quotes" type="seq:MixedQuote" /> + </xsd:sequence> + </xsd:complexType> + + + <xsd:complexType name="RepeatingChoice"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:element name="a" type="xsd:string" /> + <xsd:element name="b" type="xsd:int" /> + </xsd:choice> + </xsd:complexType> + + + <xsd:complexType mixed="true" name="MixedRepeatingChoice"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:element name="a" type="xsd:string" /> + <xsd:element name="b" type="xsd:int" /> + </xsd:choice> + </xsd:complexType> + + + <xsd:complexType name="TwoRCs"> + <xsd:sequence> + + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:element name="a" type="xsd:string" /> + <xsd:element name="b" type="xsd:int" /> + </xsd:choice> + + <xsd:element name="split" type="xsd:string" /> + + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:element name="y" type="xsd:string" /> + <xsd:element name="z" type="xsd:int" /> + </xsd:choice> + + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType mixed="true" name="TwoRCsMixed"> + <xsd:sequence> + + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:element name="a" type="xsd:string" /> + <xsd:element name="b" type="xsd:int" /> + </xsd:choice> + + <xsd:element name="split" type="xsd:string" /> + + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:element name="y" type="xsd:string" /> + <xsd:element name="z" type="xsd:int" /> + </xsd:choice> + + </xsd:sequence> + </xsd:complexType> + +</xsd:schema> |