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

Previous
Previous
 
 

B Appendix

The following code snippet shows the content of setInboundNamespaceAndOperationInSoap 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/setInboundNamespaceAndOperationInBody/";
 
declare function xf:setInboundNamespaceAndOperationInBody($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:setInboundNamespaceAndOperationInBody($soapBody)