On Jan 6, 2013, at 7:01 PM, Mert ÇALIŞKAN <[email protected]> wrote:

> Hi,  
> 
> In my project I have a couple of external web services with the WSDL files 
> specified. I generated client with cxf-codegen-plugin
> successfully and invoked the web services from a spring facade. 
> 
> What I want to do is to do an integration test on this facade. What's the 
> best way to achieve this? I want to stub the external web service and I want 
> to return the same soap response each time I call my facade. So I can test 
> the actual web service call within my integration tests.
> 
> For inbound services (the services that I'm exposing to the outside world) 
> I'm using an embedded jetty to get the web app context up and running and 
> requesting the actual web services from that embedded jetty. 

One "easy" way would be to write something like a subclass of 
Povider<SOAPMessage> or similar that would return the proper soap messages.   
You can spin an instance of that up on an embedded Jetty instance on some port 
and just make calls against it.   

We do things things similar to that in some of our tests.  An example could be:

https://svn.apache.org/repos/asf/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java



Dan



> 
> Thanks,
> 
> Mert. 
> 

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to