Show TOC Start of Content Area

Procedure documentation Exposing Application Services or Business Objects as Web Service  Locate the document in its SAP Library structure

Use

To reuse the business logic stored in your application services or business objects, you can expose them as a Web service. You can configure Web service Reliable Messaging (WS-RM) for the application service operations you want to expose as Web services. Reliable messaging is enabled on an operational level and is disabled by default. It works only for operations than have no output and faults.

Prerequisites

·        Your have created at least one application service or business object operation.

·        Application Server (AS) Java is up and running.

·        You have generated your application.

Procedure

...

       1.      In the Composite Application Explorer, click the node of the application service or the business object you want to expose with the secondary mouse button and choose Expose Service as Web Service.

The new Web service appears in the Composite Application Explorer.

       2.      In the Select service operation window, choose the operations to be exposed.

Note

To add new business object or application service operations to the exposed Web service, click it with the secondary mouse button and choose Edit.

       3.      To enable reliable messaging for this operation, enable the WS-RM indicator on the Existing Operation pane of the Operations tab page.

       4.      To modify the generated service implementation of particular methods, open the Implementation tab page and click the Java implementation file.

       5.      Save, generate, build and deploy your application.

During generation, CAF produces the matching WSDL document, a skeleton of the service implementation, and a service endpoint interface (SEI), reflecting the WSDL definition and referencing the WSDL document. To view the location of the WSDL on the local file system, click it with the secondary mouse button and from the context menu choose WSDL Document Location.

Result

After you have exposed your Web service, you can publish it in the Service Registry.

More information: Publishing Web Services in Service Registry with CAF

Note

Note that CAF uses transparent optimistic locking when two users/threads read the same business object node instance simultaneously. In this situation it throws the CAFOptimisticLockingException. The user/thread that last read the instance needs to read it again with the updated data before the actual update takes place. If the instance of the business object node has been updated after the user/thread has read it, the value of the lastChangedAt attribute will have changed as well.

If you have enabled WS-RM for the Web service you exposed, you need to make further configurations at runtime.

More information: Configuring Web Services Exposed by Applications

End of Content Area