Difference between replace entire node and replace node contents in OSB

萝らか妹 提交于 2019-12-13 02:13:22

问题


I have recently started using OSB and i came across the feature "replace entire node or replace node contents". Could anyone help me in listing out the difference between the two with examples. This is a very basic question but i just started learning osb and wanted to get this right.

Thanks in advance.

Cheers..


回答1:


OK, let's assume you have a variable, $body. Your proxy has done some stuff, and already has $body set, and you want to run it through an xquery transform before you return it.

$body will be something like

<soap:Body xmlns:soap="etc">
  <ns0:response xmlns:ns0="etc2">
    <ns0:item>
      <!-- etc etc -->
    </ns0:item>
  </ns0:response>
</soap:Body>

If you replace the entire node, you must replace it with a <soap:Body>. (I mean, you could replace it with something different, but you'll encounter an error somewhere because OSB expects $body to be a certain type)

If you replace the node contents, you may replace it with anything: perhaps a transformed <ns0:response>, but it's common to replace it with totally different elements. Either way, the <soap:Body> element is unaffected, and all the insides are scooped out and replaced.

Most of the time, you'll replace node contents of $body rather than replacing the entire node, but if it's a variable you've created yourself, it could go either way depending on what you want.



来源:https://stackoverflow.com/questions/35226354/difference-between-replace-entire-node-and-replace-node-contents-in-osb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!