3
votes

It is a web service deployed on Apache Karaf using camel-cxf. I am able to see the cxf service listing in URL localhost:8181/cxf which has some rest and soap services deployed on it.

The problem is it is returning the service listing whenever any request comes with keyword "services". For example the url http://localhost:8181/abcd/services returns cxf service listing page instead of processing the actual request.

I got to know from http://cxf.apache.org/docs/jaxrs-services-description.html that its is because of the default value of service-list-path of CXFServet is services.

Here is my Question. If I want to override this, I should set this property in etc/org.apache.cxf.osgi.cfg. This cfg file is not present under etc folder in my karaf. What are the steps to be taken if I am creating this property file manually? What features I need to install? Or creating this cfg is sufficient ?

Appreciate your help !

2
How is your camel-cxf service configured? Do you have a blueprint.xml?fiw
I have camel-context.xmlSaravana Kumar
Can you post a sanitised version of your camel-context.xml?fiw
My camel-context.xml is a spring configuration file with beans (springframework.org/schema/beans)Saravana Kumar

2 Answers

5
votes

There should be no extra installation requirements, just create a new file etc/org.apache.cxf.osgi.cfg.

There are three settings you may be interested in:

org.apache.cxf.servlet.context = /mycxf
org.apache.cxf.servlet.service-list-path = /myservices
org.apache.cxf.servlet.hide-service-list-page = false

Where the default URL for the CXF service listing is usually like http://localhost:8181/cxf/services, with the changes above the URL would become http://localhost:8181/mycxf/myservices

If you change from false (default value) to true, then your services will be hidden and you will instead get a page stating No service was found.

Because these are initialisation settings you need to shut down Karaf for the changes to apply.

0
votes

I see several points here --

  • The CXF framework is installed by default in karaf under the context-path /cxf.
  • /cxf/services can be considered as a CXF internal app that displays the list of services deployed in CXF. I don't think you can configure the name "services" here (and why would you change that?)
  • the "url-pattern in web.xml" you speak of (if I understand correctly) determines the context path of your servlet/application. You can specify this is camel like this:

    <cxf:rsServer id="secureRsServer" address="https://0.0.0.0:8182/my/path/" serviceClass="....">

(for the RS Server, probably same for the WS server).