dark ducke

dark ducke

  • NA
  • 1
  • 1.7k

Consuming webservice with C #, return complex type array

Oct 29 2013 1:27 PM

Hello guys I need help to consume a webservice with the structure below ... I have the following WSDL:

<xsd:complexType name="ArrayOfarrayPartidas">
    <xsd:complexContent mixed="false">
      <xsd:restriction base="soap-enc:Array">
        <xsd:attribute wsdl:arrayType="tns:arrayPartidas[]" ref="soap-enc:arrayType" />
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:complexType name="arrayPartidas">
    <xsd:all>
      <xsd:element name="codigo" type="xsd:int" />
      <xsd:element name="data" type="xsd:string" />
      <xsd:element name="hora" type="xsd:string" />
      <xsd:element name="data_inicio_venda" type="xsd:string" />
      <xsd:element name="hora_inicio_venda" type="xsd:string" />
      <xsd:element name="partida" type="xsd:string" />
      <xsd:element name="estadio" type="xsd:string" />
      <xsd:element name="campeonato" type="xsd:string" />
      <xsd:element name="cadeira" type="xsd:string" />
    </xsd:all>
  </xsd:complexType>
  <xsd:complexType name="retConsultarPartidas">
    <xsd:all>
      <xsd:element name="arrayPartidas" type="tns:ArrayOfarrayPartidas" />
      <xsd:element name="sucesso" type="xsd:string" />
    </xsd:all>
  </xsd:complexType>

I am not able to consume the method as follows:


Fcard_VendorServicesService fc = new Fcard_VendorServicesService(); retConsultarPartidas retCP = fc.consultarPartidas(); ArrayOfarrayPartidas afp = retCP.arrayPartidas;

how to access the values ??of:

<xsd:element name="codigo" type="xsd:int" />   <xsd:element name="data" type="xsd:string" />   <etc...>

thanks!