调用 Web 服务时无法在 Flex 中加载 WSDL 文件错误

发布于 2024-08-28 04:09:46 字数 2048 浏览 6 评论 0原文

我正在尝试从 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>

//Function to send customer id to the wsdl request

 private function searchDetails():void{
            myWebService.PRESENT1Operation.send(cusNo.text);
            cusDetails.visible=true;
        }

Web 服务已启动并正在运行。我有一个单独的Java应用程序来测试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()

请有人帮我解决这个问题。

I am trying to call a webservice from my Flex application and this is the code:

 <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>

//Function to send customer id to the wsdl request

 private function searchDetails():void{
            myWebService.PRESENT1Operation.send(cusNo.text);
            cusDetails.visible=true;
        }

The webservice is up and running. I have a separate Java application to test the webservice, And I am able to execute it properly. I am able to request the webservice and get response.

But If I try to call the webservice through the Flex application, I get the following error.

 [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()

Please some one help me with this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南烟 2024-09-04 04:09:46

该应用程序无法加载,因为应用程序在加载其他模块之前启动

我希望这可能有用
var wsdlFile :String = <>;
var request:URLRequest = new URLRequest(wsdlFile);
var loader:URLLoader = new URLLoader();
加载器.load(请求);

您可以通过输入 URL 并附加 ?wsdl 来获取完整路径

The application is unable to load as the application starts before the other modules can be loaded

I hope this might be useful
var wsdlFile :String = <>
var request:URLRequest = new URLRequest(wsdlFile);
var loader:URLLoader = new URLLoader();
loader.load(request);

You can get the complete path by typing in the URL append it with ?wsdl

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文