axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Davis" <...@us.ibm.com>
Subject RE: cvs commit: xml-axis/java/test/encoding TestXsiType.java
Date Thu, 08 Nov 2001 13:06:24 GMT
Just checked in a fix for this - there's still a test failing but I don't
think it is
related to any of this stuff.  Its:  test.inout.DetailedInoutTestCase  and
I
get:
  org.xml.sax.SAXException: BasicDeser cannot handle structured data!

-Dug


Glen Daniels <gdaniels@macromedia.com> on 11/07/2001 05:37:55 PM

Please respond to axis-dev@xml.apache.org

To:   "'axis-dev@xml.apache.org'" <axis-dev@xml.apache.org>
cc:
Subject:  RE: cvs commit: xml-axis/java/test/encoding TestXsiType.java




Could you guys please take a look at this test and confirm that it should
indeed work?  (it works fine if you pull out the setting of the
sendXsiTypes
option)

It looks to me like nothing ever replaced the ServiceDescription's ability
to understand types for parameters, but perhaps I'm not understanding
something here.

--Glen

> -----Original Message-----
> From: gdaniels@apache.org [mailto:gdaniels@apache.org]
> Sent: Wednesday, November 07, 2001 5:23 PM
> To: xml-axis-cvs@apache.org
> Subject: cvs commit: xml-axis/java/test/encoding TestXsiType.java
>
>
> gdaniels    01/11/07 14:23:08
>
>   Modified:    java/test/encoding TestXsiType.java
>   Log:
>   Add a test to make sure that setting the returnType in a Call allows
>   us to deserialize untyped parameters.
>
>   ** NOTE : THIS IS CURRENTLY BROKEN **
>
>   Revision  Changes    Path
>   1.5       +56 -1     xml-axis/java/test/encoding/TestXsiType.java
>
>   Index: TestXsiType.java
>   ===================================================================
>   RCS file: /home/cvs/xml-axis/java/test/encoding/TestXsiType.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- TestXsiType.java 2001/10/22 12:00:44  1.4
>   +++ TestXsiType.java 2001/11/07 22:23:08  1.5
>   @@ -2,8 +2,13 @@
>
>    import junit.framework.TestCase;
>    import org.apache.axis.MessageContext;
>   +import org.apache.axis.AxisEngine;
>   +import org.apache.axis.transport.local.LocalTransport;
>   +import org.apache.axis.providers.java.RPCProvider;
>   +import org.apache.axis.handlers.soap.SOAPService;
>    import org.apache.axis.client.Call;
>    import org.apache.axis.encoding.SerializationContext;
>   +import org.apache.axis.encoding.XMLType;
>    import org.apache.axis.message.RPCElement;
>    import org.apache.axis.message.RPCParam;
>    import org.apache.axis.message.SOAPEnvelope;
>   @@ -21,11 +26,19 @@
>        private String header;
>        private String footer;
>        private AxisServer server = new AxisServer();
>   +
>   +    public TestXsiType()
>   +    {
>   +        super("testing");
>   +    }
>
>        public TestXsiType(String name) {
>            super(name);
>        }
>
>   +    /**
>   +     * Trivial test just to make sure there aren't
> xsi:type attributes
>   +     */
>        public void testNoXsiTypes()
>           throws Exception
>        {
>   @@ -53,11 +66,53 @@
>            assertTrue("Found unexpected xsi:type!",
>                       msgString.indexOf("xsi:type") == -1);
>        }
>   -
>   +
>   +    /**
>   +     * More complex test which checks to confirm that we can still
>   +     * in fact deserialize if we know the type via the Call object.
>   +     */
>   +    public void testTypelessDeserialization() throws Exception
>   +    {
>   +        // Set up a server to NOT send XSI types, and deploy
>   +        // this class as a service there.
>   +
>   +        AxisServer server = new AxisServer();
>   +        server.addOption(AxisEngine.PROP_SEND_XSI, Boolean.FALSE);
>   +
>   +        SOAPService service = new SOAPService(new RPCProvider());
>   +        service.addOption("className",
> "test.encoding.TestXsiType");
>   +        service.addOption("methodName", "*");
>   +        server.deployService("TestService", service);
>   +
>   +        // Call that same server, accessing a method we
> know returns
>   +        // a double.  We should figure this out and deserialize it
>   +        // correctly, even without the xsi:type attribute, because
>   +        // we set the return type manually.
>   +
>   +        Call call = new Call();
>   +        call.setTransport(new LocalTransport(server));
>   +        call.setReturnType(XMLType.XSD_DOUBLE);
>   +
>   +        Object result = call.invoke("TestService",
>   +                                    "serviceMethod",
>   +                                    new Object [] {});
>   +
>   +        assertTrue("Return value was not the expected type
> (Double)!",
>   +                    (result instanceof Double));
>   +    }
>   +
>   +    /**
>   +     * A method for our service, returning a double.
>   +     */
>   +    public double serviceMethod()
>   +    {
>   +        return 3.14159;
>   +    }
>
>        public static void main(String [] args) throws Exception
>        {
>            TestXsiType tester = new TestXsiType("test");
>            tester.testNoXsiTypes();
>   +        tester.testTypelessDeserialization();
>        }
>    }
>
>
>
>



Mime
View raw message