使可靠的Web服务不可靠,但以受控的方式进行? [英] Making a reliable web service unreliable, but in a controlled way?

查看:68
本文介绍了使可靠的Web服务不可靠,但以受控的方式进行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于Java 6的Web服务客户端,该客户端使用基于Java 6注释的标准方法(即没有Axis或其他第三方Web服务库),效果很好.我正在调用的Web服务也是如此,这很好,但是现在我需要编写错误处理代码,并且需要能够以可控的方式使现有Web服务变得不可靠.

I have a Java 6 based web service client using the standard Java 6 annotation based approach (i.e. no Axis or other third party web service library), which works very well. So does the web service I am calling, which is nice, but now I need to write error handling code, and I need to be able to make the existing web service unreliable in a controlled way.

有许多模拟框架,它们可能会有所帮助,但是我现在不需要能够使用预先记录的答案或其他任何东西模拟服务,只是引入了不可靠性,导致Web服务库失败,所以我可以优雅地处理情况.这可能是本地运行的代理服务器.

There are many mock frameworks, and they may be helpful, but I don't need right now to be able to mock out the service with prerecorded answers or anything, just introduce unreliability causing the web service library to fail so I can handle the situation gracefully. This would probably be a proxy server running locally.

我使用Eclipse Java EE 3.6,但也可以选择Netbeans,IntelliJ和JDeveloper.

I work with Eclipse Java EE 3.6, but Netbeans, IntelliJ and JDeveloper are also options.

做到这一点的最佳方法是什么?

What would be the best way to do this?

推荐答案

Tcpmon, http可以将://ws.apache.org/commons/tcpmon/index.html 设置为代理,甚至模拟慢速连接. 这将使您有机会模拟抱歉,不在这里"和是的,我们在这里,但我们超时了".

Tcpmon, http://ws.apache.org/commons/tcpmon/index.html can be set up to act as a proxy and even simulate slow connections. That would give you a chance to simulate both "sorry, not here" and "yes, we are here but we time out".

这篇关于使可靠的Web服务不可靠,但以受控的方式进行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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