You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2007/06/26 14:46:57 UTC

svn commit: r550792 [3/3] - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ adb/src/org/apache/axis2/databinding/utils/reader/ adb/src/org/apache/axis2/rpc/receivers/ integration/ integration/test-resources/Complex...

Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/complex/ComplexDataTypesDocLitBareTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/complex/ComplexDataTypesDocLitBareTest.java?view=auto&rev=550792
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/complex/ComplexDataTypesDocLitBareTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/complex/ComplexDataTypesDocLitBareTest.java Tue Jun 26 05:46:56 2007
@@ -0,0 +1,648 @@
+package org.apache.axis2.rpc.complex;
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* 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.
+*
+*
+*/
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.attachments.utils.IOUtils;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.tempuri.complex.xsd.ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.Calendar;
+
+/*
+ *  ComplexDataTypesDocLitBareTest Junit test case
+*/
+
+public class ComplexDataTypesDocLitBareTest extends
+        UtilServerBasedTestCase {
+
+    protected QName serviceName = new QName("ComplexDataTypesDocLitBare");
+    protected AxisConfiguration axisConfiguration;
+    protected EndpointReference targetEPR;
+    org.tempuri.complex.xsd.ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub stub;
+
+    public ComplexDataTypesDocLitBareTest() {
+        super(ComplexDataTypesDocLitBareTest.class.getName());
+    }
+
+    public ComplexDataTypesDocLitBareTest(String testName) {
+        super(testName);
+    }
+
+    public static Test suite() {
+        return getTestSetup(new TestSuite(ComplexDataTypesDocLitBareTest.class));
+    }
+
+    protected void setUp() throws Exception {
+        targetEPR =
+                new EndpointReference("http://127.0.0.1:"
+                        + (UtilServer.TESTING_PORT)
+//                        + 8000
+                        + "/axis2/services/ComplexDataTypesDocLitBare");
+        stub = new org.tempuri.complex.xsd.ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub(null, targetEPR.getAddress());
+        String className = "org.tempuri.complex.ComplexDataTypesDocLitBare";
+        UtilServer.start();
+        Parameter generateBare = new Parameter();
+        generateBare.setName(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
+        generateBare.setValue("true");
+        UtilServer.getConfigurationContext().getAxisConfiguration().addParameter(generateBare);
+        AxisService service = AxisService.createService(
+                className, UtilServer.getConfigurationContext().getAxisConfiguration());
+        service.addParameter(generateBare);
+        service.setName("ComplexDataTypesDocLitBare");
+        service.setClassLoader(Thread.currentThread().getContextClassLoader());
+        UtilServer.deployService(service);
+    }
+
+    protected void tearDown() throws Exception {
+        UtilServer.unDeployService(serviceName);
+        UtilServer.unDeployClientService();
+    }
+
+    public void testretArrayInt1D() throws java.lang.Exception {
+//        assertNull(stub.retArrayInt1D(null));
+        stub._getServiceClient().cleanupTransport();
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayInt1D req = new
+                ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayInt1D();
+        assertNotNull(stub.retArrayInt1D(req));
+        stub._getServiceClient().cleanupTransport();
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfint input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfint();
+        input.set_int(new int[]{0, 1, 2});
+        req.setInArrayInt1D(input);
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetArrayInt1DResult ret = stub.retArrayInt1D(req);
+        stub._getServiceClient().cleanupTransport();
+        assertNotNull(ret);
+        assertNotNull(ret.getRetArrayInt1DResult().get_int());
+        assertEquals(ret.getRetArrayInt1DResult().get_int().length, 3);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretStructSNSAS() throws java.lang.Exception {
+        //TODO Codegen issue
+//        assertNull(stub.retStructSNSAS(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructSNSAS req =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructSNSAS();
+        assertNotNull(stub.retStructSNSAS(req));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Group input =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Group();
+        input.setName("xyz");
+        input.setMembers(new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfPerson());
+        req.setInStructSNSAS(input);
+        assertNotNull(stub.retStructSNSAS(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretArrayDateTime1D() throws java.lang.Exception {
+        //TODO , this is a codegen bug
+//        assertNull(stub.retArrayDateTime1D(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayDateTime1D req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayDateTime1D();
+        assertNotNull(stub.retArrayDateTime1D(req));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfNullableOfdateTime input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfNullableOfdateTime();
+        input.setDateTime(new Calendar[]{Calendar.getInstance(), Calendar.getInstance()});
+        req.setInArrayDateTime1D(input);
+        assertNotNull(stub.retArrayDateTime1D(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretArrayString2D() throws java.lang.Exception {
+        //TODO codegen issue
+//        assertNull(stub.retArrayString2D(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayString2D req =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayString2D();
+        assertNotNull(stub.retArrayString2D(req));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfArrayOfstring input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfArrayOfstring();
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring a2 = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring();
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring a1 = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring();
+        a1.setString(new String[]{"foo", "bar"});
+        input.setArrayOfstring(new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring[]{a1, a2});
+        req.setInArrayString2D(input);
+        assertNotNull(stub.retArrayString2D(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretArrayDecimal1D() throws java.lang.Exception {
+
+//        assertNull(stub.retArrayDecimal1D(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayDecimal1D req =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayDecimal1D();
+        assertNotNull(stub.retArrayDecimal1D(req));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfNullableOfdecimal input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfNullableOfdecimal();
+        input.setDecimal(new BigDecimal[]{new BigDecimal(1), new BigDecimal(2)});
+        req.setInArrayDecimal1D(input);
+        assertNotNull(stub.retArrayDecimal1D(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretStructSNSA() throws java.lang.Exception {
+
+//        assertNull(stub.retStructSNSA(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructSNSA req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructSNSA();
+        assertNotNull(stub.retStructSNSA(req));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Employee input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Employee();
+        input.setJobID(34);
+        input.setBaseDetails(new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Person());
+        input.setNumbers(new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfshort());
+        input.setHireDate(Calendar.getInstance());
+        req.setInStructSNSA(input);
+        assertNotNull(stub.retStructSNSA(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretArrayAnyType1D() throws java.lang.Exception {
+
+//        assertNull(stub.retArrayAnyType1D(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayAnyType1D req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayAnyType1D();
+        assertNotNull(stub.retArrayAnyType1D(req));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfanyType input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfanyType();
+
+        OMFactory factory = OMAbstractFactory.getOMFactory();
+        // lets create the namespace object of the Article element
+        OMNamespace ns = factory.createOMNamespace("http://www.ibm.com/developerworks/library/ws-axis2soap/index.html", "article");
+        // now create the Article element with the above namespace
+        OMElement articleElement = factory.createOMElement("Article", ns);
+
+        input.setAnyType(new OMElement[]{articleElement});
+        req.setInArrayAnyType1D(input);
+        assertNotNull(stub.retArrayAnyType1D(req));
+        //TODOD : Need to fix this , seems like we are not getting the corrcet response
+    }
+
+
+    /**
+     * Auto generated test method
+     */
+    public void testretStructSN() throws java.lang.Exception {
+
+//        assertNull(stub.retStructSN(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructSN req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructSN();
+        assertNotNull(stub.retStructSN(req));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Person input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Person();
+        input.setAge(23);
+        input.setID(345);
+        input.setMale(false);
+        input.setName("Why?");
+        req.setInStructSN(input);
+        assertNotNull(stub.retStructSN(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretArray1DSN() throws java.lang.Exception {
+//TODO Codegen issue
+//        assertNull(stub.retArray1DSN(null));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArray1DSN req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArray1DSN();
+        assertNotNull(stub.retArray1DSN(req));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfPerson input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfPerson();
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Person p1 = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Person();
+        p1.setAge(34);
+        p1.setID(2345);
+        p1.setMale(true);
+        p1.setName("HJHJH");
+        input.setPerson(new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Person[]{p1});
+        req.setInArray1DSN(input);
+        assertNotNull(stub.retArray1DSN(req));
+        //TODO : Need to fix this , we are not gettin corrcet reponse
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretDerivedClass() throws java.lang.Exception {
+//        assertNull(stub.retDerivedClass(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDerivedClass req =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDerivedClass();
+        assertNotNull(stub.retDerivedClass(req));
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Furniture input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Furniture();
+        input.setColor("white");
+        input.setPrice(67);
+        req.setInDerivedClass(input);
+        assertNotNull(stub.retDerivedClass(req));
+        //TODO : Need to fix this too
+    }
+//
+//// TODO: We need to figure out how to deal with ENUM's. Please don't remove this section.
+////    /**
+////     * Auto generated test method
+////     */
+//    public void testretEnumInt() throws java.lang.Exception {
+//
+//
+//        assertNull(stub.retEnumInt(null));
+//        String input = "";
+//        assertNotNull(stub.retEnumInt(new String()));
+//    }
+//
+//// TODO: We need to figure out how to deal with ENUM's. Please don't remove this section.
+////    /**
+////     * Auto generated test method
+////     */
+////    public void testretEnumString() throws java.lang.Exception {
+////
+////        org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub stub =
+////                new org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub();
+////
+////        assertNull(stub.retEnumString(null));
+////        BitMask input = new BitMask();
+////        assertNull(stub.retEnumString(new BitMask()));
+////    }
+//
+
+    //
+
+    /**
+     * Auto generated test method
+     */
+    public void testretStructS1() throws java.lang.Exception {
+//        assertNull(stub.retStructS1(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructS1 req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InStructS1();
+        assertNotNull(stub.retStructS1(req));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Name input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.Name();
+        input.setName("ewrterty");
+        req.setInStructS1(input);
+        assertNotNull(stub.retStructS1(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretArrayString1D() throws java.lang.Exception {
+//        assertNull(stub.retArrayString1D(null));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayString1D req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InArrayString1D();
+        assertNotNull(stub.retArrayString1D(req));
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring input = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.ArrayOfstring();
+        input.setString(new String[]{"foo", "bar"});
+        req.setInArrayString1D(input);
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetArrayString1DResult ret = stub.retArrayString1D(req);
+        assertNotNull(ret);
+        assertNotNull(ret.getRetArrayString1DResult().getString());
+        assertEquals(ret.getRetArrayString1DResult().getString().length, 2);
+    }
+
+
+    /**
+     * Auto generated test method
+     */
+    public void testretSingle() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InSingle req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InSingle();
+        req.setInSingle(43.0f);
+        float ret = stub.retSingle(req).getRetSingleResult();
+        assertTrue(ret == 43.0f);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretDateTime() throws java.lang.Exception {
+
+        Calendar input = Calendar.getInstance();
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDateTime req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDateTime();
+        req.setInDateTime(input);
+        Calendar ret = stub.retDateTime(req).getRetDateTimeResult();
+        assertNotNull(ret);
+        assertEquals(ret, input);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretGuid() throws java.lang.Exception {
+
+        String input = "12345";
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InGuid req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InGuid();
+        req.setInGuid(input);
+        String ret = stub.retGuid(req).getRetGuidResult();
+        assertEquals(ret, input);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretByteArray() throws java.lang.Exception {
+
+
+        byte[] input = new byte[]{(byte) 0xDE, (byte) 0xAD, (byte) 0xBE, (byte) 0xEF};
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetByteArray req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetByteArray();
+        req.setInByteArray(new DataHandler(new ByteArrayDataSource(input)));
+        DataHandler ret = stub.retByteArray(req).get_return();
+        byte[] bytes = IOUtils.getStreamAsByteArray(ret.getInputStream());
+        assertTrue(Arrays.equals(bytes, input));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretUri() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InUri req =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InUri();
+        req.setInUri("124");
+        assertNotNull(stub.retUri(req));
+    }
+
+    /**
+     * Auto generated test method
+     */
+//    public void testretQName() throws java.lang.Exception {
+//        FIXME: Why is QName being mapped to OMElement?
+//        assertNull(stub.retQName(null));
+//    }
+
+//// TODO: FIXME: Need to figure out how to do enum's. Please don't remove this following section
+////    /**
+////     * Auto generated test method
+////     */
+////    public void testretEnumInt() throws java.lang.Exception {
+////
+////        org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub stub =
+////                new org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub();
+////
+////        org.tempuri.complex.xsd.xsd.RetEnumInt retEnumInt126 =
+////                (org.tempuri.complex.xsd.xsd.RetEnumInt) getTestObject(org.tempuri.complex.xsd.xsd.RetEnumInt.class);
+////        // todo Fill in the retEnumInt126 here
+////
+////        assertNotNull(stub.retEnumInt(
+////                getParam0(retEnumInt126)
+////        ));
+////
+////
+////    }
+//
+    public void testretLong() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InLong req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InLong();
+        req.setInLong(34);
+        long ret = stub.retLong(req).getRetLongResult();
+        assertEquals(34, ret);
+    }
+
+    //
+    /**
+     * Auto generated test method
+     */
+    public void testretUShort() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InUShort req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InUShort();
+        req.setInUShort(34);
+        int ret = stub.retUShort(req).getRetUShortResult();
+        assertEquals(34, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretUInt() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InUInt req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InUInt();
+        req.setInUInt(34);
+        long ret = stub.retUInt(req).getRetUIntResult();
+        assertEquals(34, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretByte() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InByte req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InByte();
+        req.setInByte((short) 34);
+        short ret = stub.retByte(req).getRetByteResult();
+        assertEquals((short) 34, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretSByte() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InSByte req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InSByte();
+        req.setInSByte((byte) 34);
+        byte ret = stub.retSByte(req).getRetSByteResult();
+        assertEquals((byte) 34, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretShort() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InShort req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InShort();
+        req.setInShort((short) 34);
+        short ret = stub.retShort(req).getRetShortResult();
+
+        assertEquals((short) 34, ret);
+    }
+
+    //
+    /**
+     * Auto generated test method
+     */
+    public void testretObject() throws java.lang.Exception {
+
+        OMFactory factory = OMAbstractFactory.getOMFactory();
+        // lets create the namespace object of the Article element
+        OMNamespace ns = factory.createOMNamespace("http://www.ibm.com/developerworks/library/ws-axis2soap/index.html", "article");
+        // now create the Article element with the above namespace
+        OMElement articleElement = factory.createOMElement("Article", ns);
+
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InObject req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InObject();
+        req.setInObject(articleElement);
+        OMElement ret = stub.retObject(req).getRetObjectResult();
+        assertNotNull(ret);
+        assertEquals(ret.toString(), articleElement.toString());
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretFloat() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InFloat req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InFloat();
+        req.setInFloat((float) 34);
+        float ret = stub.retFloat(req).getRetFloatResult();
+        assertTrue(ret == 34);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretDouble() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDouble req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDouble();
+        req.setInDouble(34);
+        double ret = stub.retDouble(req).getRetDoubleResult();
+        assertTrue(ret == 34);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretBool() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InBool req =
+                new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InBool();
+        req.setInBool(true);
+        boolean ret = stub.retBool(req).getRetBoolResult();
+        assertTrue(ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretDecimal() throws java.lang.Exception {
+
+        BigDecimal input = new BigDecimal(12334);
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDecimal req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InDecimal();
+        req.setInDecimal(input);
+        BigDecimal ret = stub.retDecimal(req).getRetDecimalResult();
+        assertNotNull(ret);
+        assertEquals(ret, input);
+    }
+
+// TODO: FIXME: Need to figure out how to do enum's. Please don't remove this following section
+////    /**
+////     * Auto generated test method
+////     */
+////    public void testretEnumString() throws java.lang.Exception {
+////
+////        org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub stub =
+////                new org.tempuri.complex.xsd.ComplexDataTypesComplexDataTypesSOAP11Port_httpStub();
+////
+////        org.tempuri.complex.xsd.xsd.RetEnumString retEnumString198 =
+////                (org.tempuri.complex.xsd.xsd.RetEnumString) getTestObject(org.tempuri.complex.xsd.xsd.RetEnumString.class);
+////        // todo Fill in the retEnumString198 here
+////
+////        assertNotNull(stub.retEnumString(
+////                getParam0(retEnumString198)
+////        ));
+////
+////
+////    }
+
+    //
+    /**
+     * Auto generated test method
+     */
+    public void testretInt() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InInt req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InInt();
+        req.setInInt(34);
+        int ret = stub.retInt(req).getRetIntResult();
+        assertEquals((int) 34, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretInts() throws java.lang.Exception {
+
+        int[] input = new int[]{34, 45};
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetInts req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetInts();
+        req.setInInt(input);
+        int ret[] = stub.retInts(req).get_return();
+        assertTrue(Arrays.equals(input, ret));
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretChar() throws java.lang.Exception {
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InChar req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InChar();
+        req.setInChar(34);
+        int ret = stub.retChar(req).getRetCharResult();
+        assertEquals(34, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretString() throws java.lang.Exception {
+        String input = "Abracadabra";
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InString req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InString();
+        req.setInString(input);
+        String ret = stub.retString(req).getRetStringResult();
+        assertNotNull(ret);
+        assertEquals(input, ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretStrings() throws java.lang.Exception {
+
+        String[] ret;
+        String[] input = new String[]{"Abracadabra"};
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetStrings req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.RetStrings();
+        req.setInString(input);
+        ret = stub.retStrings(req).get_return();
+        assertNotNull(ret);
+        ret = stub.retStrings(req).get_return();
+        assertNotNull(ret);
+        assertTrue(Arrays.equals(input, ret));
+        input = new String[]{"Abracadabra", null, "abc"};
+        req.setInString(input);
+        ret = stub.retStrings(req).get_return();
+        assertNotNull(ret);
+        assertTrue(Arrays.equals(input, ret));
+
+        input = new String[]{};
+        req.setInString(input);
+        ret = stub.retStrings(req).get_return();
+        assertNull(ret);
+    }
+
+    /**
+     * Auto generated test method
+     */
+    public void testretULong() throws java.lang.Exception {
+
+        BigInteger input = new BigInteger("34");
+        ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InULong req = new ComplexDataTypesDocLitBareComplexDataTypesDocLitBareSOAP11Port_httpStub.InULong();
+        req.setInULong(input);
+        BigInteger ret = stub.retULong(req).getRetULongResult();
+        assertEquals(input, ret);
+    }
+
+
+}
+

Added: webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/ComplexDataTypesDocLitBare.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/ComplexDataTypesDocLitBare.java?view=auto&rev=550792
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/ComplexDataTypesDocLitBare.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/ComplexDataTypesDocLitBare.java Tue Jun 26 05:46:56 2007
@@ -0,0 +1,214 @@
+package org.tempuri.complex;
+
+import org.tempuri.complex.data.arrays.*;
+import org.tempuri.complex.data.*;
+
+import javax.xml.namespace.QName;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* 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.
+*
+*
+*/
+public class ComplexDataTypesDocLitBare {
+     public boolean retBool(
+            boolean inBool) {
+        return inBool;
+    }
+
+    public short retByte(
+            short inByte) {
+        return inByte;
+    }
+
+    public byte retSByte(
+            byte inSByte) {
+        return inSByte;
+    }
+
+    public byte[] retByteArray(
+            byte[] inByteArray) {
+        return inByteArray;
+    }
+
+    public int retChar(
+            int inChar) {
+        return inChar;
+    }
+
+    public BigDecimal retDecimal(
+            BigDecimal inDecimal) {
+        return inDecimal;
+    }
+
+    public float retFloat(
+            float inFloat) {
+        return inFloat;
+    }
+
+    public double retDouble(
+            double inDouble) {
+        return inDouble;
+    }
+
+    public float retSingle(
+            float inSingle) {
+        return inSingle;
+    }
+
+    public int retInt(
+            int inInt) {
+        return inInt;
+    }
+
+    public int[] retInts(
+            int[] inInt) {
+        return inInt;
+    }
+
+    public short retShort(
+            short inShort) {
+        return inShort;
+    }
+
+    public long retLong(
+            long inLong) {
+        return inLong;
+    }
+
+    public Object retObject(
+            Object inObject) {
+        return inObject;
+    }
+
+    public long retUInt(
+            long inUInt) {
+        return inUInt;
+    }
+
+    public int retUShort(
+            int inUShort) {
+        return inUShort;
+    }
+
+    public BigInteger retULong(
+            BigInteger inULong) {
+        return inULong;
+    }
+
+    public String retString(
+            String inString) {
+        return inString;
+    }
+
+    public String[] retStrings(
+            String[] inString) {
+        return inString;
+    }
+
+    public String retGuid(
+            String inGuid) {
+        return inGuid;
+    }
+
+    public String retUri(
+            String inUri) {
+        return inUri;
+    }
+
+    public Calendar retDateTime(
+            Calendar inDateTime) {
+        return inDateTime;
+    }
+
+    public QName retQName(
+            QName inQName) {
+        return inQName;
+    }
+
+    public ArrayOfstring retArrayString1D(
+            ArrayOfstring inArrayString1D) {
+        return inArrayString1D;
+    }
+
+    public ArrayOfint retArrayInt1D(
+            ArrayOfint inArrayInt1D) {
+        return inArrayInt1D;
+    }
+
+    public ArrayOfNullableOfdecimal retArrayDecimal1D(
+            ArrayOfNullableOfdecimal inArrayDecimal1D) {
+        return inArrayDecimal1D;
+    }
+
+    public ArrayOfNullableOfdateTime retArrayDateTime1D(
+            ArrayOfNullableOfdateTime inArrayDateTime1D) {
+        return inArrayDateTime1D;
+    }
+
+    public ArrayOfArrayOfstring retArrayString2D(
+            ArrayOfArrayOfstring inArrayString2D) {
+        return inArrayString2D;
+    }
+
+    public ArrayOfPerson retArray1DSN(
+            ArrayOfPerson inArray1DSN) {
+        return inArray1DSN;
+    }
+
+    public ArrayOfanyType retArrayAnyType1D(
+            ArrayOfanyType inArrayAnyType1D) {
+        return inArrayAnyType1D;
+    }
+
+    public Name retStructS1(
+            Name inStructS1) {
+        return inStructS1;
+    }
+
+    public Person retStructSN(
+            Person inStructSN) {
+        return inStructSN;
+    }
+
+    public Employee retStructSNSA(
+            Employee inStructSNSA) {
+        return inStructSNSA;
+    }
+
+    public Group retStructSNSAS(
+            Group inStructSNSAS) {
+        return inStructSNSAS;
+    }
+
+    public BitMask retEnumString(
+            BitMask inEnumString) {
+        return inEnumString;
+    }
+
+    public String retEnumInt(
+            String inEnumInt) {
+        return inEnumInt;
+    }
+
+    public Furniture retDerivedClass(
+            Furniture inDerivedClass) {
+        return inDerivedClass;
+    }
+
+}

Modified: webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/arrays/ArrayOfanyType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/arrays/ArrayOfanyType.java?view=diff&rev=550792&r1=550791&r2=550792
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/arrays/ArrayOfanyType.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/tempuri/complex/data/arrays/ArrayOfanyType.java Tue Jun 26 05:46:56 2007
@@ -2,7 +2,7 @@
 
 public class ArrayOfanyType {
 
-    protected Object[] anyType;
+    private Object[] anyType;
 
     public Object[] getAnyType() {
         if (anyType == null) {
@@ -10,5 +10,6 @@
         }
         return this.anyType;
     }
+
 
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java?view=diff&rev=550792&r1=550791&r2=550792
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisMessage.java Tue Jun 26 05:46:56 2007
@@ -55,6 +55,9 @@
 
     // private PolicyInclude policyInclude;
 
+    //To chcek whether the message is wrapped or unwrapped
+    private boolean wrapped = true;
+
     public String getMessagePartName() {
 		return messagePartName;
 	}
@@ -216,5 +219,14 @@
 
     public void setPartName(String partName) {
         this.partName = partName;
+    }
+
+
+    public boolean isWrapped() {
+        return wrapped;
+    }
+
+    public void setWrapped(boolean wrapped) {
+        this.wrapped = wrapped;
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=550792&r1=550791&r2=550792
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Tue Jun 26 05:46:56 2007
@@ -1505,6 +1505,7 @@
         SchemaGenerator schemaGenerator;
         ArrayList excludeOpeartion = new ArrayList();
         AxisService service = new AxisService();
+        service.setParent(axisConfiguration);
         service.setName(serviceName);
 
         try {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java?view=diff&rev=550792&r1=550791&r2=550792
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java Tue Jun 26 05:46:56 2007
@@ -178,6 +178,7 @@
                         generateSchemaForType(null, paras[0].getType(), parameterName);
                         inMessage.setElementQName(typeTable.getQNamefortheType(parameterName));
                         inMessage.setPartName(parameterName);
+                        inMessage.setWrapped(false);
                         service.addMessageElementQNameToOperationMapping(typeTable.getQNamefortheType(parameterName),
                                 axisOperation);
                     }
@@ -211,7 +212,7 @@
                     }
                 } else {
                     generateSchemaForType(null, returnType, methodName + RESULT);
-
+                    outMessage.setWrapped(false);
                 }
                 outMessage.setElementQName(typeTable.getQNamefortheType(methodName + RESULT));
                 outMessage.setName(methodName + "ResponseMessage");
@@ -289,7 +290,9 @@
             String schemaNamespace = resolveSchemaNamespace(getQualifiedName(
                     type.getContainingPackage()));
             addImport(getXmlSchema(schemaNamespace), schemaTypeName);
-
+            if(sequence==null){
+                 generateSchemaForSingleElement(schemaTypeName, partName, isArrayType, type);
+            }
         } else {
             if (sequence == null) {
                 generateSchemaForSingleElement(schemaTypeName, partName, isArrayType, type);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org