• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Unit Testing Web Services

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

We have a project that uses JAX-WS and JAXB for webservices.
We want to write Junit Test cases for testing web services.

The client side i.e. Junit will need stubs to be generated to test the actual web service using tool wsgen. We want to automate this process of generating stubs in a standard manner using Ant Build script.

Can anyone share a sample build script that is generating these artifacts. Please share the same.

Also share a standard practice for unit testing web services.

Thanks
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Also share a standard practice for unit testing web services.



Basically ours are text/xml based webservices -- meaning that the response we expect does not contain binary data. For unit testing this we use a simple Http Request/Response client. We feed this client with the URL of the webservice and the request XML and that is fired over an HTTP connection to the URL. The response XML is then displayed and we can compare it to what we expect it to be.

It would be insightful to know how the developers go about testing their web services...
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are some good resources that you can Google on this including:

Dr Dobbs article

WSUnit - A JUnit for web services
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic