我有以下ServiceContract:
[ServiceContract(Namespace = Constants.NAMESPACE)]
public interface IAuthenticationService
{
[OperationContract]
LoginResult Login(LoginData data);
}
[DataContract(Namespace = Constants.NAMESPACE)]
public class LoginData
{
[DataMember(IsRequired = true, Order = 1)]
public string SupplierName { get; set; }
[DataMember(IsRequired = true, Order = 2)]
public string Token { get; set; }
}
当我使用Soap UI创建新请求时,请求显示:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://namepsace.org/">
<soapenv:Header/>
<soapenv:Body>
<ws:Login>
<!--Optional:-->
<ws:data>
<ws:SupplierName>?</ws:SupplierName>
<ws:Token>?</ws:Token>
</ws:data>
</ws:Login>
</soapenv:Body>
</soapenv:Envelope>
我找不到<!--Optional:-->
高于数据元素的原因。
上述代码与How to specify a parameter of an OperationContract as required
中建议的答案完全相同我需要做什么才能生成数据参数?