axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Carew <jca...@kana.com>
Subject BeanSerializer issue
Date Wed, 26 Jun 2002 20:21:23 GMT
I have a "Bean" that I am passing to the call object as an argument to my
service.  The code looks like this:
 
            Options options = new Options(args);
            String message = "Default message";
            if (options.isValueSet('m') != null )
            {
                message = options.isValueSet('m');
            }
            Environment env = new Environment();
            env.setProperty(env.REALMID,"1");
            env.setProperty(env.USERNAME,"me");
 
            Service service = new Service();
            Call call = (Call) service.createCall();
            QName qn = new QName("echoWSjava", "Environment" );
            call.registerTypeMapping(Environment.class, qn,
                                     BeanSerializerFactory.class,
                                     BeanDeserializerFactory.class);
            QName sqn = new QName("echoWSjava", "String" );
            String result;
 
            call.setTargetEndpointAddress( new
java.net.URL(options.getURL()));
            call.setOperationName( new QName("echoWSjava","echoMessage"));
            call.addParameter("arg1",sqn,ParameterMode.IN);
            call.addParameter("arg2",qn,ParameterMode.IN);
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
            result = (String) call.invoke(new Object[] { message,env } );

When Axis tries to get the serializer it falls to the getSerializerAs method
of BaseSerializerFactory and the tests in that method end up trying call
newInstance on the BeanSerializer class.  There is no default constructor in
BeanSerializer and a java.lang.InstantiationException:
org.apache.axis.encoding.ser.BeanSerializer exception is thrown (which is
caught at some point and eaten so you never see the error unless you go edit
Axis code and recompile, but that is another issue altogether).  Am I doing
something wrong in my code?  The Environment class I am using works fine
with Apache SOAP 2.3's BeanSerializer.
 
Thanks
Joe

Mime
View raw message