У меня есть WSDL-файл со мной и обслуживание тактично не так я хочу сделать макет службы из WSDL-файлаиз WSDL мы можем генерировать Java-файлы
Можно ли генерировать Java файлы из WSDL-файла? я попытался wsdl2java выиграть CXF, но он говорил ERROR
Сбой создания WSDL_definition
C:\Users\malnassar\Desktop\cxf3\apache-cxf-3.0.0-milestone1\bin>wsdl2java -impl ContributorSummaryService_1.wsdl
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: FAIL_TO_CREATE_WSDL_DEFINITION
C:\Users\malnassar\Desktop\cxf3\apache-cxf-3.0.0-milestone1\bin>wsdl2java ContributorSummaryService_1.wsdl
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: FAIL_TO_CREATE_WSDL_DEFINITION
C:\Users\malnassar\Desktop\cxf3\apache-cxf-3.0.0-milestone1\bin>wsdl2java ContributorSummaryService_1.wsdl
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: FAIL_TO_CREATE_WSDL_DEFINITION
C:\Users\malnassar\Desktop\cxf3\apache-cxf-3.0.0-milestone1\bin>
и попытался с WSDL2Java в axis1.6 он заканчивается с файл не найден исключением
C:\Users\malnassar\Desktop\axis2-1.6.2\bin>wsdl2java.bat -uri ContributorSummaryService_1.wsdl -o c:\WebService\ -uw
бревна
Использование
AXIS2_HOME: C:\Users\malnassar\Desktop\axis2-1.6.2 Using JAVA_HOME: C:\Program Files (x86)\Java\jdk1.6.0_33 Retrieving document at 'ContributorSummaryService_1.wsdl'. Retrieving schema at 'ContributorSummaryService_1_2.xsd', relative to 'file:/C:/Users/malnassar/Desktop/axis2-1.6.2/bin/ContributorSummaryService_1.wsdl'. log4j:WARN No appenders could be found for logger (org.apache.axis2.i18n.ProjectResourceBundle). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:178) at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'ContributorSummaryServ ice_1_2.xsd', relative to 'file:/C:/Users/malnassar/Desktop/axis2-1.6.2/bin/ContributorSummaryService_1.wsdl'.: java.io.FileNotFoundException: This file was not found: file:/C:/Users/malnassar/Desktop /axis2-1.6.2/bin/ContributorSummaryService_1_2.xsd 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 com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:320) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:133) ... 2 more Caused by: java.io.FileNotFoundException: This file was not found: file:/C:/Users/malnassar/Desktop/axis2-1.6.2/bin/ContributorSummaryService_1_2.xsd at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source) ... 13 more C:\Users\malnassar\Desktop\axis2-1.6.2\bin>
3. При попытке создать проект с SoapUI становится ниже ошибки
Error loading [file:\C:\Users\kpane\Desktop\ContributorSummaryService.xsd]: java.io.FileNotFoundException: C:\Users\kpane\Desktop\ContributorSummaryService.xsd (The system cannot find the file specified
Можете ли вы поделиться своей ошибкой с журналами при попытке выполнить wsdl2java? Сообщество не сможет помочь без дополнительной информации. – derdc
кажется, что файл ContirbutorSummaryService_1_2.xsd не находится там, где он должен быть. – Omar
@kapildas - еще один запрос. «WSDLRuntimeException: FAIL_TO_CREATE_WSDL_DEFINITION» не является само по себе, и я могу понять, почему вы не опубликовали его на начальном этапе. Не могли бы вы еще раз запустить «wsdl2java -impl ContributorSummaryService_1.wsdl -verbose»? – derdc