我遇到从远程WCF服务接收任何类型的数组的问题。即使是最简单的带有数组字符串的示例也会返回空集合:
[ServiceContract]
interface IArrayService
{
[OperationContract]
string[] getArrayStr();
}
Wireshark捕获的SOAP响应:
<soap11env:Envelope xmlns:soap11env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://tempuri.org/">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" />
<soap11env:Body>
<tns:getArrayStrResponse>
<tns:getArrayStrResult>
<tns:string>ASD</tns:string>
<tns:string>ASD</tns:string>
<tns:string>ASD</tns:string>
</tns:getArrayStrResult>
</tns:getArrayStrResponse>
</soap11env:Body>
</soap11env:Envelope>
结果为空:
var result = client.getArrayStr();
我做错了什么?