我正在尝试从我的Flex应用程序调用Web服务,这是代码:
<mx:WebService id="myWebService"
wsdl="http://172.16.111.103:22222/cics/services/PRESENT1?wsdl">
<mx:operation name="PRESENT1Operation"
result="resultHandler(event)"
fault="faultHandler(event)">
</mx:operation>
</mx:WebService>
//将客户ID发送到wsdl请求的函数
private function searchDetails():void{
myWebService.PRESENT1Operation.send(cusNo.text);
cusDetails.visible=true;
}
Web服务已启动并正在运行。我有一个单独的Java应用程序来测试Web服务,我能够正确执行它。我可以请求Web服务并获得响应。
但是如果我尝试通过Flex应用程序调用Web服务,则会出现以下错误。
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://172.16.111.103:22222/cics/services/PRESENT1?WSDL)"]
at mx.rpc.wsdl::WSDLLoader/faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:98]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:225]
at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]
at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at DirectHTTPMessageResponder/errorHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:362]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()
请有人帮助我。
答案 0 :(得分:0)
在加载其他模块之前,应用程序无法加载应用程序
我希望这可能有用 var wsdlFile:String =&lt;&gt; var request:URLRequest = new URLRequest(wsdlFile); var loader:URLLoader = new URLLoader(); Loader.load方法(请求);
您可以通过输入附加的网址来获取完整路径?wsdl