Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ahhouais
Contributor
Contributor

Hide a Web service in karaf

Hi !
Is it possible to provide a Web service in Karaf but to hide it from beeing displayed when the url "http://xxx.xxx.xxx.xxx:8040/services/" is called ?
Thanks !
Labels (2)
7 Replies
Anonymous
Not applicable

Hi
it is possible at Apache CXF level, adding a "org.apache.cxf.endpoint.private" contextual property to JAXWS or JAXRS endpoint will work.
Can you modify a bundle Blueprint context ?
Cheers, Sergey
Ahhouais
Contributor
Contributor
Author

Hi Sergey,
Thank you for responding.
I am using the Talend studio... So I dont think that I can modify any file easily...
What I can do is to add or modifiy files in Karaf.
Regards.
Anonymous
Not applicable

Hi,
The easiest workaround is to get the bundle (jar) created by Studio, unjar it, modify a context (file is named service.xml or beans.xml) in OSGI-INF/blueprint and jar it back and deploy a bundle again. You'd modify a JAXWS or JAXRS endpoint declaration by adding the property like this:
<jaxrs:server addres="/someaddress">
<jaxrs 0683p000009MAB6.pngroperties>
<entry key="org.apache.cxf.endpoint.private" value="true"/>
</jaxrs 0683p000009MAB6.pngroperties>
</jaxrs:server>
or do the same for jaxws:endpoint.
Actually the simpler option is:
etc/org.apache.cxf.osgi.cfg file may have CXF specific properties set.
So what you can do is set "org.apache.cxf.servlet.hide-service-list-page" to true, but note a user will probably see the error when accessing the page...
"org.apache.cxf.servlet.service-list-page-authenticate" property is also available - so may be you can 'open' the page to admins only, I haven't tried it though,
HTH, Sergey
Ahhouais
Contributor
Contributor
Author

Hi Sergey !
I tried the second solution. So I have edited the "etc/org.apache.cxf.osgi.cfg" file.
I have added this line : org.apache.cxf.servlet.service-list-page-authenticate=true
I have restarted the karaf runtime, but when I try to display the page http://localhost:8040/services/ I still can access it... Maybe the value "true" is no correct...
In fact, displaying this page is not a problem : what I really want is to hide only one Web service to be listed in this page... A specific one... Do you think that it is possible ?
Thanks !
Ahhouais
Contributor
Contributor
Author

The option org.apache.cxf.servlet.hide-service-list-page=true works : I can't display the exposed Web services. Good thing. Now, I want to hide only one of them 0683p000009MACn.png
Regards
Anonymous
Not applicable

The authenticate property was added recently, probably not supported yet in your version of the container.
Re the individual selection: at the moment only the trick with the bundle jar will do.
I've also created an enhancement request:
https://jira.talendforge.org/browse/TESB-13575
Cheers, Sergey
Ahhouais
Contributor
Contributor
Author

Thank you so much Sergey !