java – 生成Web服务客户端时出现Apache意外的子元素异常
我正在尝试使用来自axis2(版本1.6.1)的wsdl2
java生成一个Web服务客户端.
./wsdl2java.sh -uri http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_snp.wsdl 当我打电话给这项服务时,我得到一个例外. org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:意外的子元素{http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp}Rs try { EFetchSnpServiceStub fetchService = new EFetchSnpServiceStub(); EFetchSnpServiceStub.EFetchRequest reqIdSnp = new EFetchSnpServiceStub.EFetchRequest(); reqIdSnp.setId("193925233"); EFetchSnpServiceStub.EFetchResult resIdSnp = fetchService.run_eFetch(reqIdSnp); } catch (Exception e) { System.out.println(e.toString()); } 但是在soaptest中,我可以在结果中看到Rs标签. <Rs rsId="193925233" snpClass="snp" snpType="notwithdrawn" molType="genomic" bitField="050000000005000000000100" taxId="3702"> 我该如何解决这个异常? WSDL不在我的控制之下. 解决方法
在ADB数据绑定类型的Axis2中,主要发生意外的子元素错误.当SOAP响应中的标记序列与由wsdl形成的java类中的属性序列不同时.
例如,
它可以通过更改wsdl中的标记序列来解决. 注意:If this is not the case,check here for other reasons (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |