axis1.4调用webservice 传递自定义对象参数出错

调用客户端后出现:
org.xml.sax.SAXException: Invalid element in cn.services.QueryEquipmentRequest - queryEquipmentRequest

客户端代码(其中queryEquipmentRequest,QueryEquipmentResponse是我自定义的对象):
call.addParameter(new QName(nameSpace, "queryEquipmentRequest"), new QName(nameSpace, "queryEquipmentRequest"), ParameterMode.IN);
// // @@需修改成对应的输出参数名
call.setReturnType(new QName(nameSpace, "queryEquipmentResponse"),
QueryEquipmentResponse.class);
//

// // 需要根据xsd生成的bean,对输入输出的XSD文件定义的类型进行注册映射关系
//// // @@如本服务输入输出XSD文件中有四个自定义类型 queryEquipmentRequest、queryEquipmentResponse、deviceItem、deviceItemList,配置如下
QName queryEquipmentRequest = new QName(nameSpace, "queryEquipmentRequest");
call.registerTypeMapping(QueryEquipmentRequest.class, queryEquipmentRequest,
new BeanSerializerFactory(QueryEquipmentRequest.class,
queryEquipmentRequest), new BeanDeserializerFactory(
QueryEquipmentRequest.class, queryEquipmentRequest));
//
QName queryEquipmentResponse = new QName(nameSpace, "queryEquipmentResponse");
call.registerTypeMapping(QueryEquipmentResponse.class, queryEquipmentResponse,
new BeanSerializerFactory(QueryEquipmentResponse.class,
queryEquipmentResponse), new BeanDeserializerFactory(
QueryEquipmentResponse.class, queryEquipmentResponse));

服务端的wsdl文件为:

<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->wsdl:types/wsdl:types/wsdl:message/wsdl:message/wsdl:operation/wsdl:portType/wsdl:input/wsdl:output/wsdl:operation/wsdl:binding /wsdl:port/wsdl:service/wsdl:definitions

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问