开发者

Invoking HTTPS webservice from flex

I have an https .net webservice. Invoking web methods using tools like soap UI works fine. I am unable to invoke the webmethod from flex. My WSDL loads up fine in flex.

On deployment my flex application and the webservice are on the same server. When use the machine url and access from within the server it works fine, but not when I use the https url for the flex application.

Eg - http://machinename/flex/flexApp.html works fine with https://publicname/wservice/ws.asmx but https://publicname/flex/flexapp.html fails to work.

I have the crossdomain policy in place with full access and also I have a valid SSL certificate on the server.

When I make the call from my local machine in debug mode I see the following in Fiddler-

The WSDL call goes fine and returns back correctly and the Protocol is shown as HTTPS where as the webmethod call following it shows the protocol as HTTP and returns back with the error - I have been stuck on this for quite some time. Any help is greatly appreciated.

Thanks, Nikhil.

Here is my Flex code that calls it:

//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);
    }

and the service locator has the following tag where I set the URL from outside as https://....

<mx:WebService 
    id="sqlWebService" 
    useProxy="false" 
    concurrency="multiple"
    showBusyCursor="true"
    wsdl="{Url}"/>


I finally was able to resolve this problem by replacing the code where I call the Flex WebService object with the specific generated classes for the webservice.

I generated classes for the webservice using Import WebService(WSDL) and was setting the url on the main class on run time as https://.....

and it works like a charm...and I see that in fiddler it shows me correctly going out as HTTPS instead of the HTTP.

Here is what helped me - http://livedocs.adobe.com/flex/3/html/help.html?content=security2_15.html Comment by nated.

Thanks Flextras.com for pointing me to right direction. Resolved.


If using WCF service and WebService in Flex, use service.svc?wsdl for HTTP and service.svc/wsdl?wsdl for HTTPS,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜