Friday, July 29, 2011

OSB find which Proxy Service is being invoked

I am a bit unsure how better to identify the Message Flow which is currently being executed;
The $inbound variable is:

<con:endpoint name="ProxyService$pierreTests$identifyFlow$identifyFlowPS" xmlns:con="">

so, if you use the name attribute of inbound you have this Xquery:

xquery version "1.0" encoding "Cp1252";
(:: pragma  parameter="$anyType1" type="xs:anyType" ::)

declare namespace xf = "";
declare namespace con = "";
declare namespace tran = "";

declare function xf:getEndpointFromInbound($inbound1 as element())
    as xs:string {
       let $myendpoint := $inbound1/./@name
       fn:tokenize($myendpoint, '\$')[last()]

declare variable $inbound1 as element() external;



This method is far better than using the transport/uri, since the latter is present only in HTTP Proxies, while the inbound/@name is present in ALL proxies.

No comments: