我使用MuleSoft XML Only SOAP Web Service示例获得了WSDL和Mule SOAP代理Web服务。 我的应用程序工作正常但如果我启用验证我有一个问题:当XSD存储在项目的根目录之外的任何地方时,它将无法解决。 我在/ src / main / resources中创建了服务文件夹和xsd, 但是,当调用该服务时,我收到以下错误:
connector.http.mule.default.receiver.02] org.apache.cxf.wstx_msv_validation.ResolvingGrammarReaderController: D:\Developer\Global\BODs\GetListSalesOrder.xsd (The system cannot find the path specified)
java.io.FileNotFoundException: D:\Developer\Global\BODs\GetListSalesOrder.xsd (The system cannot find the path)
这是我的骡子流..
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="test" doc:name="HTTP"/>
<cxf:proxy-service port="SyncSalesOrderBinding" namespace="http://www.cg.com/services/oagis/salesOrder" service="SyncSalesOrderService" validationEnabled="true" payload="body" wsdlLocation="services/WebServices/WSDL/SalesOrder.wsdl" doc:name="CXF">
<cxf:schemaLocations>
<cxf:schemaLocation>services/Developer/Global/BODs/GetListSalesOrder.xsd</cxf:schemaLocation>
</cxf:schemaLocations>
</cxf:proxy-service>
<logger message="Success" level="INFO" doc:name="Logger"/>
答案 0 :(得分:1)
如果您的XSD文件是在wsdl文件中导入的,则以下代码可以正常使用: -
<cxf:proxy-service port="SyncSalesOrderBinding" namespace="http://www.cg.com/services/oagis/salesOrder" service="SyncSalesOrderService" validationEnabled="true" payload="body" wsdlLocation="services/WebServices/WSDL/SalesOrder.wsdl" doc:name="CXF"/>
您不需要在CXF组件中提及您的XSD文件..它将验证
如果您仍然遇到任何问题,可以在此处找到补丁:https://www.mulesoft.org/jira/browse/MULE-5963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
....请你用附在JIRA上的那个替换你的罐子......它肯定会起作用