Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Not A Problem
-
2.7.2
-
None
-
Windows 7 x64
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing)
Description
I have a simple web service:
@WebService(endpointInterface = "by.dev.madhead.demowebapp.web.service.DemoService") @Service("DemoService") public class DemoServiceImpl implements DemoService { private Random random = new Random(new Date().getTime()); @Override public String getVersion() { return "1.0"; } @Override public Integer generateRandomNumber(Integer range) { return random.nextInt(range); } @Override public String sleepAndReturn(Integer milliseconds) throws InterruptedException { Thread.sleep(milliseconds); return milliseconds + " milliseconds slept."; } }
It is configured via Spring and runs inside a webapp:
<import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <context:component-scan base-package="by.dev.madhead.demowebapp.web.service" /> <jaxws:endpoint id="DemoServiceEndpoint" implementor="#DemoService" address="/DemoService" />
The webservice runs good. Then I've created a client:
public class Main { public static void main(String[] args) throws Exception { ApplicationContext context = new ClassPathXmlApplicationContext("context.xml", Main.class); DemoService service = (DemoService) context.getBean("DemoServiceClient"); System.out.println(service.sleepAndReturn(2000)); } }
<jaxws:client id="DemoServiceClient" serviceClass="by.dev.madhead.demowebapp.web.service.DemoService" address="http://localhost:8080/demo-webapp/DemoService" /> <http-conf:conduit name="*"> <http-conf:client ReceiveTimeout="3000" /> </http-conf:conduit> <http-conf:conduit name="{http://service.web.demowebapp.madhead.dev.by/}DemoServicePort.http-conduit"> <http-conf:client ReceiveTimeout="1000" /> </http-conf:conduit>
I've expect client to fail, as the most specific conduit config has timeout in 1000ms, but it tooks service 2000ms to answer. But It works fine, as wildcard conduit config is used. On the contrary, when I set wildcard conduit's timeout to 1000ms, and the second one to 3000 and call WS it fails, as wildcard config is used.
Is it correct behavior?