Example: Cost Service - Web Service Exposed by Web Central

This is an example of WebService, exposed by WebCentral, to be consumed by an abstract ERP system (such as SAP, Oracle).

It uploads general ledger information (a subset of the Costs (cost_tran) table) into the ERP system. This scenario is used for uploading costs, such as real estate charges, that accounting should charge to tenants.

The costs to be returned are restricted by Cost Category, month and year; the returned costs contain fields: Due Date, Cost Category, Description, Cost Status, Lease Code, Property Code, Account Code, Amount Expense, Amount Income, Date Transaction Created, and Cost Code.

Configuration

The configuration files for the Booking Service remoting configuration are in /WEB-INF/config/context/remoting/examples/webservices-cxf/ folder. To use this example, configure WebCentral according to instructions in the readme.txt , located in this folder. This configuration includes both remoting (Web Services support) and rendering (Web Central and Smart Client forms and reports support).

Limitations

The current implementation of CostService does not use any authentication or security. For production deployment, you need to configure WebService to use security, which is appropriate for your deployment (for example, WS-Security: http://en.wikipedia.org/wiki/WS-Security).

Example Files

The implementation Java files are located in the \archibus\schema\ab-products\solutions\src\main\java\com\archibus\app\solution\common\webservice\cost\server folder.

The costService-remote bean is defined in / WEB-INF/config/context/remoting/examples/webservices-cxf/webservices.xml .

The supporting DataSource beans are defined in /WEB-INF/config/context/applications/examples/applications-child-context.xml .

To demonstrate this example in Eclipse:

  1. Follow instructions in /WEB-INF/config/context/remoting/examples/webservices-cxf/readme.txt to configure Webservices – CXF.
  2. Obtain the “ServerExample” project from Archibus Technical Support.
    • Import the project file into Eclipse.
    • Check "Copy projects into workspace" on the Import Projects dialog.
    • This copies the ServerExample project into the C:\eclipse-archibus\workspaces\ApplicationDeveloper\ServerExample folder.
  3. In Eclipse, invoke Run “Jetty-ServerExample”. The ServerExample Jetty server will be running on port 8081. The ServerExample is, in this case, a WebService client, calling WebService exposed by WebCentral.
  4. Run WebCentral.
  5. In the browser, enter URL: http://localhost:8081/ServerExample/.
  6. Click on "Invoke CostService" link.
  7. The next page shows two Actual Cost records.