I get a NullPointerException on the client when trying to serialize a bean
as a return value of a web-service call. TCPMonitor shows a correct response
XML on the wire, so the problems lies in the client. Am I messing up with
namespaces ? Any help appreciated.
java.lang.NullPointerException
at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.
java:207)
at
org.apache.axis.encoding.DeserializationContextImpl.startElemen(Deserializat
ionContextImpl.java:821)
.....
Very simple client Code below :
----------------------------------------------------------------------------
------------
String endpointURL = "http://localhost:7000/axis/services/Test";
Service service = new Service();
service.setMaintainSession(true);
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpointURL));
String methodName = "readJalla";
call.setOperationName(methodName);
QName qname = new QName("Test","Jalla");
Class cls = no.eposten.ime.api.Jalla.class;
call.registerTypeMapping(cls,qname,BeanSerializerFactory.class,BeanDeseriali
zerFactory.class);
call.addParameter("id", XMLType.XSD_STRING,ParameterMode.PARAM_MODE_IN);
call.setReturnType(qname);
no.eposten.ime.api.Jalla result = (no.eposten.ime.api.Jalla) call.invoke(
new Object[] {"test" } );
desply.wsdd below:
----------------------------------------------------------------------------
--------------
<deployment name="Test"
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="Test" provider="java:RPC">
<parameter name="className"
value="no.eposten.ime.api.API"/>
<parameter name="scope" value="session"/>
<parameter name="allowedMethods"
value="*"/>
<beanMapping qname="TestNS:Jalla" xmlns:TestNS="Test"
languageSpecificType="java:no.eposten.ime.api.Jalla"/>
</service>
</deployment>