title: WSO2 PayloadFactory mediator not transforming parameters
body: <p>I am unable to get PayloadFactory mediator to transform input arguments to what the service expects.</p>
  
  <p>I have a requirement to support legacy APIs by looking at input request and providing default values for new parameters or perform data type transformations at the WSO2 layer. For the purpose of PoC, I am trying to send an input argument val while the service expects value but I do not see the input argument correctly reaching the service. Below is the in sequence I am using:</p>
  
  <pre><code>&lt;definitions xmlns="http://ws.apache.org/ns/synapse" name="sample1"&gt;
      &lt;sequence name="sample1"&gt;
          &lt;in&gt;
              &lt;!-- using payloadFactory mediator to transform the request message --&gt;
              &lt;payloadFactory media-type="xml"&gt;
                  &lt;format&gt;
                      &lt;tem:GetData xmlns:tem="http://localhost/LegacyService/Service1.svc"&gt;
                          &lt;tem:value&gt;$1&lt;/tem:value&gt;
                      &lt;/tem:GetData&gt;
                  &lt;/format&gt;
                  &lt;args&gt;
                      &lt;arg xmlns:tem="http://localhost/LegacyService/Service1.svc" expression="//tem:val"/&gt;
                  &lt;/args&gt;
              &lt;/payloadFactory&gt;
          &lt;/in&gt;
  
          &lt;send/&gt;
      &lt;/sequence&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>Here is the web request that I am making using SOAPUI:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;tem:GetData&gt;
           &lt;!--Optional:--&gt;
           &lt;tem:val&gt;2000&lt;/tem:val&gt;
        &lt;/tem:GetData&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>How can I troubleshoot this? </p>