title: Oracle Service Bus - Assign expression
body: <p>I have this problem and I am not sure why it's happening and how to fix it. I have created an OSB peject. In the proxy service pipeline I am doing a Service Callout to a sync SOAP service in another application. The other service needs the request body as below:</p>
  
  <pre><code>  &lt;RequestSelectionValues xmlns="http://www.camstar.com/WebService/WSShopFloor"&gt;
              &lt;inputServiceData xmlns:q1="http://www.camstar.com/WebService/DataTypes" q1:type="OnlineQuery"&gt;
                  &lt;OnlineQuerySetup&gt;
                      &lt;__CDOTypeName/&gt;
                      &lt;__name&gt;xLot By FabLotNumber&lt;/__name&gt;
                  &lt;/OnlineQuerySetup&gt;
                  &lt;Parameters&gt;
                      &lt;__listItem&gt;
                          &lt;Name&gt;FabLotNumber&lt;/Name&gt;
                          &lt;DefaultValue&gt;FAB_Lot_1&lt;/DefaultValue&gt;
                      &lt;/__listItem&gt;
                      &lt;__listItem&gt;
                          &lt;Name&gt;BLOCKOF200ROWS&lt;/Name&gt;
                          &lt;DefaultValue&gt;1&lt;/DefaultValue&gt;
                      &lt;/__listItem&gt;
                  &lt;/Parameters&gt;
              &lt;/inputServiceData&gt;
     &lt;queryOption xmlns:q2="http://www.camstar.com/WebService/DataTypes" q2:type="QueryOption"&gt;
      &lt;RowSetSize&gt;1000&lt;/RowSetSize&gt;
      &lt;StartRow&gt;1&lt;/StartRow&gt;
      &lt;QueryType&gt;user&lt;/QueryType&gt;
      &lt;ChangeCount&gt;0&lt;/ChangeCount&gt;
      &lt;RequestRecordCount&gt;false&lt;/RequestRecordCount&gt;
      &lt;RequestRecordSetAndCount&gt;false&lt;/RequestRecordSetAndCount&gt;
     &lt;/queryOption&gt;
              &lt;serviceInfo xmlns:q3="http://www.camstar.com/WebService/DataTypes" q3:type="OnlineQuery_Info"&gt;
                  &lt;OnlineQuerySelection&gt;
                      &lt;RequestValue&gt;false&lt;/RequestValue&gt;
                      &lt;RequestMetadata&gt;false&lt;/RequestMetadata&gt;
                      &lt;RequestSubFieldValues&gt;false&lt;/RequestSubFieldValues&gt;
                      &lt;RequestSelectionValues&gt;true&lt;/RequestSelectionValues&gt;
                  &lt;/OnlineQuerySelection&gt;
              &lt;/serviceInfo&gt;
    &lt;/RequestSelectionValues&gt;
  </code></pre>
  
  <p>I am using an Assign to put the above expression in a variable.</p>
  
  <p>Notice the line:</p>
  
  <pre><code>&lt;serviceInfo xmlns:q3="http://www.camstar.com/WebService/DataTypes" q3:type="OnlineQuery_Info"&gt;
  </code></pre>
  
  <p>xmlns:q3="http://www.camstar.com/WebService/DataTypes" needs to be before q3:type="OnlineQuery_Info" for the other service to be called successfully otherwise the service call fails.</p>
  
  <p>In the development it looks fine. I can test the assign of expression as well.</p>
  
  <p>When I go to the OSB console to test the service I notice that in the Assign variable the namespace place switches and it becomes like this:</p>
  
  <pre><code>&lt;serviceInfo q3:type="OnlineQuery_Info" xmlns:q3="http://www.camstar.com/WebService/DataTypes"&gt;
  </code></pre>
  
  <p>This makes the service calls to fail. I have tried putting the body payload in an xslt. Result is the same. I am not sure why it switches the type before namespace. The end result is that the service is not working as expected.</p>
  
  <p>Any idea what I can do to fix this issue. How can I prevent the switching?</p>
  
  <p>Thanks</p>