views:

212

answers:

3

I'm using JAX-WS web services (client and exposed services), is there any API to test these web services?

+1  A: 
  • test the services out of their "web-service" context.
  • Use WSUnit to test consumers.
  • take a look at this article

Unit tests are meant to test units of code. They should test business logic, and not infrastructure. So this is not exactly "unit-testing" if you want to test the services within the web-service context.

Bozho
+1  A: 

JAX-WS web services are annotated POJOs so you can unit test them (in isolation) using a regular unit testing framework (JUnit, TestNG) and Mocks.

Pascal Thivent
@Downvoter Care to explain? Downvoting this answer is a pure joke (showing that you have no clue about what unit testing means BTW).
Pascal Thivent
A: 

For functional testing - you can use tools like soapUI (but I don't recommend this option because tests created with this tool are really hard to maintain). Other option (recommended) is using JUnit tests in which you create the service + client and exercise service methods. In our project we use Apache CXF and it works very well. It also supports JAX-WS.

For unit testing - "regular" JUnit, since generated service is Plain Java Object.

koppernickus