Web Service 通过地址栏是可以访问的。。但是调用Web Service 里面的方法GetUserID(...)时报错,错误信息如下:System.Web.Services.Protocols.SoapException: 服务器未能识别 HTTP 头 SOAPAction 的值: http://www.xxxx.com/GetUserId。
没怎么用过Web Service,所以请大家帮帮忙!!Web Service
没怎么用过Web Service,所以请大家帮帮忙!!Web Service
对了。。错误信息里面显示的地址:http://www.xxxx.com/GetUserId 访问不了的,返回404 请问是这个有关系么?这个在哪儿可以设置呢?
是代码调用的吧!
int svrId = 500;
string username = "fddbd";
string sysmd5 = systemKey.Trim() + username;
string md5key = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sysmd5, "MD5").ToLower();
BasicHttpBinding binding = new BasicHttpBinding();
binding.SendTimeout = TimeSpan.FromMinutes(5);
binding.ReceiveTimeout = TimeSpan.FromMinutes(5);
string webserviceUrl = GameServers.GetGoldService(svrId);
EndpointAddress address = new EndpointAddress(webserviceUrl);
PaymentLib.XjztGoldService.xiayigame_goldSoapClient goldService = new PaymentLib.XjztGoldService.xiayigame_goldSoapClient(binding, address); int userId = goldService.GetUserId(username, md5key);