简体   繁体   中英

Java Webservice testing

I provide a web service to my organisation. i was wondering would anyone recommeding the use of apache cactus for setting up a testing framework or has anyone worked with any other web service frameworks that may be useful?

Thanks Damien

As you are dealing with a web service you would not need to use Jakarta Cactus and could get away with writing plain old JUnit tests.

The tests would take two forms:

1. Does the underlying functionality work as expected?

This has nothing to do with the web service itself but the underlying functionality it provides. eg Does your Data access objects retrieve/process data correctly? Hopefully your web service interface and the underlying functionality are not tightly coupled.

2. Does the live web service (be it SOAP/REST/XMLRPC) function correctly?

In this case a good way to test this is to build a web service client and write tests to see whether this client works correctly against the web service. eg Use Axis/CXF/XFire to build the web service client and then write JUnit tests for the data it returns.

Also remember to target your testing towards what the end users of this web service will be using. If you have written a Java web service but it is being consumed by .Net clients then make sure you test the service against a .Net client. SOAP services are especially troublesome when it comes to consistent cross-platform behavior.

There is an open source application called SoapUI( http://www.soapui.org/ ). With this application, you can do 1) manual testing of webservices OR 2) use groovy (a java like scripting) language to do functional testing.

It works pretty well and a lot of organizations are using it. They have an open source version as well as a commercial (with more functionality and support) version. Check it out.

Apache于2011/08/05退休了Jakarta Cactus,因此不建议在任何新项目中使用它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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