如何在wsdl中引用注册表中的xsd文件

时间:2012-06-28 11:47:54

标签: wso2 wso2esb

我希望r =读取我的WSDL中注册表中可用的xsd文件(这也是在注册表中)

<xsd:schema targetNamespace="http://www.example.org/SearchMember/">
        <xsd:import namespace="http://www.memsrch.com/req"
            schemaLocation="**./MemberSearchReq.xsd**" />
        <xsd:import namespace="http://www.memsrch.com/resp"
            schemaLocation="**./MemberSearchRep.xsd**" />
    </xsd:schema>

这是错误的,如下所示

  

引起:javax.wsdl.WSDLException:WSDLException(在/ wsdl:definitions / wsdl:types / xsd:schema):faultCode = PARSER_ERROR:解析'./MemberSearchRep.xsd'时出现问题:java.io.FileNotFoundException: C:\ wso2esb-4.0.3 \ wso2esb-4.0.3 \ MemberSearchRep.xsd(系统找不到指定的文件)       在com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2166)       在com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:845)       在com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:669)       在com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:630)       在com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:342)       在com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2320)       在com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2284)       在com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2337)       在com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2358)       在com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2390)       at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.readInTheWSDLFile(WSDL11ToAxisServiceBuilder.java:2318)       at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.setup(WSDL11ToAxisServiceBuilder.java:922)       在org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:309)       ......还有22个   引起:java.io.FileNotFoundException:C:\ wso2esb-4.0.3 \ wso2esb-4.0.3 \ MemberSearchRep.xsd(系统找不到指定的文件)       at java.io.FileInputStream.open(Native Method)       在java.io.FileInputStream。(FileInputStream.java:120)       在java.io.FileInputStream。(FileInputStream.java:79)       at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)       at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)       在org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(未知来源)       at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)       在org.apache.xerces.parsers.XML11Configuration.parse(未知来源)       在org.apache.xerces.parsers.XML11Configuration.parse(未知来源)       在org.apache.xerces.parsers.XMLParser.parse(未知来源)       在org.apache.xerces.parsers.DOMParser.parse(未知来源)       在org.apache.xerces.jaxp.DocumentBuilderImpl.parse(未知来源)       在com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2156)       ......还有34个

2 个答案:

答案 0 :(得分:1)

我不确定你是否解决了这个问题,如果没有,请参阅这篇博客文章,了解如何在导入XSD的注册表中设置wsdl:http://madhukaudantha.blogspot.nl/2012/07/wso2-esb-proxy-from-registry.html

问候,nidkil

答案 1 :(得分:0)

尝试删除“./”并确保XSD与WSDL位于注册表中的同一资源集合中。资源的名称应与schemaLocation中使用的名称相同。

请注意,请确保您没有嵌套XSD,因为注册管理机构目前不支持此项。

注意,nidkil