01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: Creating <strong>Mobile</strong> Services<br />

<strong>Mobile</strong> URIs for testing access from REST clients<br />

After first developing and publishing <strong>Mobile</strong> services, you might want to test the <strong>Mobile</strong><br />

resources they provide before you create a <strong>Mobile</strong> App to access them using JSDOs.<br />

You can do this using various REST clients, such as the Postman REST Client, that<br />

allow you to access <strong>Mobile</strong> operations directly as REST resources. (Remember that a<br />

single <strong>Mobile</strong> resource encapsulates several REST resources as <strong>Mobile</strong> operations.)<br />

In this case, you need to know the exact absolute REST URI for the <strong>Mobile</strong> resource<br />

that represents each <strong>Mobile</strong> operation.<br />

As described in previous sections of this chapter, when you create <strong>Mobile</strong> resources<br />

and the <strong>Mobile</strong> services to contain them, you assign a relative URI (or use the default)<br />

for each <strong>Mobile</strong> service and resource that you define. In addition, each operation that<br />

you define for a <strong>Mobile</strong> resource is assigned a prescribed relative URI as part of the<br />

resource annotations added to the ABL.<br />

The absolute URI to access a given operation is a concatenation of all these relative<br />

URIs with the absolute root URI of the deployed <strong>Mobile</strong> Web application, as specified<br />

using the following syntax:<br />

Syntax<br />

scheme://host[:port]/web-app/rest/service-name/resource-name[op-element]<br />

scheme//host[:port]<br />

The beginning of every absolute URI, as described previously (see the “<strong>Mobile</strong><br />

URIs for <strong>Mobile</strong> App access” section on page 81).<br />

/web-app<br />

The relative URI for the <strong>Mobile</strong> Web application, where web-app is the name of<br />

the <strong>Mobile</strong> Web application that contains your <strong>Mobile</strong> service or services, and<br />

serves as the root URI for all <strong>Mobile</strong> resources provided by the <strong>Mobile</strong> Web<br />

application. By default, this is the filename of the WAR file that you use to publish<br />

or deploy the <strong>Mobile</strong> services to your OE Web Server, and it is also the name of<br />

the Web server folder in which all of the Web application’s <strong>Mobile</strong> services and<br />

Web resources are deployed. As noted during development (see the “Publishing<br />

<strong>Mobile</strong> services for testing” section on page 80), Developer Studio publishes each<br />

<strong>Mobile</strong> service defined for a project in its own WAR file with the filename set to<br />

name of the <strong>Mobile</strong> service. For production deployment, you can export multiple<br />

<strong>Mobile</strong> and REST services in a single WAR file, which by default has the name of<br />

the <strong>Mobile</strong> project. Note that during production deployment, a Web administrator<br />

can change the filename of the WAR file and the name of the Web application to<br />

a different value.<br />

Note: During development, you cannot change the name of the WAR file that<br />

Developer Studio publishes for each <strong>Mobile</strong> service in a project.<br />

84 <strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!