简体   繁体   English

使用 wsdl 创建服务器进行集成测试

[英]Use wsdl to create server for integration testing

I have a WSDL file from a server that implements some webservices.我有一个来自实现一些 web 服务的服务器的 WSDL 文件。 I have created client-code with Axis2, but want to build some integration tests that deal with server-timouts.我已经使用 Axis2 创建了客户端代码,但想构建一些处理服务器超时的集成测试。

To do that, I want to create a server-stub and have the methods just sleep longer than the configured client-timeout.为此,我想创建一个服务器存根,并让这些方法的sleep时间比配置的客户端超时时间长。

Is there an easy way to generate an scaffold-like server running the services from the WSDL?有没有一种简单的方法来生成一个类似脚手架的服务器,从 WSDL 运行服务?

Since you are already using Axis2, you can use WSDL2Java to generate the server skeleton code to which you can then add your own testing code.由于您已经在使用 Axis2,您可以使用WSDL2Java生成服务器框架代码,然后您可以向其中添加您自己的测试代码。 By default WSDL2Java generates client code, but it can be used both ways with the server arguments.默认情况下,WSDL2Java 生成客户端代码,但它可以与服务器 arguments 双向使用。

Another approach would be to create a SoapUI mock service to which you could add Groovy scripts to make it more dynamic.另一种方法是创建一个SoapUI 模拟服务,您可以向其中添加 Groovy 脚本以使其更具动态性。

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

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