1. wsimport 了一个wsdl 搞下来了一堆类放在了项目中
2. 导了axis 1.4的一堆包到项目中
3.                
                  TestClass tc=new TestClass();
                  String endpoint="http://10.10.66.124/testServer/testCollector.asmx";
String method="testMethod";
Service service=new Service();
Call call=(Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperation(method);
                  
                   List<TestClass> tcs=new ArrayList<TestClass>();
                   tcs.add(tc);
                   call.invoke(new Object[tcs]);然后就报错了:AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.io.IOException: No serializer found for class com.test.TestClass in registry org.apache.axis.encoding.TypeMappingDelegate@a6d51e
......等等一堆错吧  = = 
提供的方法应该是这样的 void testMethod(List<TestClass> ttt);
 

解决方案 »

  1.   

    1、看看TestClass是否实现了java.io.serializable接口
    2、对于自定义对象作为参数需要在wsdd文件中配置类型映射如
    <typeMapping qname="Person" type="java:com.sl.Person"
    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      

  2.   

    谢谢楼上二位我来解释一下是这样的 我现在调用的是别人搞的Webservice 小弟也是第一搞 不会弄啊TestClass 是 wsimport 后生成的类生成类并未标注需要serializable 我自己在类后面 implements serializable 后也是同样的情况 并没有改变啊最大的疑问就是wsdd 文件是在哪里配置的? 我在做客户端 需要搞这个文件么?