简体   繁体   English

在同一连接上进行Web服务调用

[英]Making web service calls on the same connection

I'm working on a WSDL-based web service and using Apache Axis 2. I'm not an expert on web services, and the person I'm working with claims that in order for this particular web service to work two calls have to be made on the same connection, ie using http keep-alive (There's basically a "commit transaction" method that needs to be called after the "save" method). 我正在开发基于WSDL的Web服务并使用Apache Axis2。我不是Web服务方面的专家,并且与我合作的人声称,为了使此特定Web服务正常工作,必须进行两次呼叫可以在相同的连接上进行,即使用http keep-alive(基本上有一种“提交事务”方法,需要在“保存”方法之后调用)。 This seems like it would be a pretty common issue, but I haven't found anything on Google. 这似乎是一个很常见的问题,但是我在Google上还没有找到任何东西。

I'm wondering if there's a way to explicitly tell Axis to do this. 我想知道是否有一种方法可以明确地告诉Axis执行此操作。 Also, how could I verify whether or not two calls are indeed being made on the same connection. 另外,我如何验证同一连接上是否确实进行了两个呼叫。 I imagine some HTTP monitoring software like wireshark might be able to tell me this, but I haven't installed it yet. 我想像wireshark的一些HTTP监视软件也许可以告诉我这一点,但是我还没有安装它。

The person you are working with is wrong. 与您一起工作的人是错误的。 Even if HTTP can be optimized by using keep-alive to process multiple requests over a single TCP connection, this optimization should be transparent to the caller or callee, eg it should not matter if a client make two requests after each other on a keep-alive connection or if it's using two separate connections. 即使可以通过使用keep-alive在单个TCP连接上处理多个请求来优化HTTP,该优化对于调用方或被调用方也应是透明的,例如,客户端是否在keep-alpe上依次发出两个请求都无关紧要。活动连接,或者使用两个单独的连接。

Java libraries (HttpURLConnection on the client side and the servlet API on the server side) do not even offer access to this information, so that the using software cannot know how the HTTP requests are actually performed. Java库(客户端的HttpURLConnection和服务器端的Servlet API)甚至都不提供对此信息的访问权限,因此使用软件无法知道HTTP请求是如何实际执行的。

You can use nmap link text to see what is actually running on each port. 您可以使用nmap 链接文本查看每个端口上实际正在运行的内容。

But if you are making 2 calls at same time, axis2 will throw port is already binded error. 但是,如果您同时进行2次调用,则axis2会抛出端口已绑定错误。 Any port can't handle 2 requests at the same time (my opinion). 任何端口都不能同时处理2个请求(我认为)。 Maybe you can queue it and do it consecutively. 也许您可以将其排队并连续进行。 But just confirm with other sources as well. 但也要与其他来源确认。

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

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