title: gsoap : how to solve namespace error when referencing a group
body: <p>I have two xsd files "hardware.xsd" and "GPU.xsd", both with different target namespaces, and both elementFormDefault qualified.</p>
  
  <p>xmlns:hardware="urn:hardware" and xmlns:gpu="urn:gpu".</p>
  
  <p><strong>hardware.xsd</strong></p>
  
  <pre><code>&lt;xsd:complexType name="ComputerSettings"&gt;
     &lt;xsd:sequence&gt;
        &lt;xsd:group ref="gpu:myGPU"/&gt;
        ...
     &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p><strong>GPU.xsd</strong></p>
  
  <pre><code>&lt;xsd:group name="myGPU"&gt;
     &lt;xsd:sequence&gt;
        &lt;xsd:element name="Frequence" type="xsd:string"/&gt;
        &lt;xsd:element name="DedicatedMemory" type="xsd:string"/&gt;
     &lt;/xsd:sequence&gt;
  &lt;xsd:group/&gt;
  </code></pre>
  
  <p>With this two files, the gsoap schema importer generates a ComputerSettings class, with the attributes Frequence and DedicatedMemory, but he doesn't prefix them with the gpu prefix. So when I send my request then end up in the hardware prefix, and I get a namespace mismatch.</p>
  
  <p>When I delete the group and just declare the two elements Frequence and DedicatedMemory, and in the other files I referenced this two element one by one, it works perfectly. The namespace prefix shows in the header file.</p>
  
  <p>In this case I can replace the group reference, but I have a case in which there is multiple element with the same name in the same target namespace. So the group was here to create a kind of sub-namespace. And so I am able to reference the right element.</p>
  
  <p>Is it a problem with the gsoap tools, or is there a solution?</p>
  
  <p>Thank you for your help.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><strong>header.h</strong> (With group reference)</p>
  
  <pre><code> class hardware__ComputerSettings{ 
   public:
   //  BEGIN GROUP &lt;xs:group name="myGPU"&gt;
   /// Element "Frequence" of XSD type xs:string.
       std::string                          Frequence                      1;  ///&lt;         Required element.
   /// Element "DedicatedMemory" of XSD type xs:string.
       std::string                          DedicatedMemory                1;  ///&lt; Required element.
   //  END OF GROUP
   /// A handle to the soap struct that manages this instance (automatically set).
       struct soap                         *soap                          ;
   };
  </code></pre>
  
  <p>Here the importation only with element references : </p>
  
  <p><strong>hardware.xsd</strong></p>
  
  <pre><code>&lt;xsd:complexType name="ComputerSettings"&gt;
     &lt;xsd:sequence&gt;
        &lt;xsd:element name="Frequence" type="xsd:string"/&gt;
        &lt;xsd:element name="DedicatedMemory" type="xsd:string"/&gt;
     &lt;/xsd:sequence&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p><strong>GPU.xsd</strong></p>
  
  <pre><code>&lt;xsd:element name="Frequence" type="xsd:string"/&gt;
  &lt;xsd:element name="DedicatedMemory" type="xsd:string"/&gt;
  </code></pre>
  
  <p><strong>header.h</strong> (Notice the gpu namespace before the variable names)</p>
  
  <pre><code>class hardware__ComputerSettings
  { public:
  /// Element reference "urn:hardware:""urn:gpu":Frequence.
      std::string                          gpu__Frequence                 1;  ///&lt; Required element.
  /// Element reference "urn:hardware:""urn:gpu":DedicatedMemory.
      std::string                          gpu__DedicatedMemory           1;  ///&lt; Required element.
  /// A handle to the soap struct that manages this instance (automatically set).
      struct soap                         *soap                          ;
  };
  </code></pre>