We have a Java backend which serves web services via WSDLs. There are some operations that return xxWSResponse with only 1 property in it: an array.
When we add service reference in Visual Studio to the web service, VS generates the code to return the array directly, not the response. If there are more properties in the response or more arrays it works like it supposed to and returns the response.
Operation sample:
<wsdl:operation name="retrieveParameterTasksList">
<wsdl:documentation> isIdempotent = NO -- TR:/retrieveParameterTasksList{retrieveParameterTasksList} -- EN:/retrieveParameterTasksList{retrieveParameterTasksList} </wsdl:documentation>
<wsdl:input message="tns:retrieveParameterTasksListRequestMsg" name="RetrieveParameterTasksListWSRequest" />
<wsdl:output message="tns:retrieveParameterTasksListResponseMsg" name="RetrieveParameterTasksListWSResponse" />
<wsdl:fault message="tns:SystemFault" name="SystemFault" />
<wsdl:fault message="tns:BusinessFault" name="BusinessFault" />
</wsdl:operation>
RetrieveParameterTasksListWSResponse:
<xsd:complexType name="RetrieveParameterTasksListWSResponse">
<xsd:sequence>
<xsd:element form="qualified" name="taskListVOs" type="this:TasksListParameterDTO" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
Auto generated code by VS:
public namespace.TasksListParameterDTO[] retrieveParameterTasksList(namespace.RetrieveParameterTasksListWSRequest RetrieveParameterTasksListWSRequest) {
namespace.RetrieveParameterTasksListWSRequest1 inValue = new namespace.RetrieveParameterTasksListWSRequest1();
inValue.RetrieveParameterTasksListWSRequest = RetrieveParameterTasksListWSRequest;
namespace.RetrieveParameterTasksListWSResponse retVal = ((namespace.WebServiceV1x0)(this)).retrieveParameterTasksList(inValue);
return retVal.RetrieveParameterTasksListWSResponse1;
}
My question: Why does Visual Studio ignores the response type and return the array in it? How can I make it return the actual response?
Thank you!