Hi. I am consuming a web service from a third party site. I have the type and method in the wsdl file called GetItemAvailable. When i consume and execute the service it returns a SOAP array (defined in the wsdl as ItemsArray). The porblem is, i'm not sure what type i need to use to get to the information. here is my code:
GetItemAvailable.GetItemAvailable gia = new GetItemAvailable.GetItemAvailable();
ItemsArray ia = new ItemsArray();
ia = (gia.CallGetItemAvailable("1088507721", "9780842387491"));
string sttest = ia.id[1].ToString();
The error always says that ia.id is null
what am i doing wrong? i'm not very familiar with SOAP. Here is the wsdl:
<wsdl:definitions>
<wsdl:types>
<xsd:complexType name="Items">
<xsd:all>
<xsd:element name="item_id" type="xsd:string" />
<xsd:element name="tn_onhand" type="xsd:int" />
<xsd:element name="tn_onorder" type="xsd:string" />
<xsd:element name="tn_onorder_eta" type="xsd:string" />
<xsd:element name="nv_onhand" type="xsd:int" />
<xsd:element name="nv_onorder" type="xsd:string" />
<xsd:element name="nv_onorder_eta" type="xsd:string" />
<xsd:element name="error" type="xsd:string" />
</xsd:all>
</xsd:complexType>
<xsd:complexType name="ItemsArray">
<xsd:complexContent mixed="false">
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute wsdl:arrayType="tns:Items[]" ref="SOAP-ENC:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="GetItemAvailableRequestType">
<xsd:all>
<xsd:element name="api_key" type="xsd:string" />
<xsd:element name="Items" type="xsd:string" />
</xsd:all>
</xsd:complexType>
<xsd:complexType name="GetItemAvailableResponseType">
<xsd:all>
<xsd:element name="GetItemAvailableResult" type="tns:ItemsArray" />
</xsd:all>
</xsd:complexType>
<xsd:element name="GetItemAvailable" type="tns:GetItemAvailableRequestType" />
<xsd:element name="GetItemAvailableResponse" type="tns:GetItemAvailableResponseType" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetItemAvailableRequest">
<wsdl:part name="parameters" element="tns:GetItemAvailable" />
</wsdl:message>
<wsdl:message name="GetItemAvailableResponse">
<wsdl:part name="parameters" element="tns:GetItemAvailableResponse" />
</wsdl:message>
<wsdl:portType name="GetItemAvailablePortType">
<wsdl:operation name="GetItemAvailable">
<documentation>Returns quantity available and on order for list of products seperated by comma (example: 9780877840756,9780446691093)</documentation>
<wsdl:input message="tns:GetItemAvailableRequest" />
<wsdl:output message="tns:GetItemAvailableResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GetItemAvailableBinding" type="tns:GetItemAvailablePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetItemAvailable">
<soap:operation soapAction="http://www.stl-distribution.com/GetItemAvailable" style="document" />
<wsdl:input>
<soap:body use="literal" namespace="http://www.stl-distribution.com" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://www.stl-distribution.com" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GetItemAvailable">
<wsdl:port name="GetItemAvailablePort" binding="tns:GetItemAvailableBinding">
<soap:address location="http://www.stl-distribution.com/webservices/soap/GetItemAvailable.php" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>