2010-02-01 160 views
3

我有以下wsdl:http://pastie.org/804441。我用wsdl得到以下錯誤。我在一個名爲XAware的工具中使用它,它是一個數據集成工具。解析WSDL消息時出錯

這個問題不是關於XAware。只要看看下面的錯誤和wsdl文件,它是否表明WSDL即時通訊使用的問題還是我的WSDL問題?

請幫忙。 謝謝。

錯誤消息(錯誤解析WSDL)

org.xaware.shared.util.XAwareException:對於模式 「http://www.w3.org/2001/XMLSchema」 的定義是沒有在WSDL文件中。請在此文件中定義它,或者使用import語句從包含模式定義的其他文件中導入import.at org.xaware.ide.xadev.wizard.BizDocumentWizard $ SelectGrammarFilePage.getSchemURI(Unknown Source)at org.xaware.ide.xadev.wizard .BizDocumentWizard $ SelectGrammarFilePage.getOutputMessageSchema(來源不明)在org.xaware.ide.xadev.wizard.BizDocumentWizard $ SelectGrammarFilePage.parseWSDLFile(來源不明)在org.xaware.ide.xadev.wizard.BizDocumentWizard $ SelectGrammarFilePage.access $ 000(來源不明)在org.xaware.ide.xadev.wizard.BizDocumentWizard $ SelectGrammarFilePage $ 2.selectionChanged(來源不明)在org.eclipse.jface.viewers.Viewer $ 2.run(Viewer.java:162)在org.eclipse.core.runtime .SafeRunner.run(SafeRunner.java:37)在org.eclipse.core.runtime.Platform.run(Platform.java:880)在org.eclipse.ui.internal.JFaceUtil $ 1.run(JFaceUtil.java:48)在org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)上的org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)在org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2062)在org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1638)在org.eclipse.jface.viewers.TreeViewer.setSelection (TreeViewer.java:1104)at org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.setVisibleHelper(SelectSingleFileView.java:377)在org.xaware.bizdocgenerator.dialogs.SelectFileOrXMLCatalogIdPanel.setVisibleHelper(來源不明)在組織.xaware.ide.xadev.wizard.BizDocumentWizard $ SelectGrammarFilePage.setVisible(來源不明)在org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1161)在org.eclipse.jface.wizard.WizardDialog.access $ 2 (WizardDialog.java:1139)在org.eclipse.swt.custom.BusyIndi​​cator.showWhile(BusyIndi​​cator.java:70)上的org.eclipse.jface.wizard.WizardDialog $ 4.run(WizardDialog.java:1128) .jface.wizard.WizardDialog.showPage(WizardDialog.java:1126)at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:820 )在org.eclipse.swt.widgets.TypedListener的org.eclipse.jface.dialogs.Dialog $ 2.widgetSelected(Dialog.java:624)處的org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:369) .handleEvent(TypedListener.java:228)在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)在有機eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)at org.eclipse.jface.window.Window.runEventLoop(Window。 java:825)在org.xaware.ide.xadev的org.eclipse.jface.window.Window.open(Window.java:801)org.xaware.ide.xadev.wizard.BizDocumentWizard.showDialog(Unknown Source)。 gui.actions.CreateBizDocFromWSDLAction.run(來源不明)在org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)在org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)在org.eclipse.jface.action.ActionContributionItem.a在org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)處使用org.eclipse.jface.action.ActionContributionItem $ 5.handleEvent(ActionContributionItem.java:411)獲取$ 2(ActionContributionItem.java:500) .eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)at org.eclipse.swt.widgets.Display.readAndDispatch(Display的.java:3422)在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)在org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)在org.eclipse.ui。 internal.Workbench.access $ 4(Workbench.java:2198)在org.eclipse.ui.internal.Workbench $ 5.run(Workbench.java:493)在org.eclipse.core.databinding.observable.Realm.runWithDefault(境界。 java:288)在org.eclipse.ui.internal.Workbench。在org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)上的createAndRunWorkbench(Workbench.java:488) .eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)上的org.eclipse.core.runtime .internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect。 Method.invoke(Unknown Source)at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)at org.eclipse.equinox.launcher.Main.basicRun(Ma in.java:504)at org.eclipse.equinox.launcher.Main.run(Main.java:1236)at org.eclipse.equinox.launcher.main.main(Main.java:1212)

回答

0

它是我的理解是<import/>聲明必須包含schemaLocation屬性。 import語句(如果確實需要的話)應該是這個樣子:

<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="soapenc.xsd" /> 
+0

感謝您的答覆凱文。當我這樣做時,我得到:「WSDLException(at/wsdl:definitions/wsdl:types/schema [1]):faultCode = OTHER_ERROR:嘗試解析'soapenc.xsd'引用的相對於'file: /C:/XAware_5.4.0.356/designer/workspace/Imaginary Corporation/CompiereService/NewWSDLFile.wsdl'.:未找到該文件:file:/ C:/XAware_5.4.0.356/designer/workspace/Imaginary Corporation/CompiereService/soapenc.xsd:java.io.FileNotFoundException:未找到此文件:file:/ C:/XAware_5.4.0.356/designer/workspace/Imaginary Corporation/CompiereService/soapenc.xsd – Tim 2010-02-01 19:35:00

+0

Tim,該文件(soapenc。 xsd)必須實際存在或是對有效模式的引用,實際上我只是將這個特定的導入保留下來,我不認爲你需要它。 – Kevin 2010-02-01 19:42:02

+0

感謝Kevin指出了這一點。我下載了soapenc.xsd並放置它在所需的位置,以便錯誤消失。但現在,我收到錯誤消息「org.xaware.shared.util.XAwareException:T他定義的模式「http://www.w3.org/2001/XMLSchema」在wsdl文件中不可用。請在此文件中定義它,或者使用import語句從其他包含模式定義的文件導入「。對於此問題抱歉,但有什麼方法可以修復? – Tim 2010-02-01 19:48:59

1

該工具可能會搞不清楚,因爲該架構的分配兩個前綴爲「http://www.w3.org/2001/XMLSchema」命名空間:在根元素都「XSD」:

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

和默認的(即無前綴)中的每個「模式「元素:

xmlns="http://www.w3.org/2001/XMLSchema" 

根據軟件如何處理這種情況,它可能會咳嗽在它上面。無論如何,這是值得修復的東西,除非它能讓WSDL更易於閱讀。

<xsd:schema> 

優於

<schema targetNamespace="http://compservice.com" xmlns="http://www.w3.org/2001/XMLSchema"> 
+0

要麼執行Gabriel建議或從wsdl:定義中除去xmlns:xsd聲明。這應該工作我相信。 – anirvan 2010-09-03 13:03:06