facebook

Web Servces and Mobi One

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #330759 Reply

    newmodeav
    Member

    i should start with I LOVE THIS APP!
    you guys are amazing.

    now my question

    we are trying to come up with an app version of our live site
    a very dynamic and database driver php site.

    i was wondering if there is a posibility to create the UI in the mobione and within mobione to
    apply or connect or reference the content and function to our live Web Services???

    using any form of XML Phrases or xml web services?
    or Json Web Services?

    i would really apreaciate any info.

    #330760 Reply

    Paul G
    Member

    Hello,

    I create web services using Visual Basic .net and call them from Mobione with a function like this:

    function serviceCall() {

    var txtInput = $(“#m1-myapp-textFieldDate1”).val();
    if (txtInput.length > 0) {
    $.ajax({
    type: “POST”,
    url: “http://localhost:60258/WebServiceMath.asmx/Add”,
    data: “{‘firstdate’:'” + txtInput + “‘}”,
    contentType: “application/json; charset=utf-8”,
    dataType: “json”,
    success: function (msg) {

    $(‘#m1-myapp-textArea1″).val(msg.d);
    },
    error: function (e) {
    $(“#m1-myapp-textArea1”).val(msg.d);
    }
    });
    }
    }

    This function takes the value of textFieldDate1, passes it as a parameter to a webservice (WebServiceMath.asmx), processing is done on the server in VB.Net, and the result is returned as msg.d which is displayed in Textarea1

    #330789 Reply

    newmodeav
    Member

    thank you for your respond

    i see that you used that http://localhost:60258 to get around the cross domain restriction
    I just don’t know how you forced that to point to an external server?

    #330862 Reply

    Paul G
    Member

    Hello,

    I showed you the example using Localhost as the server as that is where I do my testing and debugging.

    When everything works how I want I transfer all files over to my external server, for example http://www.myserver.com/Intcal

    I transfer the web service files -WebServiceMath.asmx – into the Intcal folder as well as all Mobione genereated files including the main intcal.html file,

    when all files are on my external server, I change the ajax call to:

    url: “WebServiceMath.asmx/Add”,

    As all files are in the same folder there are no cross domain issues.

    Why do you need to get around the cross-domain restriction if you create your own web service? Just put all web service files in same folder as Mobione files on your external server

    #333976 Reply

    Cisco421
    Member

    Hi Paul

    How would you code the app to reach a web service in another domain using XML / SOAP ???

    I have the WSDL address and the SOAP 1.0 message format but can’t seem to code it right on Mobi One.
    please help…. thanks

    Cisco

    #333998 Reply

    @Paul G:
    Thanks for that codesnippet about using a .net webservice !
    Would you be willing to share the .net source code of the webservice, too ?

    Thank you very much …

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Web Servces and Mobi One

You must be logged in to post in the forum log in