skip to main content
OpenEdge Mobile 11.5.1 Updates : Session management updates : JSDOSession properties : services property
 
services property
Returns an array of objects that identifies the Mobile services that have been loaded for the current JSDOSession or Session object and its Mobile Web application.
Data type: Object array
Access: Read-only
Applies to: progress.data.JSDOSession class, progress.data.Session class
You load Mobile services for a JSDOSession or Session object by loading the corresponding JSDO catalogs using the object's addCatalog( ) method. For a JSDOSession object, JSDO catalogs can be loaded either before or after you log into a Mobile Web application using the object's login( ) method. For a Session object, JSDO catalogs must be loaded after you log into a Mobile Web application using the object's login( ) method.
Each object in the array returned by this session property contains two properties:
*name — The name of a Mobile service
*uri — The URI for the service. If the address of the service in the catalog is an absolute URI, this value is that URI. If the service address is relative, this value is the relative address concatenated to the value of the JSDOSession or Session object's serviceURI property, which contains the Mobile Web application URI used by the object's login( ) method.
Note: To return a corresponding list of URIs for the loaded JSDO catalogs, read the catalogURIs property.

Example

Given the following service names and URIs loaded into a JSDOSession object from unsecured locations:
*"CustomerSvc" service with this URI: "/rest/CustomerSvc"
*"ItemSvc" service with this URI: "http://itemhost:8080/SportsApp/rest/ItemSvc"
The following code fragment produces the output that follows:
// create Session
pdsession = new progress.data.JSDOSession('http://custhost:8080/SportsApp');

window.loginView = kendo.observable({
submit: function() {

// load 2 unprotected catalogs
pdsession.addCatalog([ "/SportsApp/static/mobile/CustomerSvc.json",
"http://itemhost:8080/SportsApp/static/mobile/ItemSvc.json" ]
).done(
function(JSDOsession, result, info) {

// log in anonymously
JSDOSession.login(
)
.done(
function(JSDOSession, result, info) {

/* Use services property to print services
loaded by this Session object */
for (var i=0; i < JSDOSession.services.length; i++) {
console.log( JSDOSession.services[i].name + "   "
+ JSDOSession.services[i].uri );
}
// Stuff with widgets and DataSources . . .
}).fail( // log in
function(JSDOSession, result, info) { . . .
});
}).fail( // Add catalogs
function(JSDOSession, result, details) { . . .
});
}
});
Output from the preceding code fragment:
CustomerSvc   http://custhost:8080/SportsApp/rest/CustomerSvc
ItemSvc   http://itemhost:8080/SportsApp/rest/ItemSvc

See also:

addCatalog( ) method (JSDOSession class), addCatalog( ) method (Session class), catalogURIs property, login( ) method (JSDOSession class), login( ) method (Session class), serviceURI property