我有一个https .net网络服务。使用soap UI之类的工具调用web方法效果很好。我无法从flex调用webmethod。我的WSDL在flex中加载得很好。
在部署时,我的flex应用程序和webservice在同一台服务器上。当使用机器url并从服务器内部访问时,它工作得很好,但当我使用flex应用程序的https url时就不行了。
Eg - http://machinename/flex/flexApp.html在https://publicname/wservice/ws.asmx上工作得很好,但https://publicname/flex/flexapp.html无法工作。
我有完全访问的跨域策略,并且我在服务器上有一个有效的SSL证书。
当我在调试模式下从本地机器进行调用时,我在Fiddler中看到了以下内容-
WSDL调用运行正常,并正确返回,协议显示为HTTPS,随后的webmethod调用将协议显示为HTTP,并返回错误-我在这方面已经坚持了很长一段时间。任何帮助都是非常感谢的。
谢谢,尼基尔。
下面是我调用它的Flex代码:
//business delegate
public function BusinessDelegate(responder : IResponder):void
{
_responder = responder;
_service = ServiceLocator.getInstance().getService("sqlWebService");
_service.loadWSDL();
}
//Login User
public function Login(userId:String,password:String):void
{
var asyncToken:AsyncToken = _service.LoginUser(userId,password);
asyncToken.addResponder(_responder);
}服务定位器具有以下标记,其中我从外部将URL设置为https://...。
<mx:WebService
id="sqlWebService"
useProxy="false"
concurrency="multiple"
showBusyCursor="true"
wsdl="{Url}"/>发布于 2011-08-27 01:10:43
我终于能够通过将调用对象的代码替换为webservice服务的特定类来解决这个问题。
我使用Import WebService(WSDL)为was服务生成了类,并在运行时将主类上的url设置为https://....。
它的工作方式就像一个charm...and,我在fiddler中看到,它正确地显示了我作为HTTPS而不是HTTPS发送出去。
这是对我有帮助的-- nated的http://livedocs.adobe.com/flex/3/html/help.html?content=security2_15.html评论。
感谢Flextras.com为我指明了正确的方向。已解决。
发布于 2013-01-18 00:12:19
如果在Flex中使用WCF服务和WebService,请对HTTPS使用service.svc?wsdl,
https://stackoverflow.com/questions/7198619
复制相似问题