Calling Mendix services from .Net

I made a Mendix service that calls a microflow that returns a list of SeverityTypes. I then do the standard .Net stuff to call a soap service, and the following code returns the 3 SeverityTypes: authentication authentication = new authentication(); authentication.password = "Pass@word"; authentication.username = "test"; GetAllSeverityTypes getAllSeverityTypes = new GetAllSeverityTypes(); MendixAPIPortTypeClient client = new MendixAPIPortTypeClient(); GetAllSeverityTypesResponseSeverityTypesList[] list=client.GetAllSeverityTypes(authentication, getAllSeverityTypes); How do I get the array into a collection of SeverityTypes with a Name and Description attribute. The wsdl does not contain a SeverityType object. None of the classes in the wsdl have a name and description attribute. So right now I get back the objects, but don't know what object to cast them into. Can someone please share with me a snippet of .Net code showing how they called a Mendix service and the subsequent cast. My wsdl is below: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:xsd="" xmlns:http="" xmlns:soap="" xmlns:tns="" name="MendixAPI" targetNamespace="" xmlns:wsdl=""> <wsdl:types> <xsd:schema targetNamespace=""> <xsd:element name="GetAllSeverityTypes"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> <xsd:element name="GetAllSeverityTypesResponse"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="SeverityTypesList"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="authentication"> <xsd:complexType> <xsd:sequence> <xsd:element name="username" type="xsd:string" /> <xsd:element name="password" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="GetAllSeverityTypesRequest"> <wsdl:part name="request_header" element="tns:authentication" /> <wsdl:part name="parameters" element="tns:GetAllSeverityTypes" /> </wsdl:message> <wsdl:message name="GetAllSeverityTypesResponse"> <wsdl:part name="result" element="tns:GetAllSeverityTypesResponse" /> </wsdl:message> <wsdl:portType name="MendixAPIPortType"> <wsdl:operation name="GetAllSeverityTypes"> <wsdl:documentation> </wsdl:documentation> <wsdl:input message="tns:GetAllSeverityTypesRequest" /> <wsdl:output message="tns:GetAllSeverityTypesResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="MendixAPISoap" type="tns:MendixAPIPortType"> <soap:binding transport="" /> <wsdl:operation name="GetAllSeverityTypes"> <soap:operation soapAction="" /> <wsdl:input> <soap:header message="tns:GetAllSeverityTypesRequest" part="request_header" use="literal" /> <soap:body use="literal" parts="parameters" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="MendixAPI"> <wsdl:port name="MendixAPIPort" binding="tns:MendixAPISoap"> <soap:address location="http://localhost:8080/ws/MendixAPI/" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
1 answers

The SeverityTypesList element in the WSDL has no child elements, meaning that you did not tick the Name and Description attributes in the published operation's return type. If you tick those attributes, they will be added to the WSDL and to the reponse when calling the web service. Regenerating the .NET side with the updated WSDL will also add the fields to the GetAllSeverityTypesResponseSeverityTypesList class.