0

How to call webservices

Hi

Can any one please suggest the resources / sample code to make use of the webmethod present in webserivice

Thanks
Swarupa

by
5 Replies
  • I'm doing SOAP call here: http://code.google.com/p/wstvwidget/source...pt/core/WSTV.js (_doLogIn method)
    0
  • QUOTE (Dmitry @ Oct 26 2010, 04:13 AM) <{POST_SNAPBACK}>
    I'm doing SOAP call here: http://code.google.com/p/wstvwidget/source...pt/core/WSTV.js (_doLogIn method)



    Thank you very much.... its really helpful..
    Please keep suggest / post the samples you have... really useful

    Swarupa
    0
  • Swarupa,


    You may want to check out our Developer Toolkit. We have examples, tools, and more available for free for the ConnectedTV platform.

    You can sign up here: http://www.widgetrealm.com/developers

    Widget Realm
    0
  • QUOTE (swarupa @ Oct 24 2010, 08:22 PM) <{POST_SNAPBACK}>
    Hi

    Can any one please suggest the resources / sample code to make use of the webmethod present in webserivice

    Thanks
    Swarupa


    Hi Swarupa,

    Following is a simple running example. In practice, though you would be better off using some kind of a SOAP library.
    CODEBOX
     var symbol = "YHOO"; 
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open("POST", "http://209.162.186.60//stockquote.asmx?op=GetQuote",true);
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState == 4) {
    log(xmlhttp.responseText);
    // do whatever with the data

    }
    }
    xmlhttp.setRequestHeader("SOAPAction", "http://www.webserviceX.NET/GetQuote");
    xmlhttp.setRequestHeader("Content-Type", "text/xml");
    var xml = '<?xml version="1.0" encoding="utf-8"?>' +
    '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
    'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
    '<soap:Body> ' +
    '<GetQuote xmlns="http://www.webserviceX.NET/"> ' +
    '<symbol>' + symbol + '</symbol> ' +
    '</GetQuote> ' +
    '</soap:Body> ' +
    '</soap:Envelope>';
    xmlhttp.send(xml);


    Thanks,
    Vivek
    0
  • QUOTE (Vivek Jani @ Oct 26 2010, 10:42 AM) <{POST_SNAPBACK}>
    Hi Swarupa,

    Following is a simple running example. In practice, though you would be better off using some kind of a SOAP library.
    CODE
     var symbol = "YHOO"; 
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open("POST", "http://209.162.186.60//stockquote.asmx?op=GetQuote",true);
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState == 4) {
    log(xmlhttp.responseText);
    // do whatever with the data

    }
    }
    xmlhttp.setRequestHeader("SOAPAction", "http://www.webserviceX.NET/GetQuote");
    xmlhttp.setRequestHeader("Content-Type", "text/xml");
    var xml = '<?xml version="1.0" encoding="utf-8"?>' +
    '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
    'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
    '<soap:Body> ' +
    '<GetQuote xmlns="http://www.webserviceX.NET/"> ' +
    '<symbol>' + symbol + '</symbol> ' +
    '</GetQuote> ' +
    '</soap:Body> ' +
    '</soap:Envelope>';
    xmlhttp.send(xml);


    Thanks,
    Vivek



    Thank you very much for your time and sample..... its really helpful.. thank you.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets