File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling WebService using plain JavaScript

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to call a WebService of a different domain from my application using plain JavaScript. I don’t have a liberty to use any JavaScript/Ajax libraries - I can only use plain JavaScript.

Solution must work on IE and Firefox both.


 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since XmlHttpRequest falls under the same-domain policy, you'll have to use JSONP.
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't the web service need to support JSONP? If yes - it sounds like a good approach - otherwise traditional server proxy approach would work.

I found this an interesting read.
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case its not clear by what I meant by a server proxy -- you'll find some good help here -- http://www.google.com/search?q=cross+domain+javascript&ie=utf-8&oe=utf-8&aq=t
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic