Rename the Namespace:
Sometimes we need to rename the namespace as the target xml doesn't have the same namespace as source xml. We have done this lots of time in BPEL through XSLT, lets see in the OSB using built in Activity here.
There is the Rename Activity which can be used to the same as below :
My request XML :
<say:NewOperation | xmlns:say="http://www.example.org/sayHello/"> |
Here I came across the requirement where
has the namespace as http://x.y.com/z in target XML
so I have tried the simple approach of rename activity where
select the element in the Xpath field.
put body in the "In Variable" as the request payload comes under body variable.
leave the Localname as blank
provide the namespace value in the namespace field
Request payload:
<soapenv:Envelope | xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> |
| <soap:Header | xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> |
| <say:NewOperation | xmlns:say="http://www.example.org/sayHello/"> |
| </soapenv:Envelope>
Response payload:
| <soapenv:Envelope | xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> |
| <soap:Header | xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> |
| <say:NewOperation | xmlns:say="http://www.example.org/sayHello/"> |
| <z:in2 | xmlns:z="http://x.y.com/z">string</z:in2> |
|
|
|