910823-如何在Web服务中实现会话? [英] 910823 - how to implement sessions in web services?

查看:71
本文介绍了910823-如何在Web服务中实现会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我们有两种客户端,即Web客户端和作为客户端的应用程序.
现在,我们的应用程序像Web客户端一样通过调用index.php来模拟Web请求.我们希望将其更改为通过nusoap调用Web服务.但是有一个问题Web服务是无会话的.例如,调用Web服务进行身份验证.第二个服务在被调用时对身份验证没有任何意义,它完全是一个单独的调用.有人告诉我,我可能会放一些东西. http标头中的哈希码以包含通过身份验证提供的数据,以便下一个Web服务从标头读取数据并意识到该调用针对的是哪个会话.这样会发生类似会话模拟的事情.
我不太熟悉"http标头".我不知道该怎么办.总的来说,我想知道什么是最好的解决方案,以及nusoap是否在内部保留了会话之类的东西,以便我可以阅读Web服务中的内容?
你有什么建议?
thx

解决方案

会话在Web服务中不可用.但是您可以通过将id传递给被调用的方法来验证任何调用者的身份,也可以通过Java脚本将id作为查询字符串发布ID.


hi we''ve two kinds of clients, web client and an application which works as a client.
now our application simulates web requests by calling index.php as the web client does. we want to change it to calling web services via nusoap. but there''s a problem. web services are session-less. for example, a web service is called to authenticate. the second service when called has no sense about the authentication and it''s completely a separate call. someone told me that i may put something eg. a hash code in http headers to include the data provided via authentication so that the next web services read the data from header and realize the call has been for what session. this way something like session simulation occurs.
i''m not so familiar with ''http headers''. i don''t know how can i do that. in the whole, i like to know what may be the best solution and whether nusoap keeps something internally like sessions so that i may read the in web services?
what''s your suggestion?
thx

解决方案

Sessions are not available in webservices. but you can authenticate any caller by passing an id to the called method or post id as query string from java script.


这篇关于910823-如何在Web服务中实现会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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