November 27, 2001 - Web Service Basic Authentication
November 27, 2001 Web Service Basic Authentication Tips: November 2001
Yehuda Shiran, Ph.D.
|
call
object. You just assign the appropriate properties of the call
object:
function callSynch() {
var co = webServiceCallerBody.createCallOptions();
co.funcName = "echoString";
co.async = false;
co.userName = "guest";
co.password = "guest";
var oResult = webServiceCallerBody.echo.callService(co, "Synchronous Call");
handleResult(oResult);
}
The ID webServiceCallerBody
is the ID
of the element to which you attach the WebService
behavior, like here:
<BODY ID="webServiceCallerBody" onload="loadService()"
STYLE="behavior:url(webservice.htc)>
And the function callSynch()
is called by clicking a button:
<BUTTON ID="b2" onclick="callSynch()" disabled>Call Synchronously</BUTTON>
Some Web services require the exact port number that you are trying to connect to. You specify it with the port
property of the call
object, like here:
function callSynch() {
var co = webServiceCallerBody.createCallOptions();
co.funcName = "echoString";
co.async = false;
co.userName = "guest";
co.password = "guest";
co.port = "Port1";
var oResult = webServiceCallerBody.echo.callService(co, "Synchronous Call");
handleResult(oResult);
}