OE Mobile example from book needs change of authentation typ

Posted by fredrik.richtner on 18-Sep-2013 08:58

Hi,

I recently installed OE 11.3.

I have been trying to get the mobile example working. I have copied the javascript for the Load event from the book.

But it seems I am not able to get past authentication step from web browser to web server (tomcat).

Should it work out of the box or is it neccessary to do some additional configuration?

Thanks

Fredrik

All Replies

Posted by whenshaw on 18-Sep-2013 11:43

Hello Fredrik,

The  code for the load event on p. 43 of the 11.3 "Mobile Applications" book ran OK when I tested it just now. One thing I had to do was change the name of the MyMobileService_dsCustomer_Settings object (7th line) becasue I used an existing app with a different name, so if you used something other than "MyMobileService" as your name, that could be your problem. (There was a bug in the 11.2 doc, I think, because the cMsg variable was  not initialized to "ok", but that has been fixed in the 11.3 doc.).

That Load code assumes that the authentication model for the service is Anonymous, which I think is the default that you get out of the box for any service that you create.  If your service uses a different authentication model, that would be a problem.

Do you see any messages in the browser's debugging console? What message do you get in the alert box? If the message in the alert box is not "Invalid user-id or password", you can see the HTTP status code that the server sends back by changing the "if" statement near the end so it looks like this:

if (cMsg != "ok") {
     alert(cMsg);

     alert("HTTP status code: " + pdsession.loginHttpStatus);

     return;
}

--Wayne

Posted by Anil Kumar on 18-Sep-2013 11:47

Hi Fredrik,

Can you please provide more details on the problem that is being observed. Are you seeing a blank screen in the mobile emulator after running specific mobile application?

- If so can you please check for the availability of the Catalog URI and the Service URI under JSDO services section.

- Also, check for appropriate catalog URI in the 'pdsession.addCatalog' section (in Java Script Code) and service URI in the 'pdsession.login' section

Note: Mobile App Builder currently provides a default Login Service which is available directly under the Services section. Creation of Login Java Script event is an optional component. ie., you can provide both catalogURI (JSON File path) and the serviceURI (REST Service path) in respective fields in the 'MobileService_Settings' section. This will reduce creation of default java script event for the login/authentication part.

Hope this helps.

Thanks and Regards,

Anil Kumar.

Posted by fredrik.richtner on 19-Sep-2013 06:27

Hi,

Thanks for the quick responses. After doing more debugging I figured out that the appserver was not connected to the database... Now it works as expected ;-)

/Fredrik

This thread is closed