我尝试从以下方式一个Web服务得到结果。
List result = new Vector();
LibrarySearchRequest request = new LibrarySearchRequest(queryString);
LibrarySearchServicePortTypeProxy proxy =
new LibrarySearchServicePortTypeProxy();
LibrarySearchServicePortType port = proxy.getLibrarySearchServicePortType();
LibrarySearchResponse response = port.process(request);
librarysearch.soft.Book[] books = response.getBooks();
当我这样做,我得到了以下异常(堆栈跟踪):
org.xml.sax.SAXException: Invalid element in librarysearch.soft.Book - book
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at librarysearch.soft.LibrarySearchServiceSOAP11BindingStub.process(LibrarySearchServiceSOAP11BindingStub.java:180)
at softarch.portal.db.ws.WS_RegularDatabase.findRecords(WS_RegularDatabase.java:44)
at softarch.portal.db.test.TestWSRegularDatabase.main(TestWSRegularDatabase.java:39)
The regular database has caught an unexpected exception: ; nested exception is:
org.xml.sax.SAXException: Invalid element in librarysearch.soft.Book - book
我读的问题可以通过从WebService不是从WSDL生成的类匹配返回的结果造成的。 我再生我的web客户端,但没有更迭。 还有什么问题?