Go to primary content
Oracle® Retail Service Backbone Developers Guide
19.0
F23588-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

A Appendix

The following code snippet shows the content of setOutboundNamespaceAndOperationInSoap xquery file:

xquery version "1.0" encoding "UTF-8";
(:: pragma  parameter="$soapBody" type="xs:anyType" ::)
(:: pragma  type="xs:anyType" ::)
 
declare namespace xf = "http://tempuri.org/oms-CustomerOrder-AppServiceDecorator/xquery/setOutboundNamespaceAndOperationInSoap/";
 
declare function xf:setOutboundNamespaceAndOperationInSoap($soapBody as element(*))
        as element(*) {
         
    let $namespace := fn-bea:serialize(fn:namespace-uri($soapBody/*[1]))
    let $operation := local-name($soapBody/*[1])
 
        let $destNamespace :=      
                'http://www.oracle.com/retail/oms/integration/services/CustomerOrderService/v1'
    
        let $destOperation :=
        if($operation= "queryMyCustomerOrderResponse")  then
                'queryCustomerOrderResponse'
         
        else if($operation= "createMyCustomerOrderResponse")  then
                'createCustomerOrderResponse'    
                 
        else
                $operation
 
        let $updatedNsBody := replace(fn-bea:serialize($soapBody),$namespace,$destNamespace)
    
        let $updatedOperationBody := replace(fn-bea:serialize($updatedNsBody),$operation,$destOperation)      
 
        return fn-bea:inlinedXML($updatedOperationBody)
};
 
declare variable $soapBody as element(*) external;
 
xf:setOutboundNamespaceAndOperationInSoap($soapBody)