Greetings -
I'm fairly new to WS and Axis but this is the first real brick wall I've run into. I was able to deploy a test WS with a single trivial method but when I tried to deploy another service that returned complex objects I received the following error:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.apache.axis.deployment.wsdd.WSDDException: javax.xml.rpc.JAXRPCException: Null serializer factory specified.
javax.xml.rpc.JAXRPCException: Null serializer factory specified.
at org.apache.axis.encoding.TypeMappingImpl.register(TypeMappingImpl.java:220)
at org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:540)
at org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:245)
at org.apache.axis.deployment.wsdd.WSDDService.<init>(WSDDService.java:225)
at org.apache.axis.deployment.wsdd.WSDDDeployment.<init>(WSDDDeployment.java:204)
at org.apache.axis.deployment.wsdd.WSDDDocument.<init>(WSDDDocument.java:78)
at org.apache.axis.utils.Admin.processWSDD(Admin.java:110)
<etc...>
Okay, all you gurus out there..... what stupid newbie mistake am I making?
I'm using Axis 1.2RC1and Tomcat 5.0.28 running within NetBeans 4.0 Beta 2. Here's all the important snippets of stuff...
I first defined a package which contains javabeans for all my complex objects. All method results are either a javabean or an array of javabeans. I then defined an interface that describes the WS methods and used the Ant task "axis-java2wsdl" as shown below:
<axis-java2wsdl classname="com.symantec.dim.WSApi"
location="http://localhost:8084/axis/services/DIMServlet"
namespace="http://dim.symantec.com"
output="${build.dir}/gen/DIMServlet.wsdl"
style="RPC">
<classpath .../>
</axis-java2wsdl>
Next I used the Ant task "axis-wsdl2java" to generate the server-side stubs (skeletons):
<axis-wsdl2java deployscope="Application"
skeletondeploy="true"
output="${build.dir}/gen"
url="">
serverside="true"
noimports="false"
verbose="true"
testcase="false">
</axis-wsdl2java>
Finally, I copy all my classes (com.symantec.dim and com.symantec.dim.beans packages) to the "<tomcatbase>/webapps/axis/WEB-INF/classes" directory and then use the Ant task "axis-admin" to deploy the service:
<axis-admin hostname="localhost"
port="8084"
servletpath="axis/services/AdminService"
failonerror="true"
debug="true"
xmlfile="${build.dir}/gen/com/symantec/dim/deploy.wsdd"/>
The typical entries in the WSDD look like this (all of the entries are either BeanSerializerFactory or ArraySerializerFactory):
<typeMapping
xmlns:ns="http://beans.dim.symantec.com"
qname="ns:ChangeLog"
type="java:com.symantec.dim.beans.ChangeLog"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
<typeMapping
xmlns:ns="http://dim.symantec.com"
qname="ns:ArrayOf_tns1_ChangeLog"
type="java:com.symantec.dim.beans.ChangeLog[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>