Calling Web Services Using Client Side Script

samsmithnz

Senior Contributor
Joined
Jul 22, 2003
Messages
1,038
Location
Boston
I know its possible to call a Web Service using Client Side Javascript Script.

I was wondering if anyone knew of any articles or references, or had modules that I could use to re-implement it.
 
oh, I forgot... to do it you'll have to use a htc (control) called WebService Behavior, this control what does is send everything to the server using SOAP, uh? awesome??? well, prepare yourself for headaches, I used this control in a web app I made, the final result is awesome, no postbacks, everything done in the client side with javascript (I hate javascript now) and the server usage??? LOW!!!!!
BTW, Microsoft won't give any support to it, so if you decide to use it I might be able to help you with it, I lost 1 week learning on how to use it, Microsoft's documentation is not that good, here is the link where you can read about it and download it tho

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/webservice/overview.asp

Greetings
 
Does anyone have any examples where after calling the webservice, I am able to rebind it to my drop down list...

or am i missing something altogether?

this client side webservice stuff seems like an obvious thing to want to do, but you're right iebidan, its bloody hard!
 
The problem is that yopu don't get enough documentation on it, well, answering you rquestion, I never found a way to make my controls to bind to the information returned by the webservice behavior, I tried arrays, nah, objects, nah, the final solution was sending everything from the webservice in just one string separated by commas
EXAMPLE RETURNED BY THE WEBSERVICE
IEBIDAN, RODRIGO, SAN DIEGO, CALIFORNIA

and in the client side using the result object from the webservice behavior did this

Code:
function handler_state(result)
{
	if (result.error)
	{
		var xfaultcode   = result.errorDetail.code;
		var xfaultstring = result.errorDetail.string;
		var xfaultsoap   = result.errorDetail.raw;
		alert(xfaultcode + ' - ' + xfaultstring + ' - ' + xfaultsoap);
	}
	else
	{
		var s = result.value;
		var ss;
		ss = s.split(",");
		for (var key in ss)
		{
			var oOption = document.createElement("OPTION");
			oOption.text=ss[key];
			oOption.value=ss[key];
			
			if (ss[key]!="")
			{
				document.frmOpt.ddlState.add(oOption);
			}
		}
	}
}

this code is JScript, hope this helps you, if not, let me know, to confuse you a bit more :D
 
yes please, confuse me more :D;)

To be perfectly honest I'm still trying to get the client side webservice part to work. ALL of the online examples, without fail, seem to link to web services that are broken :(.

Still researching, I have 2 more weeks to make this work before I have to revert to using a yucky hidden tag with an XML document that I'll have to parse with vb script (yuck yuck yuck!)
 
well, this is kindof complicated to explain, like I said, I had many headaches with this, why don't you add me to your MSN Messenger??? my address is rodrigo_sandoval_v@msn.com, so we can go step by step with this.
Just one more thing, I'm with PST, if you're in Boston then that means I'm 3 hours behind of you
 
Well, I'm online pretty often, starting 7am PST to 2 or 3pm PST then I get online again at home at 6 or 7pm PST, you choose the time
 
Hi all,

I have created a web service which is performing Zipping Process.
I am calling this webservice from client side script(using userService()). The process is working fine in certain clients. In certain clients, tt is throwing an error message "Service Unavailable". I spent around 2 days to fix this bug.But I couldn't...
Anybody encouter this kind of problembefore...
Is there any settings need to be changed in IE?...

I 'm using MSXML2.DOMDocument.3.0.

pls help me to fix this problem
 
Back
Top