Reply
calling webservice method from javascript..
Old 02-19-2007, 08:32 AM calling webservice method from javascript..
Average Talker

Posts: 28
Name: dinesh s
hi frnds.
how can i call webservice method from javascript..

thanks in advance for ur reply...
dinesh s is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 02-19-2007, 04:23 PM Re: calling webservice method from javascript..
Average Talker

Posts: 25
Location: Seattle, WA
There's no way for the client side javascript to directly call a webservice.

You must go back to the server first and call the webservice method from there.

But you can use javascript to trigger either a postback or a callback to the server.
kbychu is offline
Reply With Quote
View Public Profile
 
Old 02-23-2007, 12:48 AM Re: calling webservice method from javascript..
RickPlmr's Avatar
Super Talker

Posts: 107
Name: Rick Palmer
I disagree... although it may just be semantics that's in the way.

When most people non-techie people say "call a webservice method" they mean "send whatever the hell is necessary to the server so that the server gives me the information I'm requesting".

Yes you can do this from javascript using a variety of methods, provided you can figure out how to send an xml message to the web server. Webservices speak xml, so if you want to communicate with one you have to send it xml that describes what you're requesting, and of course that xml needs to be in a very specific format.

I did a lot of work recently on an ajax application that used javascript to send ajax messages to a web server to request all kinds of information. We used a psuedo-webservice-like message protocol, and we used a package called prototype.js (http://www.prototypejs.org/) that I highly recommend. It makes ajax calls about as easy as one or two lines of code - very nice!

You'll also need to get the webservice API from the server you want to communicate with, which will usually come with some example xml messages that you can send them as well as some example xml messages that you can expect to receive/consume.

It could be as simple as building a small xml string in javascript, sending it to the server, and then parsing the xml string that they send back to get the data you were requesting. All of this can easily be done with javascript.

Does that help?
__________________
online-etraining - free online training in Java, J2EE, and MySQL.
rickysays - answers and advice from a geek who knows stuff.
RickPlmr is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to calling webservice method from javascript..
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12586 seconds with 13 queries