Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.34 KB

File metadata and controls

37 lines (25 loc) · 1.34 KB
Using a Service

In order to call a service, the corresponding proxy object should be created in the client block of the application. There is a special factory that creates service proxies: for the Web Client block, it is WebRemoteProxyBeanCreator, for Web Portal – PortalRemoteProxyBeanCreator, for Desktop Client – RemoteProxyBeanCreator.

The proxy object factory is configured in spring.xml of the corresponding client block and contains service names and interfaces.

For example, to call the sales_OrderService service from the web client in the sales application, add the following code into the web-spring.xml file of the web module:

link:../../../../../source/middleware/service_4.xml[role=include]

All imported services should be declared in the single remoteServices property in the map/entry elements.

Tip

CUBA Studio automatically registers services in all client blocks of the project.

From the application code perspective, the service’s proxy object at the client level is a standard Spring bean and can be obtained either by injection or through AppBeans class. For example:

link:../../../../../source/middleware/service_5.java[role=include]

or

link:../../../../../source/middleware/service_6.java[role=include]