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);
          new String[]{endpoint_x,
        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'));
     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: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" />

<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 name="executeQueryInSpace">
  <soap:operation soapAction="http://www.birst.com/executeQueryInSpace" style="document" />
    <soap:body use="literal" />
          <tns:expression>string-length(//b:query) &lt; 131072</tns:expression>
          <tns:description>Query length must shorter than 128k</tns:description>
          <tns:expression>string-length(/s:Envelope/s:Body/b:executeQueryInSpace/b:token) = 32</tns:expression>
          <tns:description>Invalid token</tns:description>
          <tns:expression>string-length(//b:spaceID) = 36</tns:expression>
          <tns:description>Space ID must be 36 characters</tns:description>
          <tns:expression>string-length(//b:query) &gt; 0</tns:expression>
          <tns:description>Query must contain a value</tns:description>
    <soap:body use="literal" />
  • Can you share the WSDL in question? Feb 21, 2018 at 20:56
  • Also, try capturing the debug log in a developer edition org. It will include the fall SOAP response. You are possibly getting an HTML response rather than a SOAP response. Feb 21, 2018 at 20:58
  • Thank you @DanielBallinger, I edited the question and unfortunately we do not run a developer edition Feb 25, 2018 at 7:41

1 Answer 1


Based on your snippets I assume the WSDL is the same or similar to the one at https://app2102.bws.birst.com/CommandWebService.asmx?WSDL

From your error message:

Web service callout failed: Unable to parse callout response. Apex type not found for element rows

there appears to be something unexpected in the response.

My generated executeQueryInSpace method is expecting to return a wwwBirstCom.CommandQueryResult via the intermediate wwwBirstCom.executeQueryInSpaceResponse_element.executeQueryInSpaceResult.

It is the CommandQueryResult that contains a rows member of type wwwBirstCom.ArrayOfArrayOfString.

If you aren't in a developer edition org where you can see the SOAP response directly you will need to manually call the API from something like SOAPUI so you can see what response comes back. Pay particular attention to how the CommandQueryResult rows appear.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .