3

我正在尝试在 CF10 中创建一个 Web 服务对象。我已经验证它在 SoapUI 中按预期工作。但是,当我在 CF 中运行它时,我收到一个错误,它无法找到在 WSDL 的导入语句中导入的 XSD。这是createObjectCF 中的调用和importWSDL 中的语句:


<cfset var ws = createObject("webservice", "https://XXXXXX.XXXX.net/billingandcollectionmgmt/billing/PaymentManagement_1.wsdl")

<xsd:import schemaLocation="PaymentManagement_1.xsd4.xsd" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
<xsd:import schemaLocation="PaymentManagement_1.xsd2.xsd" namespace="http://www.XXXXX.com/schemas/XXXXBilling/billingandcollectionmgmt/billing/PaymentManagement_1"/>


我得到的错误是因为它在我的本地 CF 安装的 /bin 位置中查找文件,而不是在与 WSDL 本身位于同一目录中的 Web 服务器上。通过使用上面提供的 URL 访问 XSD,我已经验证了 XSD 确实位于该目录中。即,该文件https://XXXXXX.XXXX.net/billingandcollectionmgmt/billing/PaymentManagement_1.xsd4.xsd确实存在。


这是堆栈跟踪:

javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'PaymentManagement_1.xsd4.xsd'.: java.io.FileNotFoundException: This file was not found: file:/C:/ColdFusion10/cfusion/bin/PaymentManagement_1.xsd4.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 coldfusion.xml.rpc.XmlRpcServiceImpl.getServiceInfoGenerator(XmlRpcServiceImpl.java:468)
    at coldfusion.xml.rpc.XmlRpcServiceImpl.generateServiceInfo(XmlRpcServiceImpl.java:372)
    at coldfusion.xml.rpc.XmlRpcServiceImpl.registerWebService(XmlRpcServiceImpl.java:317)
    at coldfusion.xml.rpc.XmlRpcServiceImpl.getWebServiceProxy(XmlRpcServiceImpl.java:679)
    at coldfusion.xml.rpc.WebServiceProxyFactory.getProxy(WebServiceProxyFactory.java:22)
    at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)
    at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:5747)
    at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5710)
    at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5644)
    at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5619)
    at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5566)
    at cfXXXXPayments2ecfc1210176705$funcDELETEPAYMENT.runFunction(C:\ColdFusion10\cfusion\wwwroot\XXXXPayments.cfc:74)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659)
    at cfXXXXPayments2ecfc1210176705$funcDELETEPAYMENTS.runFunction(C:\ColdFusion10\cfusion\wwwroot\XXXXPayments.cfc:64)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)
    at cftestPending2ecfm428388279.runPage(C:\ColdFusion10\cfusion\wwwroot\testPending.cfm:3)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:443)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
    at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
    at coldfusion.CfmServlet.service(CfmServlet.java:204)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: This file was not found: file:/C:/ColdFusion10/cfusion/bin/PaymentManagement_1.xsd4.xsd
    at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
    ... 74 more

问题是,有谁知道为什么 ColdFusion 可能会在我的本地计算机上而不是在文件实际所在的 Web 服务器上查找文件?

4

1 回答 1

3

使用 Miguel 的建议,我将代码更改为 usecfhttp和他之前的答案中的代码片段。用我的 SoapUI 请求中的内容替换 <soapenv:Envelope> </soapenv:Envelope>解决了我的问题。

于 2013-10-02T18:08:16.800 回答