Apache flex [RPC Fault faultString=";HTTP请求错误";faultCode=";Server.error.request";faultDetail=";无法加载WSDL
遵守守则:Apache flex [RPC Fault faultString=";HTTP请求错误";faultCode=";Server.error.request";faultDetail=";无法加载WSDL,apache-flex,actionscript,builder,Apache Flex,Actionscript,Builder,遵守守则: <?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.e
<?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 Fault faultString=“HTTP请求错误”faultCode=“Server.error.request”faultDetail=“无法加载WSDL。如果当前处于联机状态,请验证WSDL的URI和/或格式(http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl)“]
我真的需要这方面的帮助。谢谢。当我键入url时”http://cmuicds.rutgers.edu/uicds/core/ws/services/DirectoryService?wsdl“在我的浏览器中,HTTP GET响应会提示我输入用户名和密码
mx:WebService使用的HTTP POST很可能也面临同样的障碍。我相信您需要解决身份验证问题。url受保护,我有用户名和密码。这是我从web service调用的方法的一部分:我甚至不认为您的应用程序正在进入我需要的阶段您无法实际调用web操作,因为您没有身份验证,服务器将您踢出。请查看并查看setCredentials的使用情况。我相信您将遇到“无法加载WSDL”,因为除非您提供适当的用户名和密码,否则服务器将不允许您访问它。