Hi there, I am using a JAXMServlet that implements the ReqRespListener interface. The allowed method is onMessage which takes a SOAPMessage parameter and returns a SOAPMessage object. When I tried hosting the JAXMServlet in Axis I got a serializer error. I specified a beanMapping and I was able to get the WSDL using which I generated proxy classes using WSDL2Java. I wrote a client which makes a call to the service using the stub, but it throws a NullPointerException. I believe I am using the wrong ser/deser. Could someone suggest the serializer I am supposed to use to ser/deser SOAPMessage objects? How do I go about writing my own serializer? I have started looking at the files in the samples folder for custom ser/deser examples, but would like to see a simple working example that would ser/deser SOAPMessages. I have copied below the error message I get on running my client. Thanks.
- Exception: java.lang.NullPointerException at org.apache.axis.Message.getContentDescription(Message.java:464) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.axis.utils.BeanPropertyDescriptor.get(BeanPropertyDescriptor.java:144) at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:207) at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1255) at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:795) at org.apache.axis.message.RPCParam.serialize(RPCParam.java:225) at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:387) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:174) at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270) at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:483) at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:375) at org.apache.axis.Message.getContentType(Message.java:399) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:341) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180) at org.apache.axis.client.Call.invokeEngine(Call.java:2564) at org.apache.axis.client.Call.invoke(Call.java:2553) at org.apache.axis.client.Call.invoke(Call.java:2248) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at localhost.axis.services.DataMarshallingService.DataMarshallingServiceSoapBindingStub.onMessage(DataMarshallingServiceSoapBindingStub.java:201) at test.TestService.main(TestService.java:63) AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.io.IOException: java.lang.NullPointerException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: java.io.IOException: java.lang.NullPointerException at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:262) at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1255) at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:795) at org.apache.axis.message.RPCParam.serialize(RPCParam.java:225) at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:387) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:174) at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270) at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:483) at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:375) at org.apache.axis.Message.getContentType(Message.java:399) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:341) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180) at org.apache.axis.client.Call.invokeEngine(Call.java:2564) at org.apache.axis.client.Call.invoke(Call.java:2553) at org.apache.axis.client.Call.invoke(Call.java:2248) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at localhost.axis.services.DataMarshallingService.DataMarshallingServiceSoapBindingStub.onMessage(DataMarshallingServiceSoapBindingStub.java:201) at test.TestService.main(TestService.java:63) java.io.IOException: java.lang.NullPointerException at org.apache.axis.AxisFault.makeFault(AxisFault.java:129) at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:272) at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:483) at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:375) at org.apache.axis.Message.getContentType(Message.java:399) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:341) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180) at org.apache.axis.client.Call.invokeEngine(Call.java:2564) at org.apache.axis.client.Call.invoke(Call.java:2553) at org.apache.axis.client.Call.invoke(Call.java:2248) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at localhost.axis.services.DataMarshallingService.DataMarshallingServiceSoapBindingStub.onMessage(DataMarshallingServiceSoapBindingStub.java:201) at test.TestService.main(TestService.java:63) Caused by: java.io.IOException: java.lang.NullPointerException at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:262) at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1255) at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:795) at org.apache.axis.message.RPCParam.serialize(RPCParam.java:225) at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:387) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:174) at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270) ... 16 more