I'm trying to retrieve data from Birst using WSDL. I generated the WSDL on Salesforce and got the generated Apex classes and the method executeQueryInSpace:
public WS_Birst_wwwBirstCom.CommandQueryResult executeQueryInSpace(String token,String query,String spaceID) {
WS_Birst_wwwBirstCom.executeQueryInSpace_element request_x = new WS_Birst_wwwBirstCom.executeQueryInSpace_element();
request_x.token = token;
request_x.query = query;
request_x.spaceID = spaceID;
WS_Birst_wwwBirstCom.executeQueryInSpaceResponse_element response_x;
Map<String, WS_Birst_wwwBirstCom.executeQueryInSpaceResponse_element> response_map_x = new Map<String, WS_Birst_wwwBirstCom.executeQueryInSpaceResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://www.birst.com/executeQueryInSpace',
'http://www.birst.com/',
'executeQueryInSpace',
'http://www.birst.com/',
'executeQueryInSpaceResponse',
'WS_Birst_wwwBirstCom.executeQueryInSpaceResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.executeQueryInSpaceResult;
}
When I call the method as follow:
token = soapInstance.Login(username, ssopassword);
soapInstance.inputHttpHeaders_x.put('Cookie', soapInstance.outputHttpHeaders_x.get('Set-Cookie'));
try{
WS_Birst_wwwBirstCom.CommandQueryResult response_x;
response_x = soapInstance.executeQueryInSpace(token, query ,spaceId);
}
catch(Exception e){}
I keep getting the error: " Web service callout failed: Unable to parse callout response. Apex type not found for element rows"
Edit - relevant WSDL attached:
<s:element name="executeQueryInSpace">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="token" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="spaceID" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<wsdl:operation name="executeQueryInSpace">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Execute a Birst Logical Query. Arguments are the Login token, the Birst logical query, and the space Id. Returns the first 1000 results. See queryMore for retrieving the remainder.</wsdl:documentation>
<wsdl:input message="tns:executeQueryInSpaceSoapIn" />
<wsdl:output message="tns:executeQueryInSpaceSoapOut" />
</wsdl:operation>
<wsdl:operation name="executeQueryInSpace">
<soap:operation soapAction="http://www.birst.com/executeQueryInSpace" style="document" />
<wsdl:input>
<soap:body use="literal" />
<tns:validation>
<tns:assertions>
<tns:assert>
<tns:expression>string-length(//b:query) < 131072</tns:expression>
<tns:description>Query length must shorter than 128k</tns:description>
</tns:assert>
<tns:assert>
<tns:expression>string-length(/s:Envelope/s:Body/b:executeQueryInSpace/b:token) = 32</tns:expression>
<tns:description>Invalid token</tns:description>
</tns:assert>
<tns:assert>
<tns:expression>string-length(//b:spaceID) = 36</tns:expression>
<tns:description>Space ID must be 36 characters</tns:description>
</tns:assert>
<tns:assert>
<tns:expression>string-length(//b:query) > 0</tns:expression>
<tns:description>Query must contain a value</tns:description>
</tns:assert>
</tns:assertions>
</tns:validation>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>