【发布时间】:2019-09-26 13:31:04
【问题描述】:
我有一个网络服务,例如
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class SI_C : System.Web.Services.WebService {
public SI_C()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[Webmethod]
public bool CreateRecord(classname objname) //some class I am setting the data to
{
//Creates a record.
}
}
现在在我创建的客户端消费时
SI_C_In_SoapClient client = new SI_C_In_SoapClient("SI_C");
client.ClientCredentials.UserName.UserName = "Username Sent";
client.ClientCredentials.UserName.Password = "Passport Sent";
现在我想在我的网络服务中访问这个发送的密码和用户名。我该怎么做?
更新:
- 使用网络凭据调用在客户端设置密码和用户名
- 在网络服务中接收
- 发送到数据库并检查是否正常?就是这样。
【问题讨论】:
标签: c# asp.net soap asmx soap-client