第一次弄学webservice 要实现一个提供查找的服务
服务端传的是单个对象的时候 客户端可以解析出来 但传的是list的话就出错了
[quote]org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Any type element type has not been given
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at hpdfs.filesearch.FileSearchStub.fromOM(FileSearchStub.java:26748)
at hpdfs.filesearch.FileSearchStub.searchFilebyanyattr(FileSearchStub.java:748)
at hpdfs.filesearch.Fileinfotest.main(Fileinfotest.java:21)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Any type element type has not been given
at hpdfs.filesearch.FileSearchStub$SearchFilebyanyattrResponse$Factory.parse(FileSearchStub.java:20317)
at hpdfs.filesearch.FileSearchStub.fromOM(FileSearchStub.java:26742)
... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Any type element type has not been given
at org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(ConverterUtil.java:1612)
at hpdfs.filesearch.FileSearchStub$SearchFilebyanyattrResponse$Factory.parse(FileSearchStub.java:20296)
... 3 more[/quote]
没看明白是缺少了什么类型的元素
请问如何实现对list的解析??
[b]问题补充:[/b]
[quote]
xs:complexType
xs:sequence
/xs:sequence
/xs:complexType
/xs:element[/quote]
主要是xml中返回的类型那不明确 显示的是anytype
我手动改成Arraylist之类的也不行
用wsdl2java的时候还是 missing * type
我把我的一个例子贴给你看一下
我的类是Customer,它的属性是id,username,password,sex,tel
[code="java"]
<?xml version="1.0" encoding="utf-8"?>
xs:complexType
xs:complexType
xs:sequence
/xs:sequence
/xs:complexType
/xs:element
/xs:choice
/xs:complexType
/xs:element
/xs:schema
[/code]
和解析XML文件的方法是一样的.
取的时候按字符串取出来.