WSDL to Java -client creation error

删除回忆录丶 提交于 2019-12-12 02:12:51

问题


I am trying to create a web service from the WSDL but is repeatedly giving me the following error. Tried refreshing axis.jar in the build path but is still giving same error whereas I have another WSDL and client is very well being generated for the same.

Anyone here who has encountered something similar?

IWAB0399E Error in generating Java from WSDL: WSDLException (at /definitions/types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at '@sp.schema.url@/FinancialStatement.xsd', relative to 'file:/C:/hrishi_workspace/findata/web/wsdl/FinancialStatement.wsdl'.: This file was not found: file:/C:/hrishi_workspace/findata/web/wsdl/@sp.schema.url@/FinancialStatement.xsd: java.io.FileNotFoundException: This file was not found: file:/C:/hrishi_workspace/findata/web/wsdl/@sp.schema.url@/FinancialStatement.xsd at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495) at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)

Thanks.

Rishi


回答1:


It looks as if your file:/C:/hrishi_workspace/findata/web/wsdl/FinancialStatement.wsdl is making a reference to an external schema file. If you look inside that WSDL file, under the definitions/types/xsd:schema element, you'll have one or more xsd:include and/or xsd:import. These elements may have a schemaLocation attribute; look for the one that ends in FinancialStatement.xsd; I suspect it has the @sp.schema.url@ in there which to me looks like a placeholder that is probably supposed to be changed by your build script or something else... Replace that with the relative path between the WSDL and XSD; if they are in the same folder, simply use the XSD file name. It should take care of the error. Once it works, you should try to understand what's with that placeholder, and maybe figure out what you need to configure in your particular environment to make it work like that...



来源:https://stackoverflow.com/questions/8344881/wsdl-to-java-client-creation-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!