简体   繁体   English

基于SOAP的Web服务的集成测试

[英]Integration test for SOAP based web service

We have a webservice deployed at https://<hostname>:<port>/app?wsdl . 我们在https://<hostname>:<port>/app?wsdl部署了一个Web服务。

I need to set up a maven project to write integration testing suite for the apis. 我需要建立一个Maven项目来为api编写集成测试套件。 Are there any framework to do this kind of testing easily for a wsdl based web service? 是否有任何框架可以对基于wsdl的Web服务轻松进行这种测试?

I used a time ago Apache-CXF for the integration tests. 我前一段时间使用Apache-CXF进行集成测试。

It basically creates a Java client for a WebService, meaning interfaces and model classes are available in Java and you can use them as other normal Java implementation. 它基本上为WebService创建Java客户端,这意味着接口和模型类在Java中可用,您可以将它们用作其他常规Java实现。

In order to generate the sources from a WSDL you need to run the CXF script giving the WSDL address. 为了从WSDL生成源,您需要运行提供WSDL地址的CXF脚本。 A Java package will be created with all classes / interfaces needed. 将使用所需的所有类/接口创建一个Java包。 In my case I just generated a JAR from the WS (check -clientjar parameter in the command line documentation). 就我而言,我只是从WS生成了一个JAR(在命令行文档中检查-clientjar参数)。

Once the WebService changes you just need to regenerate the classes and interfaces again with the same command used at the first time and implement additional tests. WebService更改后,您只需要使用第一次使用的相同命令再次重新生成类和接口,并实施其他测试。

Maven Integration Maven整合

To start using it within a maven project, you can check here . 要在Maven项目中开始使用它,可以在此处进行检查。 And the same functionality you have with the command line (in order to generate the java sources from a WSDL) you have with a maven plugin documented here . 以及与命令行相同的功能(以便从WSDL生成Java源代码)与此处记录的maven插件具有相同的功能。

SoapUI offers a comprehensive suite for testing the the WSDL based web services. SoapUI提供了一套全面的套件来测试基于WSDL的Web服务。 It has a nice UI and very well integrated with the tools like Maven . 它具有一个不错的UI,并且与Maven之类的工具很好地集成在一起 I would recommend SOAPUI. 我会推荐SOAPUI。

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

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