0
我有一個WS avaialbel @http://domain.com/Service?wsdl。 wsdl導入多個XSD定義。當我試圖調用服務,如下所示,我收到一個異常,說它無法找到服務器上的xsd的,這是好的,因爲xsd的不在那裏。我的問題是如何告訴WSClient從類路徑或文件系統解析xsd並忽略從服務器獲取它們?Groovy WSClient和文檔/文字WS
def proxy = new WSClient("http://domain/Service?wsdl", this.class.classLoader)
proxy.initialize()
Caused by: java.lang.reflect.InvocationTargetException
at org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:52)
... 19 more
Caused by: java.lang.RuntimeException: Error compiling schema from WSDL at {http://domain/Service/IcTransactionService?wsdl}: http://domain/Service/RequestImpl1-0.xsd
... 20 more
Caused by: java.io.FileNotFoundException: http://domain/Service/RequestImpl1-0.xsd
... 18 more
Caused by: java.io.FileNotFoundException: http://domain/Service/RequestImpl1-0.xsd
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1434)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.tools.internal.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:383)
... 16 more
謝謝你的帖子,但我已經知道這個解決方案的作品。我想知道是否可以以某種方式將架構提供給客戶端。 – 2011-05-20 18:18:20
@Pangea您可以將這些模式與您的客戶端jar捆綁在一起。 – 2011-05-20 18:23:24