我的场景:我添加了服务引用,并使用代理类来调用特定的soap服务。当我查询soap服务并且响应仅包含一组值时,它可以正常工作,但是例如,如果我查询某个姓氏,它将返回一组SET值,则代码显示响应为null,即使使用Fiddler检查时也认为这些值是被退回。
SoapService.queryWebServiceSoapPortClient client = new SoapService.queryWebServiceSoapPortClient();
client.ClientCredentials.UserName.UserName = userID;
client.ClientCredentials.UserName.Password = Password;
SoapService.qwsInput query1 = new SoapService.qwsInput();
SoapService.queryResponse response = new SoapService.queryResponse();
query1.userId = userID;
query1.pass = Password;
query1.queryId = queryId;
query1.qwsInputParams = InputParam;
query a = new query();
a.queryInput = query1;
try
{
response = client.query(a);
}
catch (Exception error)
{
var b = error.ToString();
}