SoapUI与Jav​​a Web Service客户端 [英] SoapUI vs Java Web Service Client

查看:145
本文介绍了SoapUI与Jav​​a Web Service客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果SOAP Web服务通过SoapUI正常运行(产生正确的SOAP响应),而在Java中使用不同的API/框架构建Web服务客户端以调用此Web服务时面临着不同的问题,那么可以安全地考虑一下Web服务稳定,问题出在消费者方面吗?

If a SOAP web service is working well via SoapUI (producing the correct SOAP responses), while building a web service client in Java using different APIs/frameworks to call this web service is facing different issues, is it safe to consider this web service stable and the issues are from the consumer side?

我在这里问一个通用的问题,我已经问了一个详细的问题,可能读起来太久了.我对这个概念的兴趣远胜于我的实际实现,因此,如果您可以回答我的问题而无需参考我的较长帖子,请这样做.

I'm asking a generic question in here, I have already asked a detailed one which is probably too long to read. I'm interested in the concept more than my actual implementation, so if you can answer my question without referring to my longer post, please do.

更新: 我已经意识到,即使WSDL符合WS-I,并且可以通过SoapUI正常运行,但这仍然不足以得出Web服务未损坏的结论.正如@jtahlborn所说,SoapUI非常能容忍损坏的Web服务,并且很容易使您误以为您的Web服务工作正常,这就是我的情况.

UPDATE: I have realized that even if the WSDL is WS-I compliant and it's functioning correctly via SoapUI, this is still not enough to conclude that the web service is not broken. As @jtahlborn said, SoapUI is very tolerant to broken web services, and it could easily trick you to believe your web service is working fine, which is what happened in my case.

我正在ESB中构造SOAP响应,我的问题是我使用了在WSDL中定义但在架构中未定义的名称空间. SoapUI收到响应并将其显示给我(使用错误的名称空间);如果我打开响应验证选项,就可以避免此问题.

I'm constructing the SOAP response in the ESB and my issue was that I used a namespace that was defined in the WSDL but not in the schema. SoapUI received the response and showed it to me (with the wrong namespace); this issue could have been avoided if I turned on the response validation option.

值得一提的是,在为测试Web服务而创建的Java Web Service客户端中,无法将响应加载到输出对象中(当我尝试访问输出对象时出现NullPointerException错误),这是由于命名空间问题引起的,一旦我修复了命名空间,它便可以正常工作.

It's also noteworthy to mention that in the Java web service client I created to test my web service, the response could not be loaded into the output object (a NullPointerException error showed up when I tried to access the output object), this was due to the namespace issue and it started working correctly once I fixed the namespace.

推荐答案

SoapUI是一个很棒的产品.然而,使之成为出色产品的原因之一是,它非常能够容忍定义不明确的网络服务.在我们的产品中,我们处理很多 Web服务,并且经常对我们产品中的一个问题发表评论:它在SoapUI中效果很好".我们已经学会了SoapUI容忍各种损坏的Web服务的艰难方法.因此,总而言之,使用SoapUI并不是 证明您的Web服务定义明确的证据.

SoapUI is a fantastic product. one of the things which makes it a great product, however, is that it is very tolerant of poorly defined webservices. in our product, we deal with lots of webservices, and a frequent comment on an issue in our product is "it works fine in SoapUI". we have learned the hard way that SoapUI will tolerate all kinds of broken webservices. so, in summary, working with SoapUI is not a proof that your webservice is well-defined.

这篇关于SoapUI与Jav​​a Web Service客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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