[RPC错误faultString =“HTTP请求错误”错误代码=“服务器.错误.请求” failureDetail="无法加载 WSDL

发布于 2024-11-30 11:46:39 字数 2752 浏览 3 评论 0 原文

遵循代码:

   <?xml version="1.0" encoding="utf-8"?>
   <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

   <mx:WebService id="DirectoryService" 
        useProxy="false"  
        wsdl="http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl"> 
    <mx:operation name="GetIncidentList"                
        makeObjectsBindable="true" 
        resultFormat="object" 
        result="onResult(event)" 
        fault="onFault(event)"/>
   </mx:WebService>

    <mx:ApplicationControlBar dock="true">
    <mx:Button id="button"
            label="Get incidents from web service"
            click="button_click()"/>
       <mx:ComboBox id="cmb" dataProvider="{incedents}" labelField="name" width="241" height="24"/>
       <mx:TextArea id="textArea" x="10" y="40" width="616" height="61"/>
    </mx:ApplicationControlBar>

   <mx:Script>
       <![CDATA[
        import mx.controls.Alert;
        import flash.utils.ByteArray;
        import mx.rpc.events.ResultEvent;
        import mx.rpc.events.FaultEvent;
        import mx.utils.ObjectUtil;
        import mx.collections.ArrayCollection;
        import mx.rpc.soap.mxml.WebService;

        [Bindable] private var incedents:ArrayCollection;
        private var flag:Boolean;
        //[Bindable] private var arr:Array = new Array("http://uicds.org/DirectoryService", "GetIncidentListRequest");
        //private var byte:ByteArray;

        private function button_click():void 
        {
            //DirectoryService.GetIncidentList("http://uicds.org/DirectoryService", "GetIncidentListRequest").send();

            //DirectoryService.port = 443;
            DirectoryService.endpointURI = "https://cmuicds.rutgers.edu:443/uicds/core/ws/services/DirectoryServiceService";
            DirectoryService.GetIncidentList("GetIncidentListRequest");

            flag = DirectoryService.canLoadWSDL();
            Alert.show("Testing....." + flag); 

        } 

         private function onResult(evt:ResultEvent):void 
         {
            incedents = evt.result as ArrayCollection;
            Alert.show("Is data comming in? " + incedents);
            textArea.text = ObjectUtil.toString(evt.result);
        }

         private function onFault(evt:FaultEvent):void 
         {
            Alert.show(evt.fault.faultString);                
         }

       ]]>
   </mx:Script>

</mx:Application>

当我运行它时,它给我一个以下错误: [RPC故障faultString =“HTTP请求错误”faultCode =“Server.Error.Request”faultDetail =“无法加载WSDL。如果当前在线,请验证WSDL的URI和/或格式(http://cmuicds.rutgers) .edu/uicds/core/ws/services/DirectoryService?wsdl)"]

我真的需要这方面的帮助。谢谢。

following the code:

   <?xml version="1.0" encoding="utf-8"?>
   <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

   <mx:WebService id="DirectoryService" 
        useProxy="false"  
        wsdl="http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl"> 
    <mx:operation name="GetIncidentList"                
        makeObjectsBindable="true" 
        resultFormat="object" 
        result="onResult(event)" 
        fault="onFault(event)"/>
   </mx:WebService>

    <mx:ApplicationControlBar dock="true">
    <mx:Button id="button"
            label="Get incidents from web service"
            click="button_click()"/>
       <mx:ComboBox id="cmb" dataProvider="{incedents}" labelField="name" width="241" height="24"/>
       <mx:TextArea id="textArea" x="10" y="40" width="616" height="61"/>
    </mx:ApplicationControlBar>

   <mx:Script>
       <![CDATA[
        import mx.controls.Alert;
        import flash.utils.ByteArray;
        import mx.rpc.events.ResultEvent;
        import mx.rpc.events.FaultEvent;
        import mx.utils.ObjectUtil;
        import mx.collections.ArrayCollection;
        import mx.rpc.soap.mxml.WebService;

        [Bindable] private var incedents:ArrayCollection;
        private var flag:Boolean;
        //[Bindable] private var arr:Array = new Array("http://uicds.org/DirectoryService", "GetIncidentListRequest");
        //private var byte:ByteArray;

        private function button_click():void 
        {
            //DirectoryService.GetIncidentList("http://uicds.org/DirectoryService", "GetIncidentListRequest").send();

            //DirectoryService.port = 443;
            DirectoryService.endpointURI = "https://cmuicds.rutgers.edu:443/uicds/core/ws/services/DirectoryServiceService";
            DirectoryService.GetIncidentList("GetIncidentListRequest");

            flag = DirectoryService.canLoadWSDL();
            Alert.show("Testing....." + flag); 

        } 

         private function onResult(evt:ResultEvent):void 
         {
            incedents = evt.result as ArrayCollection;
            Alert.show("Is data comming in? " + incedents);
            textArea.text = ObjectUtil.toString(evt.result);
        }

         private function onFault(evt:FaultEvent):void 
         {
            Alert.show(evt.fault.faultString);                
         }

       ]]>
   </mx:Script>

</mx:Application>

when i run it it gives me a 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://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl)"]

I really need help on this.Thanks.

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

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

发布评论

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

评论(1

救星 2024-12-07 11:46:39

当我在浏览器中输入 URL“http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl”时,HTTP GET 响应会提示我输入用户名和密码。

mx:WebService 使用的 HTTP POST 很可能也面临着同样的障碍。我相信您需要解决身份验证问题。

When I type the url "http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl" into my browser, the HTTP GET response prompts me for a username and password.

Chances are that an HTTP POST which is what mx:WebService is using is facing the same obstacle too. I believe you need to address that authentication problem.

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