从网络服务(asmx)调用Javascript [英] call Javascript from web service (asmx)

查看:134
本文介绍了从网络服务(asmx)调用Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想从Web服务中调用javascript.我正在做什么,我确实在用JavaScript调用了Web服务中对字符串进行加密,所以现在我想在Web Service中解密信息

Hi Guys please help or Advise, i want to call a javascript from web service.what im doing is i do encrypt a string in javascript calling the web service, so now i want to decrypt the information in a web service

推荐答案

Web服务在服务器上运行,并且您那里没有Javascript. (嗯,从技术上讲,您可以运行脚本引擎并调用它,但不要这样做.)

如果它似乎是出于算法目的,那么您将需要将该函数转换为服务语言(可能是C#).

另外,如果只是为了保护通信,则可以通过HTTPS调用您的Web服务,并完全放弃自定义编码.请记住,如果您将代码作为JS交付给客户端,他们可以对它进行反向工程,然后对被拦截的数据应用相同的解密技术,除非密钥不为他们所知.
The web service runs on the server and you don''t have Javascript there. (Well, technically you could run up the scripting engine and call out to it, but don''t do that.)

If it''s for an algorithmic purpose, as it seems to be, you will need to translate the function to the service language (C# probably).

Alternatively, if it''s just to protect communication, you can call to your web service over HTTPS and ditch the custom encoding completely. Remember, if you''re shipping the code to the client as JS, they can reverse engineer it and then apply the same decryption technique to intercepted data, unless the key is not known to them.


这篇关于从网络服务(asmx)调用Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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