【发布时间】:2020-05-15 04:30:03
【问题描述】:
我正在统一为 .net Web 服务制作 SOAP 客户端,但我收到访问被拒绝错误,即
SoapException:服务器无法处理请求。 --->使用方法'mysql_native_password'对用户'tapblueapp'的主机'104.130.222.145'进行身份验证失败并显示消息:用户'tapblueapp'@'showoff-new'的访问被拒绝(使用密码:YES)--->访问拒绝用户“tapblueapp”@“showoff-new”(使用密码:YES)
我已按名称 SampleService.cs 为服务生成代理类。并通过创建调用 GetModelOption 操作的部分类 WebService(位于 SampleService.cs 中)的实例来调用 GetModelOption()。
后端连接到根据请求返回数据的数据库。 我关注了http://gyanendushekhar.com/2017/02/18/call-asp-net-web-service-unity3d-asmx-service/ 创建代理类。
我调用服务的代码是:
NetworkCredential credential = new NetworkCredential("username", "password", "ip:port");
CredentialCache myCache = new CredentialCache();
myCache.Add(new System.Uri("http://builderapi.showoff.com/WebService.asmx"), "Negotiate", credential);
WebService webService = new WebService();
webService.Credentials = myCache;
webService.GetModelOption();
【问题讨论】:
标签: c# .net unity3d soap soap-client