How to solve SAXException: Invalid element in

后端 未结 3 708
感情败类
感情败类 2020-12-21 09:03

I try to get results from a webservice in the following way.

List result = new Vector();
LibrarySearchRequest request = new LibrarySearchRequest(queryString)         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-21 09:39

    Workaround for this problem:

    Open your generated class(For this question it is librarysearch.soft.Book). See the static code block which defines the properties(name, type, etc.) of fields.

    You'll something like below:

    elemField.setXmlName(new javax.xml.namespace.QName("", "book"));
    

    change it by adding namespaceURI to it (use same namespameURI which is used at setXmlType call):

    elemField.setXmlName(new javax.xml.namespace.QName("http://your.namespaceuri.here", "book"));
    

提交回复
热议问题