Alex Barberis

  • Random
  • Archive
  • RSS
  • Ask

ASP.NET 1.1 Web Services and jQuery

While working on a project today I figured out how to use jQuery’s $.ajax functionality to consume an ASP.NET 1.1 web service. I was always under the impression that this wasn’t possible. However, this is quite easy. By default an ASP.NET 1.1 web service will accept an HTTP GET, HTTP POST, or HTTP SOAP. Calling a 1.1 web service is as easy as:

$.ajax({
type: “POST”,
url: ‘PathToYourService.asmx/FunctionName’,
data: ‘foo1=value1&foo2=value&foo3=value’,
dataType: “xml”,
success: function(xml) {
//do something with your data
}
});

Replace the data variables with your service parameters and you should be all set. jQuery makes parsing all that XML really easy as well.

  • 2 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

I create great web applications using ASP.NET MVC and jQuery, run long distances, play guitar, and collect/restore pinball machines. I'm also a huge hockey and football fan.

Pages

  • About Me
  • infoBar

Social

  • @plexi on Twitter
  • Facebook Profile
  • alexbarberis on Vimeo
  • abarberis on Youtube
  • Google

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr