Showing results for 
Search instead for 
Do you mean 

Putting the SData in SData Mobile Client

by on ‎01-11-2011 11:02 PM

The new SData Mobile Client is a client-side HTML/JavaScript/CSS application. Rather than access a web server to retrieve each page, the entire application is downloaded, and then transactional data is retrieved as necessary from an SData web service portal. In this blog post, I’m going to point out a few things you should know about setting up your SData data source, and how to configure the mobile client to use it.

 

If you’re working with the source code from github, you should be aware of the two files in the environment folder, developer.js and default.js. This is where we configure the SData connection. The developer.js file is used when you’re executing the “debug” version of the application via index-dev.html. When you “build” (minify) the application and run it via index.html, default.js is used. By default, we have developer.js pointing at an SData test server, while default.js sets the server to “window.location.hostname” (the server where the mobile client is installed).

 

If you want to work with an SData source other than our test server, you're going to need SalesLogix 7.5.3 HF3, which is about to go into Beta. This mobile client will not work with previous versions of the SalesLogix SData provider, as there have been some important modifications and API additions. For example, HF3 introduces UserOptions and Picklist system APIs.

 

Important: Our recommended deployment approach is to stick with the out-of-the-box setting in default.js and install the mobile client portal to the same server as your SData portal. Moving the SData host to another server will introduce cross-origin requests from the client application, which your browser won’t allow (without some fiddling).

 

If you really want to install your SData host on a separate server, one way of handling this is to have a proxy on the web server hosting the mobile application. We will be looking into possibly providing our own proxy in the future. You can also install and configure something like ISAPI rewrite for this. Right now, the approach that we’re using, and documenting on github, is to use CORS (Cross-Origin Resource Sharing), with the help of ISAPI rewrite, to support cross-domain requests.

 

If you configure default.js to point to another server for your deployed application, you’ll also need to update index.manifest (in the root folder for argos-saleslogix) and set NETWORK (at the end of the file) to the URL of your SData server. This is required for CORS support.

 

There IS a non-production scenario where you might want to use CORS. If you want to download the source for the mobile client from github and develop on a machine other than the one your SData host resides on, you’ll be making cross-origin requests.

 

The SData server that we have development.js pointing to has CORS installed on it, so that we can use that server, but develop and test off of the local file system. Otherwise, FireFox and Chrome will give you a “request aborted” message when you try to log into the application. Safari, on the other hand, appears to allow the external SData requests when you’re running the application off of the file system.

 

In conclusion, I'd like to once again stress that our recommended approach is to stick with the default settings and deploy the mobile client to the same server as the SData host. But it's still nice to know what's going on under the covers, and where to get to these settings.

 

Thanks,

Jeff

Comments
by Gold Super Contributor
on ‎01-12-2011 04:55 AM

Great news Jeff!

 

There is a significant built-up demand for this capability and I know if we could deploy today (almost) every client (we have) would want to get it up an running immediately.

by
on ‎08-18-2011 01:53 PM

Do I need to set up CORS if I am only changing the port?  I am trying to put SLX Mobile on a different port and I am getting 401 errors.  I changed production.js to connections: {
        'crm': {
            isDefault: true,
            offline: true,
            serverName: window.location.hostname,
            virtualDirectory: 'sdata',
            applicationName: 'slx',
            contractName: 'dynamic',
            port: 7777,
            protocol: /https/i.test(window.location.protocol) ? 'https' : false,
            json: true
        }
    }

 

And I changed index.manifest to http://server:7777/sdata/.  Thanks for your help.

by Gold Super Contributor
on ‎08-18-2011 02:09 PM

You need not specify the port explicitly - if it is deployed on the same site as the SData portal..

If you have more questions, I suggest you post to a "normal" forum -  Developer Lan, Mobile... is probably the best public one.

Register Read Guidelines Request Partner or Employee Access

What's New in 8.1

Labels