Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CXF Spring - multiple endpoints per servlet?

843833Jul 16 2009 — edited Jul 18 2009
Hi all,

Can I have multiple endpoints in one cxf.xml?

1. For example in my "cxf.xml" configuration:
<beans>
  ...
  <jaxws:endpoint id="example1"
    implementor="com.example.business.Example1"
    serviceName="Example1Service"
    address="/Example1WS">
  </jaxws:endpoint>
  
  <jaxws:endpoint id="example2"
    implementor="com.example.business.Example2"
    serviceName="Example2Service"
    address="/Example2WS">
  </jaxws:endpoint>
</beans>
2. After start Tomcat, I DO can visit both:
http://localhost:8080/example/services/Example1WS
http://localhost:8080/example/services/Example2WS


3. But in my "Client.java", I just cannot dynamicly create "Example1". It seems it will create "Example2" in this example
    	JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

    	factory.getInInterceptors().add(new LoggingInInterceptor());
    	factory.getOutInterceptors().add(new LoggingOutInterceptor());
    	factory.setServiceClass(Example1.class);
    	factory.setAddress(url + "/Example1WS");
    	Example1 client = (Example1) factory.create();
4. However, if I remove "Example2" endpoint in "cxf.xml", re-start Tomcat and it works fine with "Client.java" as shown above.


Is it something wrong in my cxf.xml?
Or is it restrained to use JaxWsProxyFactoryBean? Please help!


Many thanks,
George
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2009
Added on Jul 16 2009
2 comments
1,446 views