Adding a filter to a SOAP query is just a matter of adding the <filter> section to the XML;
I totally get that. And that's why I did my troubleshooting/prototyping with SOAPUI.
The XML that works perfectly via SOAP UI is this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:quer="http://www.niku.com/xog/Query">
<soapenv:Header>
<quer:Auth>
<quer:Username>username</quer:Username>
<quer:Password>password</quer:Password>
</quer:Auth>
</soapenv:Header>
<soapenv:Body>
<quer:Query>
<quer:Code>***.yyy.prjReview</quer:Code>
<quer:Filter>
<quer:project_int_id>1234567</quer:project_int_id>
</quer:Filter>
</quer:Query>
</soapenv:Body>
</soapenv:Envelope>
And the native soapclient PHP code I've been working with is:
$url = "http://somedomain.com/niku/wsdl/Query/***.yyy.prjReview";
$auth = array('Username' => 'username', 'Password' => 'password');
$client = new SoapClient($url, array("trace" => 1, "exception" => 0));
$header = new SOAPHeader('http://www.niku.com/xog/Query', 'Auth', $auth);
$client->__setSoapHeaders($header);
$query = array(
'Query' => array(
'Code' => '***.yyy.prjReview',
'Filter' => array('project_int_id' => '1234567'),
),
);
try {
$result = $client->__soapCall('Query', $query);
var_dump($result);
} catch (SoapFault $fault) {
echo ("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})");
}
Which produces this XML:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.niku.com/xog/Query">
<SOAP-ENV:Header>
<ns1:Auth>
<ns1:Username>username</ns1:Username>
<ns1:Password>password</ns1:Password>
</ns1:Auth>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:Query>
<ns1:Code>***.yyy.prjReview</ns1:Code>
<ns1:Filter>
<ns1:project_int_id>1234567</ns1:project_int_id>
</ns1:Filter>
</ns1:Query>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
It logs in fine, but appears to be ignoring the filter and simply returning all the results for that query.