title: Delphi 2007 isn't generating the XML I want to send to my Java-WS web service
body: <p>I have a Java web service to which I've linked from a Delphi 2007 app using the WSDL Importer. Setting it up has been a <a href="https://stackoverflow.com/questions/462171/delphi-2007-not-consuming-jax-ws-web-service-properly">rocky road</a> but I'm almost there!</p>
  
  <p>I now have the situation where my arrays aren't being serialized in a way that my Java web service can consume. I've written the same app in .Net to test it out (it works fine) and the XML I'm looking to generate looks like this: -</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;SOAP-ENV:Envelope
          xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;
      &lt;SOAP-ENV:Body xmlns:NS2="http://path.to.service"&gt;
          &lt;NS1:addActivities xmlns:NS1="http://path.to.service/"&gt;
              &lt;login href="#1"/&gt;
              &lt;project xsi:type="xsd:string"&gt;PROJ001&lt;/project&gt;
              &lt;activities&gt;
                  &lt;id xsi:type="xsd:string"&gt;DELPHITEST&lt;/id&gt;
                  &lt;name xsi:type="xsd:string"&gt;This is a test&lt;/name&gt;
              &lt;/activities&gt;
              &lt;activities&gt;
                  &lt;id xsi:type="xsd:string"&gt;DELPHITEST2&lt;/id&gt;
                  &lt;name xsi:type="xsd:string"&gt;This is another test&lt;/name&gt;
              &lt;/activities&gt;
          &lt;/NS1:addActivities&gt;
          &lt;NS2:login id="1" xsi:type="NS2:login"&gt;
              &lt;database xsi:type="xsd:string"&gt;My_database&lt;/database&gt;
              &lt;password xsi:type="xsd:string"&gt;neverUmind&lt;/password&gt;
              &lt;username xsi:type="xsd:string"&gt;bob&lt;/username&gt;
          &lt;/NS2:login&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>However, the XML that Delphi generates is as follows: -</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;SOAP-ENV:Envelope 
          xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;
      &lt;SOAP-ENV:Body xmlns:NS2="http://path.to.service/"&gt;
          &lt;NS1:addActivities xmlns:NS1="http://path.to.service/"&gt;
              &lt;login href="#1"/&gt;
              &lt;project xsi:type="xsd:string"&gt;PROJ001&lt;/project&gt;
              &lt;activities xsi:type="SOAP-ENC:Array" 
                      SOAP-ENC:arrayType="NS2:activity[2]"&gt;
                  &lt;item href="#2"/&gt;
                  &lt;item href="#3"/&gt;
              &lt;/activities&gt;
          &lt;/NS1:addActivities&gt;
          &lt;NS2:login id="1" xsi:type="NS2:login"&gt;
              &lt;database xsi:type="xsd:string"&gt;My_database&lt;/database&gt;
              &lt;password xsi:type="xsd:string"&gt;neverUmind&lt;/password&gt;
              &lt;username xsi:type="xsd:string"&gt;bob&lt;/username&gt;
          &lt;/NS2:login&gt;
          &lt;NS2:activity id="2" xsi:type="NS2:activity"&gt;
              &lt;id xsi:type="xsd:string"&gt;DELPHITEST&lt;/id&gt;
              &lt;name xsi:type="xsd:string"&gt;This is a test&lt;/name&gt;
          &lt;/NS2:activity&gt;
          &lt;NS2:activity id="3" xsi:type="NS2:activity"&gt;
              &lt;id xsi:type="xsd:string"&gt;DELPHITEST2&lt;/id&gt;
              &lt;name xsi:type="xsd:string"&gt;This is another test&lt;/name&gt;
          &lt;/NS2:activity&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Basically, I need Delphi to stop creating <strong>activity</strong> elements within the <strong>activities</strong> element and instead just put each ID and Name inside the an activities element (as .Net does and Java seems to expect). </p>
  
  <p>I've buggered about with the InvRegistry.RegisterInvokeOptions and the RemClassRegistry.RegisterSerializeOptions but none of the combinations seem to work. To be honest I'm on the verge of writting my own XML parser for this as it's taking way to long to figure out. However, if anyone has any suggestions on how this should work I'd be very grateful.</p>
  
  <p>Surely somebody out there must have consumed a Java-WS web service via Delphi 2007 before :)</p>
  
  <p>TIA</p>