我正在用客户的网络服务做一些测试。WSDL 的定义如下:
<xs:element name="CorretoresGeralRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="codEvPesq" type="xs:long" minOccurs="0"/>
<xs:element name="nmeEvPesq" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CorretoresGeralResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="resultCorretoresGeral" type="tr:ResultCorretoresGeral" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ResultCorretoresGeral">
<xs:sequence>
<xs:element name="corretoresGeral" type="tr:CorretorGeral" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
<xs:element name="listCompleta" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CorretorGeral">
<xs:sequence>
<xs:element name="codAtiv" type="xs:int" minOccurs="0"/>
<xs:element name="dscAtiv" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
当我使用soapUI调用传递参数的方法时,它会正确返回:
但是,当我在我的项目中为它创建一个 Web 引用并通过 C# 代码调用它时,它会返回一个空数组(ServicoTeste 是我为该服务创建的 webreferece 的名称):
ServicoTeste.TransporteClient servico = new ServicoTeste.TransporteClient();
ServicoTeste.CorretoresGeralRequest request = new ServicoTeste.CorretoresGeralRequest();
ServicoTeste.ResultCorretoresGeral[] response;
request.nmeEvPesq = "MAS";
response = servico.CorretoresGeral(request);
关于我做错了什么的任何想法?
谢谢你。