[英]Create SOAP webservice(wsdl) client in c#
I have a soap based web service which has wsdl. 我有一个基于肥皂的Web服务,其中包含wsdl。 and I have to create a windows form application client.
并且我必须创建一个Windows窗体应用程序客户端。 can someone give me a small basic client?
有人可以给我一个小的基本客户吗?
Tips: that small web service has only a method named " 提示:小型Web服务只有一种名为“
CALL(id,name,address)
通话(ID,名称,地址)
Having Drew's method in mind, 考虑到德鲁的方法,
(for ws security) 2.Go to the Reference.cs and change System.Web.Services.Protocols.SoapHttpClientProtocol
to Microsoft.Web.Services2.WebServicesClientProtocol
(You might have to add service2 by nuget) (出于ws的安全性考虑)2.转到Reference.cs,并将
System.Web.Services.Protocols.SoapHttpClientProtocol
更改为Microsoft.Web.Services2.WebServicesClientProtocol
(您可能必须通过nuget添加service2)
UsernameToken token = new UsernameToken("", "", PasswordOption.SendPlainText); UsernameToken令牌=新的UsernameToken(“”,“”,PasswordOption.SendPlainText); yourProxy.RequestSoapContext.Security.Tokens.Add(token);
yourProxy.RequestSoapContext.Security.Tokens.Add(token);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.