Formatting Soap into a PHP query
<p>I have a soap function, called selectCmDevice, that I'm having trouble formatting into a php statement to run a query.  In the WSDL, selectCmDevice looks like this (I've included only the relevant parts);</p>

<pre><code>&lt;element name="selectCmDevice"&gt;
&lt;complexType&gt;
&lt;sequence&gt;
&lt;element name="StateInfo" type="xsd:string"/&gt;
&lt;element name="CmSelectionCriteria" type="tns:CmSelectionCriteria"/&gt;
&lt;/sequence&gt;
</code></pre>

<h2>    </h2>

<pre><code>&lt;complexType name="CmSelectionCriteria"&gt;
&lt;sequence&gt;
&lt;element name="MaxReturnedDevices" nillable="true" type="xsd:unsignedInt"/&gt;
&lt;element name="DeviceClass" nillable="true" type="xsd:string"/&gt;
&lt;element name="Model" nillable="true" type="xsd:unsignedInt"/&gt;
&lt;element name="Status" nillable="true" type="xsd:string"/&gt;
&lt;element name="NodeName" nillable="true" type="xsd:string"/&gt;
&lt;element name="SelectBy" nillable="true" type="tns:CmSelectBy"/&gt;
&lt;element name="SelectItems" nillable="true" type="tns:ArrayOfSelectItem"/&gt;
&lt;element name="Protocol" nillable="true" type="tns:ProtocolType"/&gt;
&lt;element name="DownloadStatus" nillable="true" type="tns:DeviceDownloadStatus"/&gt;
&lt;/sequence&gt;
</code></pre>

<h2>    </h2>

<pre><code>&lt;simpleType name="CmSelectBy"&gt;
&lt;restriction base="xsd:string"&gt;
&lt;enumeration value="Name"/&gt;
&lt;enumeration value="IPV4Address"/&gt;
&lt;enumeration value="IPV6Address"/&gt;
&lt;enumeration value="DirNumber"/&gt;
&lt;enumeration value="Description"/&gt;
&lt;/restriction&gt;
</code></pre>

<h2>    </h2>

<pre><code>&lt;complexType name="ArrayOfSelectItem"&gt;
&lt;sequence&gt;
&lt;element maxOccurs="unbounded" minOccurs="0" name="item" type="tns:SelectItem"/&gt;
&lt;/sequence&gt;
</code></pre>

<h2>    </h2>

<pre><code>&lt;complexType name="SelectItem"&gt;
&lt;sequence&gt;
&lt;element name="Item" nillable="true" type="xsd:string"/&gt;
&lt;/sequence&gt;
</code></pre>

<h2>    </h2>

<pre><code>&lt;simpleType name="ProtocolType"&gt;
&lt;restriction base="xsd:string"&gt;
&lt;enumeration value="Any"/&gt;
&lt;enumeration value="SCCP"/&gt;
&lt;enumeration value="SIP"/&gt;
&lt;enumeration value="Unknown"/&gt;
&lt;/restriction&gt;
</code></pre>

<h2>    </h2>

<pre><code>&lt;simpleType name="DeviceDownloadStatus"&gt;
&lt;restriction base="xsd:string"&gt;
&lt;enumeration value="Any"/&gt;
&lt;enumeration value="Upgrading"/&gt;
&lt;enumeration value="Successful"/&gt;
&lt;enumeration value="Failed"/&gt;
&lt;enumeration value="Unknown"/&gt;
&lt;/restriction&gt;
&lt;/simpleType&gt;
</code></pre>

<p>So, I've written a query to that seems to be accepted when I run it in PHP, but it doesn't pull anything I specify - it pulls everything in the system.  It doesn't accept anything in <strong>insertVariableHere</strong>;</p>

<pre><code>$deviceIP = $soapClient-&gt;selectCmDevice
(array('StateInfo' =&gt; '', 'CmSelectionCriteria' =&gt; 
(array('SelectBy'=&gt;'Name','Status'=&gt;'Registered','SelectItems'=&gt;
array('SelectItem[0]'=&gt;
array('Item'=&gt;'insertVariableHere'))))));
</code></pre>

<p>I'm not sure if soap values for tns are being written properly in php.  Any help is greatly appreciated.</p>