无法调用Web Service方法

时间:2019-01-03 05:36:56

标签: asp.net web-services asmx

我尝试调用Web服务方法,但是显示错误“无法连接到远程服务器”。当我浏览服务时,它可以正常工作。我在放置代理并关闭防火墙后也进行了检查,但是问题仍然相同。

       var ws = GetWebService();

        var token = HmacServices.GetExpiringHmac(string.Format("{0}_{1}_{2}", _userID, _channelID, securityGroup), DateTime.Now.AddMinutes(5));

       //error in this line
Guid reportingUserID = ws.SetupReportingUser(_userID, _channelID, securityGroup, token);


 //Proxy class web service method


[System.Web.Services.Protocols.SoapDocumentMethodAttribute
("xxxxx", RequestNamespace="xxxxx", ResponseNamespace="xxxxx", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
             public System.Guid SetupReportingUser(int userId, int channelId, string defaultSecurityGroupName, string token) {
        object[] results = this.Invoke("SetupReportingUser", new object[] {
                    userId,
                    channelId,
                    defaultSecurityGroupName,
                    token});
        return ((System.Guid)(results[0]));
    }

0 个答案:

没有答案