从JavaScript(Ajax)调用安全WCF方法 [英] Calling Secure WCF Method from JavaScript (Ajax)

查看:53
本文介绍了从JavaScript(Ajax)调用安全WCF方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用服务器端的ScriptManager和JavaScript端的PageMethods来访问服务器上的WebMethod.这很好用,但是我现在切换到了WCF.是否可以以与调用Web方法相同的方式从JavaScript调用WCF方法?更复杂的是WCF服务是安全的,因此JavaScript将必须传递用户名和密码.你会怎么做?有这个例子吗?

My app uses a ScriptManager on the server side and PageMethods on the JavaScript side to access WebMethods on the server. This works well but I have switched over to WCF now. Is it possible to call WCF methods from JavaScript in the same way that you can call web methods? Where it gets more complicated is the WCF service is secure so the JavaScript will have to pass username and password across. How would you do this? Is there any examples of this?

为解决此问题,我要做的是在我的ASP项目中使用PageMethods来调用Web方法.他们依次调用WCF方法.这行得通,但是是一个不好的解决方法.我不希望客户端(浏览器)与ASP服务器通信,而后者又与WCF服务器通信.我希望客户端直接与WCF服务器对话.

What I have done to work around this problem is use PageMethods to call Web Methods in my ASP project. They in turn call WCF methods. This works but is a bad workaround. I don't want the client (browser) talking to the ASP server which in turn talks to the WCF server. I'd rather the client talk directly to the WCF server.

基督徒

推荐答案

事实上,我有同样的问题,但没有得到

任何解决方案

In fact i have the same problem , but not getting

any solution

Shweta


这篇关于从JavaScript(Ajax)调用安全WCF方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆