hey guys, i'm trying to make a simple web service(it returns a string that
says "Hello World") and i can call it, have all the javascript i need for it
that i am aware of, but the fist time i push the button it doesnt do anything
but the second time it works, then it will work randomly from then on. i
could go 4 or 5 clicks and have it work perfectly then for some reason it
will stop working for a click. heres the code
<SCRIPT language="JavaScript">
<!--
// All these variables must be global,
// because they are used in both init() and onResult().
var iCallID = 0;
var intA = 5;
var intB = 6;
function init() {
service.useService("Service1.asmx?WSDL","test");
}
function test(){
iCallID = service.test.callService(svcResults,
"HelloWorld","Synchronous Call");
}
function klar(){
document.Form1.fileContents.focus();
}
function svcResults(result){
if((result.eror)&&(iCallId==result.id))
{
var xfaultcode= result.errorDetail.code;
var xfaultstring=result.errorDetail.string;
var xfaultsoap=result.errorDetail.raw;
document.Form1.fileContents.value="errorcode"+xfau ltcode+"\n \n error
string"+xfaultstring+ "\n\n soap raw"+xfaultsoap;
}else if((!result.error)&&(iCallId=result.id))
{
document.Form1.fileContents.value+=" "+result.value;
}
}
//-->
</SCRIPT>
</HEAD>
<body onload="init()" >
<div id="service" style="BEHAVIOR:url(webservice.htc)"></div>
<form id="Form1" onfocus="klar()" method="post"
encType="multipart/form-data" runat="server">
<textarea name="fileContents" onfocus="test()" style="WIDTH: 288px;
HEIGHT: 224px"></textarea>
<input type="button" onclick="test();" name="btnSubmit" value="Submit
Query">
<input type="button" onclick="klar();" name="btnclear" value="klar">
</form>
</body>
i tried to make it work on page load since the goal is to make it callable
programatically(sp?) but it says system.test is null or not an object when i
try taht (btw the klar button has the same problem as the submit query button
it just has a round about way of getting to the function
thanks in advance for your help
john