Skip to content

Loading external webservice response #25

@msehome

Description

@msehome

Hello everyone,

I need to send a request to an external web service upon receiving a call, and consume the response in greenj, i.e. show the caller name by looking up the name from an online phone book:

var parameters = "{'CallerID':'" + call.getNumber() + "'}";
try
{
$.ajax({ type: "POST", url: "http://www.abc.com/WSC/WebServices.asmx/callerID", data: parameters, cache: false, contentType: "application/json; charset=utf-8", dataType: "json", cache: false, success: function (msg) { $('#log ul').append('

  • Caller:' + msg.d + '
  • ');}, error: function (err) { $('#log ul').append('
  • Error:' + err.message + '
  • ');} });
    }
    catch(err){
    alert(err.message);
    }

    But this script always returns "Error:" with no error message and no result.

    I have tried many different ways with no luck.
    So my first question is whether or not I can use web services from external websites.

    Thank you,

    Regards,

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions