Apache CFX Exposing the OSGI service as Rest service is not working in cq5 ? | Community
Skip to main content
October 16, 2015
Solved

Apache CFX Exposing the OSGI service as Rest service is not working in cq5 ?

  • October 16, 2015
  • 4 replies
  • 1265 views

Hi,

I want to expose the osgi service as rest service so that service can consume from other webserver or client .

I followed Apache CFX but its not working ?

Suggest me a solution

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

CQ does not support using Apache CXF to expose a service so other external clients can invoke it (either a Restful or Soap service). That is - you cannot create a CQ WSDL or Restful service. 

Only internal clients (ie - a JSP) can invoke a service. CQ does support using Apache CXF to write a service that consumes external services (ie - a 3rd party WSDL). For anyone reading this thread and want to know how to use CXF to write a service to consume a 3rd party soap stack -- see: 

http://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html

If this is functionality that you really need -- i suggest that you file a ticket here:

http://helpx.adobe.com/marketing-cloud/experience-manager.html

4 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

CQ does not support using Apache CXF to expose a service so other external clients can invoke it (either a Restful or Soap service). That is - you cannot create a CQ WSDL or Restful service. 

Only internal clients (ie - a JSP) can invoke a service. CQ does support using Apache CXF to write a service that consumes external services (ie - a 3rd party WSDL). For anyone reading this thread and want to know how to use CXF to write a service to consume a 3rd party soap stack -- see: 

http://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html

If this is functionality that you really need -- i suggest that you file a ticket here:

http://helpx.adobe.com/marketing-cloud/experience-manager.html

Adobe Employee
October 16, 2015
smacdonald2008
Level 10
October 16, 2015

I was thinking of a possible workaround given that CQ does not support CXF to create a web service (either Restful or SOAP). Assume your requirement is to create a service that serves up AEM JCR data to clients. For example, a .NET or Java web service client. You want to use Apache CXF to create a web service that is able to query the JCR and return a data set. Although CQ does not support this, you can create a Java bean (ie -- running on a J2EE app server running a Java Spring Bean). The Spring bean uses Apache CXF to create the web service and the JCR API to query data from AEM  and persist data into the JCR.

See this illustration:

[img]CQWSDL.png[/img]

Now a client can invoke the web service which serves up JCR data. 

Hope this helps.  

October 16, 2015

Yes Scot you are exactly right.

Initially we planned to achieve this by using another web server as you mentioned  but it requires for running the app i.e., one is AEM and webserver

To avoid this we decided to expose a service from AEM server itself but it fails.

Thanks for your time being.