Sychronous remote call to web service using DHTML
We were using remote scripting technique in our application to fetch data from the server without re-submitting the web page. This technique was utilizing java applets and thus started producing errors on windows XP user machines. We are now developing the same functionality using WebService on the server end and DHTML element behaviour (WebBehaviour.htc) on the client side HTML page. Using the above-mentioned method we were able to communicate successfully with the web service in asynchronous mode. However the same communication using synchoronous mode is not working properly and is returning either "Service unavailable" and "Invalid Arguments" error messages.
Async Mode (Working Properly)
var callObj1 = new Object();
callObj1.funcName = <function name>;
callObj1.async = true;
callObj1.timeout = 3600;
// SOAP header information
callObj1.SOAPHeader = "<SOAP-ENV:Header>";
callObj1.SOAPHeader += "<t:Transaction xmlns:t='some-URI' SOAP-ENV:mustUnderstand='1'>";
callObj1.SOAPHeader += 5;
callObj1.SOAPHeader += "</t:Transaction>";
callObj1.SOAPHeader += "</SOAP-ENV:Header>";
service.useService("<WebService Address>","MyFunc");
iCallID = service.MyFunc.callService(showres, callObj1, "<var1>", "<var2>", "<var3>");
The above-mentioned code works properly and passes back the result object to showres function.
SYNC MODE (NOT WORKING)
var callObj1 = new Object();
callObj1.funcName = <function name>;
callObj1.async = false;
callObj1.timeout = 3600;
// SOAP header information
callObj1.SOAPHeader = "<SOAP-ENV:Header>";
callObj1.SOAPHeader += "<t:Transaction xmlns:t='some-URI' SOAP-ENV:mustUnderstand='1'>";
callObj1.SOAPHeader += 5;
callObj1.SOAPHeader += "</t:Transaction>";
callObj1.SOAPHeader += "</SOAP-ENV:Header>";
service.useService("<WebService Address>","MyFunc");
iCallID = service.MyFunc.callService(callObj1, "<var1>", "<var2>", "<var3>");
This Code does not work properly and returns "Invalid Argument" or "Service Unavailable" error message.
I would really appreciate if someone could point out the mistake I am making here. or if there is some native issue with this functionality.
Thanks
|