You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Stan Lewis <ga...@gmail.com> on 2009/09/17 21:02:12 UTC

Re: How can I configure a CXF web service to listen on a specific port?

On Thu, Sep 17, 2009 at 2:47 PM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
> Unfortunately that doesn't help.
> The main point of #2 is that the port and URL are specified by the
> container, which is no good for me.
> And the publishedEndpointUrl doesn't work unless Tomcat is configured with
> that as a connector - in which case it responds on that port for all web
> services installed (and still with a constrained URL, the extra bit I can
> specify is added to a Tomcat generated root).
>
> So it looks like what I need is a separate container for each web service.
> But I don't want to have to manage them separately.
> So is there are server that is able to host multiple containers?
> Or can I embed jetty inside Tomcat via CXF?

Hey Jim, you could also host your CXF services in Servicemix 4.x, the
cxf-osgi demo uses the OSGi HTTP transport but if you make a slight
change to the demo's configuration you can have it listen on a
different port:

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
<!--
    comment this out and add the cxf-extension-http-jetty.xml namespace above
    <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
-->

and then:

<jaxws:endpoint id="helloWorld"

implementor="org.apache.servicemix.examples.cxf.HelloWorldImpl"
                        address="http://localhost:9090/HelloWorld"/>

Thanks,

Stan