Results 1 to 4 of 4
  1. acidhax's Avatar
    Posts
    150 Posts
    Global Posts
    156 Global Posts
       #1  
    Can anyone point me in the right direction for consuming this WebService?
    It uses POST data and accepts an int ID.
    http://eponyms.matbee.com/eponyms/Se.../GetEponymByID
    I've tried many examples, but none have worked so far.

    Any ideas?

    I'm using Ares.

    ---
    Code:
    		var url = ("http://eponyms.matbee.com/eponyms/Service1.asmx/GetEponymByID");
    		this.$.textField1.setValue("yay1");
    		var myAjax = new Ajax.Request(url, {
    			method: 'POST',
    			evalJSON: 'force',
    			postBody: "ID=1",
    			onSuccess: function(transport) {
    				this.$.textField1.setValue("yayayaya");
    			},
    			onFailure: function(transport) {
    				this.$.textField1.setValue("nononono");
    			}
    		});
    ----
    this doesn't seem to work.
    Last edited by acidhax; 07/20/2010 at 08:24 PM.
  2. #2  
    Open your mouth really wide.
    http://<font color="Navy">Poll: Requ...r webOS</font>

    Coming soon-Calm Alarm
    Quote Originally Posted by SirataXero View Post
    Palm Pimp.
    Comes with 2 free Pixis.
  3. acidhax's Avatar
    Posts
    150 Posts
    Global Posts
    156 Global Posts
       #3  
    Nevermind... Turns out there's a Webservice widget in Ares ;-)
  4. #4  
    Quote Originally Posted by acidhax View Post
    Can anyone point me in the right direction for consuming this WebService?
    It uses POST data and accepts an int ID.
    http://eponyms.matbee.com/eponyms/Se.../GetEponymByID
    I've tried many examples, but none have worked so far.

    Any ideas?

    I'm using Ares.

    ---
    Code:
    		var url = ("http://eponyms.matbee.com/eponyms/Service1.asmx/GetEponymByID");
    		this.$.textField1.setValue("yay1");
    		var myAjax = new Ajax.Request(url, {
    			method: 'POST',
    			evalJSON: 'force',
    			postBody: "ID=1",
    			onSuccess: function(transport) {
    				this.$.textField1.setValue("yayayaya");
    			},
    			onFailure: function(transport) {
    				this.$.textField1.setValue("nononono");
    			}
    		});
    ----
    this doesn't seem to work.
    Make POST post (lowercase) and add .bind(this) to each function:

    Code:
    onSuccess: function(transport) {
    //whatever
    }.bind(this)
    Also note the web service returns data in XML, so no matter what you put (i.e. "evalJSON:'force'") it will still be XML.

    You need to use an XML to JSON parser, my favorite being MX.XML (google it).
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup

Posting Permissions