简体   繁体   English

如何将数据从一个Web服务发送到另一个?

[英]How to send data from one web service to another?

I have two Java web services deployed on Glassfish server, both inside the same web application. 我在Glassfish服务器上部署了两个Java Web服务,它们都在同一个Web应用程序中。 What is the easiest way to send an authorisation token (10 digit number) from one web service to another? 从一个Web服务向另一个Web服务发送授权令牌(10位数字)的最简单方法是什么?

Thanks. 谢谢。

That depends entirely on what you mean by send . 那完全取决于您发送的意思。

I assume that you just mean that you want to allow web service #2 to have access to the token generated by web service #1? 假设您只是想让Web服务#2有权访问由Web服务#1生成的令牌?

There are a few options here, but a couple that jump to mind are: 这里有一些选择,但是有两点让您想到:

These assume that you can key into the token somehow (via a user id or something). 这些假设您可以某种方式(通过用户ID或其他方式)键入令牌。

Additionally, this doesn't cover the duration for which the auth' token is considered valid and whether it should be valid when the app' is stopped/started/redeployed. 此外,这并不涵盖auth'令牌被视为有效的持续时间,也不会涵盖当app'停止/启动/重新部署时该令牌是否有效。 Above also doesn't consider load balancing or anything funky like that; 以上也不考虑负载平衡或类似的时髦; it's assuming that you're running a single Glassfish instance. 假设您正在运行一个Glassfish实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM