title: How to add prefix to the child elements of SOAP client?
body: <p>I need to write a SOAP client to send a request message, I could successfully send the request but I need to amend the message, the only required modification is to add prefix to the child elements.
  Once I've used the following code but nothing happen.</p>
  
  <pre><code>WebsiteConfigID.addNamespaceDeclaration("v3", "http://tnwebservices.ticketnetwork.com/tnwebservice/v3.2");
  </code></pre>
  
  <p><strong>Current output</strong></p>
  
  <pre><code>&lt;env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" 
                xmlns:v3="http://tnwebservices.ticketnetwork.com/tnwebservice/v3.2"&gt;
     &lt;env:Header/&gt;
     &lt;env:Body&gt;
         &lt;GetEvents&gt;
            &lt;websiteConfigID&gt;1111&lt;/websiteConfigID&gt;
            &lt;cityZip&gt;Paris&lt;/cityZip&gt;
         &lt;/GetEvents&gt;
     &lt;/env:Body&gt;
  &lt;/env:Envelope&gt;
  </code></pre>
  
  <p><strong>Expected output</strong></p>
  
  <pre><code> &lt;env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" 
                xmlns:v3="http://tnwebservices.ticketnetwork.com/tnwebservice/v3.2"&gt;
     &lt;env:Header/&gt;
     &lt;env:Body&gt;
         &lt;v3:GetEvents&gt;     &lt;&lt;prefix is added
            &lt;v3:websiteConfigID&gt;1111&lt;/v3:websiteConfigID&gt;  &lt;&lt;prefix is added
            &lt;v3:cityZip&gt;Paris&lt;/v3:cityZip&gt;  &lt;&lt;prefix is added
         &lt;/v3:GetEvents&gt;  
     &lt;/env:Body&gt;
   &lt;/env:Envelope&gt;
  </code></pre>
  
  <p><strong>Code</strong></p>
  
  <pre><code>    SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
  
      SOAPConnection connection = soapConnectionFactory.createConnection();
  
      SOAPMessage message = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL).createMessage();
  
  
  
      SOAPBody body = message.getSOAPBody();
      SOAPPart part = message.getSOAPPart();
      SOAPEnvelope envelope = part.getEnvelope();
      envelope.addNamespaceDeclaration("v3", "http://tnwebservices.ticketnetwork.com/tnwebservice/v3.2");
      SOAPFactory soapFactory = SOAPFactory.newInstance();
  
      Name bodyName;
      bodyName = soapFactory.createName("GetEvents");
  
      SOAPBodyElement getEvents = body.addBodyElement(bodyName);
      Name childName = soapFactory.createName("websiteConfigID");
      SOAPElement WebsiteConfigID = getEvents.addChildElement(childName);
      WebsiteConfigID.addTextNode("1111");
  
      childName = soapFactory.createName("cityZip");
      SOAPElement CityZip = getEvents.addChildElement(childName);
      CityZip.addTextNode("Paris");
  
      message.writeTo(System.out);
  </code></pre>