Deploying the OData Service¶
After building, the WAR file should be found in your project's deploy subfolder.
Automated Deployment During Service Generation¶
If you intend to do local deployment with the preview-mobile-server task, first check if the -local:server <folder> option is specified in build-local.options. If not, then add the option.
If you have used the deploy-mobile-server task or the preview-mobile-server task, the OData service will have been automatically deployed if the task completes successfully.
Manual Deployment to a Local or On-Premise Web Application Server¶
The procedure for deployment of the generated WAR file depends on the target server environment. Consult the relevant documentation for the target server environment for full details.
For Apache Tomcat, see Tomcat Web Application Deployment.
Sometimes Tomcat makes hot redeployment difficult because the running server process retains file locks. This issue may require restarting the server and manually deleting some files.
If you encounter any such issues, a fail-proof approach for redeployment into Tomcat is as follows:
-
Stop the server.
-
Delete the server's
webapps\<app>folder. -
Delete the server's
webapps\<app>.warfile. -
Copy the new WAR file into the server's
webappsfolder. -
Restart the server.
Manual Deployment to SAP Business Technology Platform – Cloud Foundry Environment¶
Using SAP Business Technology Platform Cockpit for Cloud Foundry¶
This procedure refers to the SAP Business Technology Platform Cockpit, and is subject to change if the cockpit UI changes. If in doubt, please consult the
Develop Applications
topic in the SAP Business Technology Platform documentation.
If you don't yet have a SAP Business Technology Platform account for Cloud Foundry, start by signing up.
-
Once you are in the cockpit, navigate to your
Subaccount, then yourSpace. -
Click on the
Deploy Applicationbutton. -
For the
File Location, browse to the WAR file in your project'sdeployfolder. -
For the
Manifest Location, browse to themanifest.ymlin your project folder. -
Click on the
Deploybutton.
Using the cf Command-Line Tool¶
If not already done, Install Cloud Foundry Tools.
-
Use the
cf apicommand to select your target Cloud Foundry environment. -
Use the
cf logincommand to authenticate yourself with Cloud Foundry. -
Use the
cf pushcommand to deploy your application to Cloud Foundry. -
Use the
cf routescommand to find the URL for accessing your service.
Example push command:
cf push -f ~/projects/myapp/manifest.yml
Access the OData Service Through a Mobile Service Instance¶
Mobile device clients typically access deployed OData services through a mobile application and a mobile destination configured in SAP Mobile Services.
Since users typically use SAP Mobile Services to manage mobile application security configurations, the Mobile Services configuration is detailed in the security guide.
Please refer to the following topics: SAP Business Technology Platform Security – Quick Setup and SAP Business Technology Platform Security – Mobile Services).