【发布时间】:2009-10-15 10:09:32
【问题描述】:
我在使用 Firefox 调用 .Net Web 服务时遇到问题 客户。一个简单的例子对我来说就足够了。
服务器端代码是这样的:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
客户端.html代码:
Hello World Denemesi<br />
type="text" disabled="disabled" /></td>
value="Print" onclick="print()"> </td>
客户端.js代码:
var callObject;
function init(){
service.useService( "Service1.asmx?WSDL","Service");
callObject = service.createCallOptions();
callObject.async = false;
}
function print(){
callObject.funcName = "HelloWorld";
var oResult = service.Service.callService(callObject );
if( !oResult.error )
{
edtHelloWorld.value = oResult.value;
}
}
此 Web 服务在 IE 上工作,但不能在 Firefox 上运行,因为 webservice.htc(行为文件)不适用于 Firefox。我需要一个 javascript 或类似的东西,我不能使用而不是 htc 文件...
【问题讨论】:
标签: javascript asp.net firefox asmx