Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

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

Avatar

Former Community Member

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

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

Avatar

Level 10

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.  

Avatar

Former Community Member

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.