1

I developed asp.net WCF service.I have hosted it in another system.now i need to get the WCF webservice to my System using JQUERY Function.my problem is I dnt knw how to call that webservice hosted in another system.How to call external webservice from jquery?

user
  • 189
  • 3
  • 8
  • 18

2 Answers2

2

You can just use the AJAX jQuery method:

$.ajax({
  url: 'http://localhost:4305/Service/YourService',
  type: "GET",
  success: function(data) {
     alert('WCF service called');
  }
});

There is also an article on Code Project to achieve this with WCF.

http://www.codeproject.com/Articles/128478/Consuming-WCF-REST-Services-Using-jQuery-AJAX-Call

http://api.jquery.com/jQuery.ajax/

Darren
  • 63,390
  • 21
  • 126
  • 134
0

Is your issue regarding cross domain scripting? Try JSONP. This will allow you to call a webservice hosted on a system w/ a different domain.

jQuery AJAX cross domain

Community
  • 1
  • 1
ltiong_sh
  • 3,058
  • 22
  • 27