You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Siarhei (JIRA)" <ji...@apache.org> on 2013/01/17 19:50:12 UTC
[jira] [Created] (CXF-4763) Http conduit configuration overriding.
Siarhei created CXF-4763:
----------------------------
Summary: Http conduit configuration overriding.
Key: CXF-4763
URL: https://issues.apache.org/jira/browse/CXF-4763
Project: CXF
Issue Type: Bug
Components: Bus, JAX-WS Runtime, Transports
Affects Versions: 2.7.2
Environment: 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)
Reporter: Siarhei
Priority: Trivial
I have a simple web service:
{code:java}
@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.";
}
}
{code}
It is configured via Spring and runs inside a webapp:
{code:xml}
<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" />
{code}
The webservice runs good. Then I've created a client:
{code:java}
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));
}
}
{code}
{code:xml}
<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>
{code}
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 "*" conduit config is used. On the contrary, when I set "*" timeout to 1000ms, and the second one to 3000 and call WS it fails, as "*" config is used.
Is it correct behavior?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira