<p>I'm using <a href="http://sourceforge.net/projects/nusoap/" rel="nofollow noreferrer">nusoap</a> to connect to a soap webservice. The xml that the class sends to the service is constructed from an array, ie:</p>

<pre><code>$params = array("param1" =&gt; "value1", "param2" =&gt; "value1");
$client-&gt;call('HelloWorld', $params, 'namespace', 'SOAPAction');
</code></pre>

<p>This works fine. A multidimensional array also constructs a nice nested xml message. </p>

<p>I encounter a problem when i need two tags with the same name:</p>

<pre><code>&lt;items&gt;
   &lt;item&gt;value 1&lt;/item&gt;
   &lt;item&gt;value 2&lt;/item&gt;
&lt;/item&gt;

$params = array("items" =&gt; array("item" =&gt; "value 1", "item" =&gt; "value 2"));
</code></pre>

<p>The second item in the array overwrites the first which results in:</p>

<pre><code>&lt;items&gt;
   &lt;item&gt;value 2&lt;/item&gt;
&lt;/item&gt;
</code></pre>

<p>How can achieve this?</p>

The problem is with the inner array()
```
```
$test_array = array("item" => "value 1", "item" => "value 2");
```
```
creates an array with a single key ("item").
Try this and see if it works:
```
```
$params = array("items" => array("item" => array("value 1", "value 2")));
```
```
No guarantees, though... I haven't used nusoap in a
long
time and don't have PHP installed here to test it.