- 主题:请教:客户端是普通浏览器,可以使用webservice吗
如果可以,怎么使用,是通过javascript么,还是要装插件?
--
FROM 162.105.31.*
If you are using Microsoft IE 5 or later, you can use the behavior/HTML-Component "WebService" to access a Web service. The "WebService" behavior communicates with Web services over HTTP using Simple Object Access Protocol (SOAP).
To use the "WebService" behavior, you must attach it to an element using the STYLE attribute, as follows:
<DIV ID="GiveItAName"
STYLE="behavior:url(webservice.htc)"></DIV>
A complete example taken from the Microsoft Web site is as follows:
<html>
<head>
<script language="JavaScript">
var iCallID;
function init()
{
service.useService
("http://myserver.com/services/myservice.asmx?WSDL",
"servicename");
}
function onmyresult()
{
if ((event.result.error)&&(iCallID==event.result.id))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;
// Add code to output error information here
alert("Error ");
}
else
{
service.innerHTML= "The method returned the result: "
+ event.result.value;
}
}
</script>
</HEAD>
<body onload="init();">
<BR>
Enter a Value <input type='text' id='param1'>
<BR>
<button onclick='iCallID = service.servicename.callService
("ProcedureName", param1.value);'>Call A Web Method</button>
<div id="service"
style="behavior:url(webservice.htc)"
onresult="onmyresult();">
</div>
</body>
</html>
【 在 Cryolite (冰晶石) 的大作中提到: 】
: 如果可以,怎么使用,是通过javascript么,还是要装插件?
--
FROM 202.106.154.*
great!!!!
3x
btw:有专门讨论这个问题的论坛么,hehe:)
【 在 heavyweight (我是悍匪我怕谁) 的大作中提到: 】
: If you are using Microsoft IE 5 or later, you can use the behavior/HTML-Component "WebService" to access a Web service. The "WebService" behavior communicates with Web services over HTTP using Simple Object Access Protocol (SOAP).
: To use the "WebService" behavior, you must attach it to an element using the STYLE attribute, as follows:
: <DIV ID="GiveItAName"
: ...................
--
FROM 210.31.68.*
这篇文章,我是在下面的这个地方找到的。
http://searchwebservices.techtarget.com/ateQuestionNResponse/0,289625,sid26_cid578279_tax292065,00.html
【 在 Cryolite (冰晶石) 的大作中提到: 】
: great!!!!
: 3x
: btw:有专门讨论这个问题的论坛么,hehe:)
--
FROM 202.106.154.*