Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



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

Posts: 28
Name: dinesh s
Trades: 0
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
 
 
Register now for full access!
Old 02-19-2007, 05:23 PM Re: calling webservice method from javascript..
Average Talker

Posts: 25
Location: Seattle, WA
Trades: 0
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, 01:48 AM Re: calling webservice method from javascript..
RickPlmr's Avatar
Super Talker

Posts: 107
Name: Rick Palmer
Trades: 0
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?
__________________

Please login or register to view this content. Registration is FREE
- free online training in Java, J2EE, and MySQL.


Please login or register to view this content. Registration is FREE
- 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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.28440 seconds with 12 queries