
Contributor
2014-05-21
11:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 !
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 !
476 Views
7 Replies

Anonymous
Not applicable
2014-05-21
01:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
476 Views

Contributor
2014-05-22
05:16 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
476 Views

Anonymous
Not applicable
2014-05-22
06:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
roperties>
<entry key="org.apache.cxf.endpoint.private" value="true"/>
</jaxrs
roperties>
</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
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
<entry key="org.apache.cxf.endpoint.private" value="true"/>
</jaxrs
</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
476 Views

Contributor
2014-05-22
06:47 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 !
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 !
476 Views

Contributor
2014-05-22
06:51 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Regards
Regards
476 Views

Anonymous
Not applicable
2014-05-22
07:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
476 Views

Contributor
2014-05-22
08:41 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much Sergey !
476 Views
