我在asmx中有一个Web服务,例如
public void Create(classA objA)
{
//Some code here
}
现在,客户端已要求我使其与基本身份验证一起使用。
我做到了
public Credentials Credentials;
[WebMethod]
[SoapHeader("Credentials")]
public void Create(classA objA)
{
//Some code here
Call a method to check a username and password with the database.
}
凭据类:
public class Credentials:SoapHeader
{
public string UserName { get; set; }
public Credentials()
{
}}
但是客户说他们不想要它,这要求他们传递额外的参数。他们只需要基本身份验证。
那么如何使它适合基本身份验证?
以及客户端将如何使用基本身份验证对其进行身份验证?