×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    8

    MWS Rest API feedback

    I'be been using the Rest API’s and am curious as to how they should behave?

    If I have my mws turned off, they seem to return HTML and not an XML response? This means when I try and programmatically parse the XML (using PHP), if the server is off I run into all sorts of problems.

    I thought one way around this would be to validate the response from the server to check that its proper XML, so I run the following php code to validate:

    <?php
    //must have the header otherwise response is not recognised as XML

    $xdoc = new DomDocument;
    $xmlfile = 'https://robdunfey.mymobilesite.net/rest/presence/location';
    $xmlschema = 'http://mymobilesite.net/schema/presence/1.1.0/location.xsd';
    //Load the xml document in the DOMDocument object
    $xdoc->Load($xmlfile);
    //Validate the XML file against the schema
    if ($xdoc->schemaValidate($xmlschema)) {
    print "$xmlfile is valid.\n";
    } else {
    print "$xmlfile is invalid.\n";
    }

    ?>

    With the MWS off it doesn't validate, progress, but...

    even when I have the GPS on with a fixed location and accuracy, and web server switched on, the XML response still doesn’t validate, giving the following response:

    Warning: DOMDocument::schemaValidate() [domdocument.schemavalidate]: Element 'accuracy': '66.1796417236328' is not a valid value of the local atomic type. in /home/gisconsu/public_html/mws/test.php on line 10
    https://robdunfey.mymobilesite.net/r...sence/location is invalid.


    I’m just hacking around with PHP and am no authority, but this seems odd behaviour? I would have expected a valid XML response to always be returned from the web request? Just thought I would post for your information.

    Rob

  2. #2
    Nokia Developer Expert
    Join Date
    Sep 2007
    Posts
    60

    Re: MWS Rest API feedback

    When the MWS is turned off it doesn't obviously return anything, and the HTML you are receiving comes from the mymobilesite.net gateway (your offline page).

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    8

    Re: MWS Rest API feedback

    ...but could the mymobilesite.net domain not be configured to support the REST API, so that when a response came to in from a MWS that was switched off, it returned an XML response to that effect?

    Perhaps I investigate if there is a web service that reports the device status.

    Rob

  4. #4
    Nokia Developer Expert
    Join Date
    Sep 2007
    Posts
    60

    Re: MWS Rest API feedback

    Quote Originally Posted by robsroom View Post
    ...but could the mymobilesite.net domain not be configured to support the REST API, so that when a response came to in from a MWS that was switched off, it returned an XML response to that effect?

    Perhaps I investigate if there is a web service that reports the device status.
    Yes, mymobilesite.net gateway could be made to answer to REST API calls as well, but it's not implemented right now.

    There is a RSS feed that can be read to get the mobile site status (online/offline), take a look on:
    http://wiki.forum.nokia.com/index.ph...nce_MWS_1.2.29

Similar Threads

  1. PC Suite error: (Code: Init IMediaControl2) HELP?!
    By chunkyspudmonkey in forum General Development Questions
    Replies: 29
    Last Post: 2008-06-30, 11:47
  2. Replies: 2
    Last Post: 2007-11-10, 13:19
  3. Rebirth of com.nokia.mid.ui proprieptary API?
    By peterblazejewicz in forum Series 40 & S60 Platform Feedback Archive
    Replies: 2
    Last Post: 2007-01-16, 19:40
  4. 技术文档:MIDP 2.0安全机制 与 MIDlet 数字签名
    By wotrust in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 0
    Last Post: 2006-12-30, 07:42
  5. How to move from Nokia API to Sprint API.
    By montooshah in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-10-28, 07:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •