asyncConv.xts 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2016
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml" requiredCapability="canUseEventStudio">
  9. <!--
  10. ===============================================================================================
  11. wait - issue the wait async request
  12. ===============================================================================================
  13. -->
  14. <xts:block id="wait" mode="interpret" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name='promptResponse']) and /root/env/param[@name='conversation'] and /root/env/param[@name='doWait']='1']" mandatory="false">
  15. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  16. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  17. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  18. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  19. <xsl:template match="/">
  20. <xsl:variable name="soapAction">
  21. <xsl:choose>
  22. <xsl:when test="key('env-param', 'soapAction') and key('env-param', 'soapAction') = 'AGENT_SERVICE_SOAPACTION' ">
  23. <xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201505/</xsl:text>
  24. </xsl:when>
  25. <xsl:otherwise>
  26. <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
  27. </xsl:otherwise>
  28. </xsl:choose>
  29. </xsl:variable>
  30. <xsl:variable name="requestNamespace">
  31. <xsl:choose>
  32. <xsl:when test="key('env-param', 'requestNamespace') and key('env-param', 'requestNamespace') != '' ">
  33. <xsl:value-of select="key('env-param', 'requestNamespace')"/>
  34. </xsl:when>
  35. <xsl:otherwise>
  36. <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
  37. </xsl:otherwise>
  38. </xsl:choose>
  39. </xsl:variable>
  40. <xts:sequence>
  41. <xts:append select="/root">
  42. <response>
  43. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" outputHeader="true" option="xml-multipart">
  44. <xsl:attribute name="soapAction">
  45. <xsl:value-of select="$soapAction"/>
  46. <xsl:text>.absolute</xsl:text>
  47. </xsl:attribute>
  48. <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  49. <SOAP-ENV:Header>
  50. <bus:biBusHeader xsi:type="bus:biBusHeader">
  51. <xsl:choose>
  52. <xsl:when test="/root/env/param[@name='disp_trackingInfo'] and /root/env/param[@name='disp_trackingInfo']!='' ">
  53. <!-- copy the tracking information from previous request -->
  54. <bus:tracking>
  55. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='disp_trackingInfo'])), true())" disable-output-escaping="yes"/>
  56. </bus:tracking>
  57. <xsl:copy-of select="/root/header/*[local-name()='biBusHeader']/*[local-name() != 'tracking']"/>
  58. </xsl:when>
  59. <xsl:otherwise>
  60. <xsl:copy-of select="/root/header/bus:biBusHeader/*"/>
  61. </xsl:otherwise>
  62. </xsl:choose>
  63. </bus:biBusHeader>
  64. </SOAP-ENV:Header>
  65. <SOAP-ENV:Body>
  66. <xsl:element name="wait" namespace="{$requestNamespace}">
  67. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  68. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='conversation'])), true())" disable-output-escaping="yes"/>
  69. </bus:conversation>
  70. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  71. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  72. </xsl:element>
  73. </SOAP-ENV:Body>
  74. </SOAP-ENV:Envelope>
  75. </xts:request>
  76. </response>
  77. </xts:append>
  78. </xts:sequence>
  79. </xsl:template>
  80. </xsl:stylesheet>
  81. </xts:block>
  82. <!--
  83. ===============================================================================================
  84. getOutput - Special case to handle complete.
  85. With complete, we just need to call getOutput to get the actual output, so do it here instead of bouncing through the browser .
  86. ===============================================================================================
  87. -->
  88. <xts:block id="getOutput" dependency="wait" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/env/param[@name='promptResponse']) and /root/env/param[@name='doWait']='1' and /root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='status'] = 'responseReady']" mandatory="false" nodelist="header, env, response">
  89. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl xts xos cm bus SOAP-ENV xsi">
  90. <xsl:output method="xml"/>
  91. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  92. <xsl:template match="/root">
  93. <xsl:variable name="requestNamespace">
  94. <xsl:choose>
  95. <xsl:when test="key('env-param', 'requestNamespace') and key('env-param', 'requestNamespace') != '' ">
  96. <xsl:value-of select="key('env-param', 'requestNamespace')"/>
  97. </xsl:when>
  98. <xsl:otherwise>
  99. <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
  100. </xsl:otherwise>
  101. </xsl:choose>
  102. </xsl:variable>
  103. <!-- default is report server request - but we can fire to other places too -->
  104. <xsl:variable name="soapAction">
  105. <xsl:choose>
  106. <xsl:when test="key('env-param', 'soapAction') and key('env-param', 'soapAction') = 'AGENT_SERVICE_SOAPACTION' ">
  107. <xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201404/</xsl:text>
  108. </xsl:when>
  109. <xsl:otherwise>
  110. <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
  111. </xsl:otherwise>
  112. </xsl:choose>
  113. </xsl:variable>
  114. <xts:sequence>
  115. <xts:replace select="/root/response">
  116. <response>
  117. <!-- replace the existing response -->
  118. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" outputHeader="true" option="xml-multipart">
  119. <xsl:attribute name="soapAction">
  120. <xsl:value-of select="$soapAction"/>
  121. <xsl:text>.absolute</xsl:text>
  122. </xsl:attribute>
  123. <SOAP-ENV:Envelope>
  124. <SOAP-ENV:Header>
  125. <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  126. <xsl:copy-of select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']"/>
  127. <xsl:apply-templates select="header/bus:biBusHeader/*[local-name()!='tracking']"/>
  128. </bus:biBusHeader>
  129. </SOAP-ENV:Header>
  130. <SOAP-ENV:Body>
  131. <xsl:element name="getOutput" namespace="{$requestNamespace}">
  132. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  133. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param', 'conversation'))), true())" disable-output-escaping="yes"/>
  134. </bus:conversation>
  135. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  136. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  137. </xsl:element>
  138. </SOAP-ENV:Body>
  139. </SOAP-ENV:Envelope>
  140. </xts:request>
  141. </response>
  142. </xts:replace>
  143. </xts:sequence>
  144. </xsl:template>
  145. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  146. <xsl:template match="*">
  147. <xsl:copy>
  148. <xsl:copy-of select="@*"/>
  149. <xsl:apply-templates/>
  150. </xsl:copy>
  151. </xsl:template>
  152. </xsl:stylesheet>
  153. </xts:block>
  154. <!--
  155. ===============================================================================================
  156. get the package root for the object
  157. ===============================================================================================
  158. -->
  159. <xts:block id="getPackage" mode="interpret" type="exec" processor="XSLT" mandatory="false" condition=".[not(/root/env/param[@name='promptResponse']) and not(/root/env/param[@name = 'doWait']) and /root/env/param[@name='model'] and /root/env/param[@name='model']!='' ]" nodelist="header, env">
  160. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  161. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  162. <xsl:template match="/">
  163. <xts:sequence>
  164. <xts:append select="/root">
  165. <routingServerGroup>
  166. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  167. <send:request provider="cm" requester="AGS:submit">
  168. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  169. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  170. <cm:requests>
  171. <cm:query>
  172. <cm:search>
  173. <xsl:value-of select="/root/env/param[@name='model']"/>
  174. </cm:search>
  175. <cm:properties>
  176. <cm:property name="parent"/>
  177. </cm:properties>
  178. </cm:query>
  179. </cm:requests>
  180. </cm:query>
  181. </xts:transform>
  182. </send:request>
  183. </xts:transform>
  184. </routingServerGroup>
  185. </xts:append>
  186. </xts:sequence>
  187. </xsl:template>
  188. </xsl:stylesheet>
  189. </xts:block>
  190. <!--
  191. ===============================================================================================
  192. determine the routing server group
  193. ===============================================================================================
  194. -->
  195. <xts:block id="routingServerGroup" mode="interpret" path="/ags/determineRouting.xslt" type="exec" processor="XSLT" dependency="getPackage" condition=".[/root/routingServerGroup//*[local-name()='parent']//*[local-name()='searchPath']]" mandatory="false" nodelist="header, env, routingServerGroup"/>
  196. <!--
  197. ===============================================================================================
  198. ge- issue the initial metadata runSpec request
  199. ===============================================================================================
  200. -->
  201. <xts:block id="getContent" mode="interpret" processor="XSLT" type="exec" dependency="routingServerGroup" condition=".[not (/root/routingServerGroup/authenticationFault) and not(/root/env/param[@name='promptResponse']) and not(/root/env/param[@name = 'doWait']) and not(/root/env/param[@name = 'doSkip'])]" mandatory="false">
  202. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  203. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  204. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  205. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  206. <xsl:template match="/">
  207. <!-- make some variables -->
  208. <xsl:variable name="method">
  209. <xsl:value-of select="key('env-param','method')"/>
  210. </xsl:variable>
  211. <xsl:variable name="inlineSpecType">
  212. <xsl:choose>
  213. <xsl:when test="key('env-param', 'inlineSpecType') and key('env-param', 'inlineSpecType') != '' ">
  214. <xsl:value-of select="key('env-param', 'inlineSpecType')"/>
  215. </xsl:when>
  216. <xsl:otherwise>
  217. <xsl:text>reportServiceReportSpecification</xsl:text>
  218. </xsl:otherwise>
  219. </xsl:choose>
  220. </xsl:variable>
  221. <xsl:variable name="inlineSpec">
  222. <xsl:choose>
  223. <xsl:when test="$inlineSpecType = 'queryFrameworkSpecification'">
  224. <xsl:value-of select="key('env-param','qfSpec')"/>
  225. </xsl:when>
  226. <xsl:otherwise>
  227. <xsl:value-of select="key('env-param','inlineSpec')"/>
  228. </xsl:otherwise>
  229. </xsl:choose>
  230. </xsl:variable>
  231. <xsl:variable name="obj">
  232. <xsl:value-of select="key('env-param','obj')"/>
  233. </xsl:variable>
  234. <xsl:variable name="affinity">
  235. <xsl:choose>
  236. <xsl:when test="$method='back'">high</xsl:when>
  237. <xsl:when test="$method='firstPage'">high</xsl:when>
  238. <xsl:when test="$method='forward'">high</xsl:when>
  239. <xsl:when test="$method='lastPage'">high</xsl:when>
  240. <xsl:when test="$method='nextPage'">high</xsl:when>
  241. <xsl:when test="$method='previousPage'">high</xsl:when>
  242. <xsl:when test="$method='render'">high</xsl:when>
  243. <xsl:when test="$method='cancel'">control</xsl:when>
  244. <xsl:when test="$method='getOutput'">absolute</xsl:when>
  245. <xsl:when test="$method='release'">absolute</xsl:when>
  246. <xsl:when test="$method='wait'">absolute</xsl:when>
  247. <xsl:when test="$method='runSpecification'">session</xsl:when>
  248. </xsl:choose>
  249. </xsl:variable>
  250. <!-- default is report server request - but we can fire to other places too -->
  251. <xsl:variable name="soapAction">
  252. <xsl:choose>
  253. <xsl:when test="key('env-param', 'soapAction') and key('env-param', 'soapAction') = 'AGENT_SERVICE_SOAPACTION' ">
  254. <xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201505/</xsl:text>
  255. </xsl:when>
  256. <xsl:otherwise>
  257. <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
  258. </xsl:otherwise>
  259. </xsl:choose>
  260. </xsl:variable>
  261. <xsl:variable name="requestNamespace">
  262. <xsl:choose>
  263. <xsl:when test="key('env-param', 'requestNamespace') and key('env-param', 'requestNamespace') != '' ">
  264. <xsl:value-of select="key('env-param', 'requestNamespace')"/>
  265. </xsl:when>
  266. <xsl:otherwise>
  267. <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
  268. </xsl:otherwise>
  269. </xsl:choose>
  270. </xsl:variable>
  271. <xsl:variable name="routingServerGroup">
  272. <xsl:choose>
  273. <xsl:when test="/root/routingServerGroup/*[local-name()='result'] != ''">
  274. <xsl:value-of select="/root/routingServerGroup/*[local-name()='result'][last()]"/>
  275. </xsl:when>
  276. <xsl:otherwise>
  277. <xsl:value-of select="key('env-param','routingServerGroup')"/>
  278. </xsl:otherwise>
  279. </xsl:choose>
  280. </xsl:variable>
  281. <xts:sequence>
  282. <xts:append>
  283. <affinity>
  284. <xsl:value-of select="$affinity"/>
  285. </affinity>
  286. </xts:append>
  287. </xts:sequence>
  288. <xts:sequence>
  289. <xts:append>
  290. <response>
  291. <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" option="xml-multipart" outputHeader="true" >
  292. <xsl:attribute name="soapAction">
  293. <xsl:value-of select="$soapAction"/>
  294. <xsl:if test="$affinity!=''">
  295. <xsl:text>.</xsl:text>
  296. <xsl:value-of select="$affinity"/>
  297. </xsl:if>
  298. </xsl:attribute>
  299. <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  300. <SOAP-ENV:Header>
  301. <bus:biBusHeader xsi:type="bus:biBusHeader">
  302. <xsl:choose>
  303. <xsl:when test="/root/env/param[@name='disp_trackingInfo'] and /root/env/param[@name='disp_trackingInfo']!='' ">
  304. <!-- copy the tracking information from previous request -->
  305. <bus:tracking>
  306. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='disp_trackingInfo'])), true())" disable-output-escaping="yes"/>
  307. </bus:tracking>
  308. <xsl:copy-of select="/root/header/bus:biBusHeader/*[name() != 'bus:tracking']"/>
  309. </xsl:when>
  310. <xsl:otherwise>
  311. <xsl:copy-of select="/root/header/bus:biBusHeader/*[name() != 'bus:routing']"/>
  312. </xsl:otherwise>
  313. </xsl:choose>
  314. <xsl:if test="$routingServerGroup != ''">
  315. <bus:routing>
  316. <routingServerGroup>
  317. <xsl:value-of select="$routingServerGroup"/>
  318. </routingServerGroup>
  319. </bus:routing>
  320. </xsl:if>
  321. </bus:biBusHeader>
  322. </SOAP-ENV:Header>
  323. <SOAP-ENV:Body>
  324. <xsl:choose>
  325. <!-- the run/runSpecification method -->
  326. <xsl:when test="$method = 'runSpecification' or $method = 'run' or $method = 'validateSpecification' or $method = 'validate' or $method = 'getParametersSpecification' or $method = 'getParameters' or $method='collectParameterValuesSpecification' or $method='collectParameterValues' ">
  327. <xsl:element name="{$method}" namespace="{$requestNamespace}">
  328. <xsl:choose>
  329. <xsl:when test="$method = 'runSpecification' or $method='validateSpecification' or $method='getParametersSpecification' or $method='collectParameterValuesSpecification' ">
  330. <!-- we need two vars to be passed in here - the inline spec contents and the type of the spec -->
  331. <bus:specification xsi:type="bus:{$inlineSpecType}">
  332. <xsl:choose>
  333. <xsl:when test="$inlineSpec != ''">
  334. <bus:value xsi:type="bus:specification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  335. <xsl:value-of select="$inlineSpec"/>
  336. </bus:value>
  337. </xsl:when>
  338. <xsl:otherwise>
  339. <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildRequestXTS']}" option="xml">
  340. <!-- env -->
  341. <!-- solution for package name has ampersand characters -->
  342. <xsl:if test="key('env-param', 'buildRequestXTS')= '/ags/async/spParamRequest.xts' or key('env-param', 'buildRequestXTS')= '/ags/async/spRequest.xts'">
  343. <xsl:variable name="sql">
  344. <xsl:value-of select="/root/env/param[@name='sql_package']"/>
  345. </xsl:variable>
  346. <xts:delete select="/root/env/param[@name='sql_package']"/>
  347. <xts:append select="/root/env">
  348. <param name="sql_package">
  349. <xts:transform name="XMLEncode">
  350. <xsl:value-of select="$sql"/>
  351. </xts:transform>
  352. </param>
  353. </xts:append>
  354. </xsl:if>
  355. <xsl:copy-of select="/root/env"/>
  356. <xsl:copy-of select="/root/header"/>
  357. <xsl:copy-of select="/root/credential"/>
  358. </xts:request>
  359. </xsl:otherwise>
  360. </xsl:choose>
  361. </bus:specification>
  362. </xsl:when>
  363. <xsl:otherwise>
  364. <objectPath xsi:type="bus:searchPathSingleObject">
  365. <xsl:value-of select="/root/env/param[@name='obj']"/>
  366. </objectPath>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. <xsl:choose>
  370. <xsl:when test="/root/env/param[@name='parameterValues'] != ''">
  371. <xsl:value-of select="string(/root/env/param[@name='parameterValues'])" disable-output-escaping="yes"/>
  372. </xsl:when>
  373. <xsl:when test="/root/env/param[@name='m_rp_parameters'] != ''">
  374. <xts:transform src="transforms/portal/parameters/pre-WARP-process.xslt" processor="XSLT">
  375. <xsl:value-of select="xtsext:web64decode( string(/root/env/param[@name='m_rp_parameters']), true())" disable-output-escaping="yes"/>
  376. </xts:transform>
  377. </xsl:when>
  378. <xsl:otherwise>
  379. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
  380. </xsl:otherwise>
  381. </xsl:choose>
  382. <!-- do the options -->
  383. <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
  384. <xsl:call-template name="Options"/>
  385. </bus:options>
  386. </xsl:element>
  387. </xsl:when>
  388. <!-- nextPage, previousPage, other "Page" operations, release, and cancel only send conversation param -->
  389. <xsl:when test="$method = 'release' or $method = 'cancel'">
  390. <xsl:element name="{$method}" namespace="{$requestNamespace}">
  391. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  392. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='conversation'])), true())" disable-output-escaping="yes"/>
  393. </bus:conversation>
  394. </xsl:element>
  395. </xsl:when>
  396. <!-- plug in the two agentService method -->
  397. <xsl:when test="$method = 'validateAgent'">
  398. <xsl:element name="{$method}" namespace="{$requestNamespace}">
  399. <!-- get the sub morphlet to build the information for validate and preview -->
  400. <xts:transform src="ags/transforms/getChildren.xslt" processor="XSLT">
  401. <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildRequestXTS']}" option="xml">
  402. <!-- env -->
  403. <xsl:copy-of select="/root/env"/>
  404. <xsl:copy-of select="/root/header"/>
  405. <xsl:copy-of select="/root/credential"/>
  406. </xts:request>
  407. </xts:transform>
  408. <!-- validate also has parameters and options -->
  409. <bus:parameterValues SOAP-ENC:arrayType="bus:parameterValue[]" xsi:type="SOAP-ENC:Array"/>
  410. <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
  411. <xsl:call-template name="Options"/>
  412. </bus:options>
  413. </xsl:element>
  414. </xsl:when>
  415. <xsl:when test="$method = 'previewAgent'">
  416. <xsl:element name="{$method}" namespace="{$requestNamespace}">
  417. <xts:transform src="ags/transforms/getChildren.xslt" processor="XSLT">
  418. <!-- get the sub morphlet to build the information for validate and preview -->
  419. <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildRequestXTS']}" option="xml">
  420. <!-- env -->
  421. <xsl:copy-of select="/root/env"/>
  422. <xsl:copy-of select="/root/header"/>
  423. <xsl:copy-of select="/root/credential"/>
  424. </xts:request>
  425. </xts:transform>
  426. </xsl:element>
  427. </xsl:when>
  428. <!-- all other methods (wait, getOutput, all the page operations) -->
  429. <xsl:otherwise>
  430. <xsl:element name="{$method}" namespace="{$requestNamespace}">
  431. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  432. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='conversation'])), true())" disable-output-escaping="yes"/>
  433. </bus:conversation>
  434. <!-- we're not using parameters for this query -->
  435. <bus:parameterValues SOAP-ENC:arrayType="bus:parameterValue[]" xsi:type="SOAP-ENC:Array"/>
  436. <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
  437. <xsl:call-template name="Options"/>
  438. </bus:options>
  439. </xsl:element>
  440. </xsl:otherwise>
  441. </xsl:choose>
  442. </SOAP-ENV:Body>
  443. </SOAP-ENV:Envelope>
  444. </xts:request>
  445. </response>
  446. </xts:append>
  447. </xts:sequence>
  448. </xsl:template>
  449. <!--
  450. We are using this template to create a copy of a XML node because
  451. for some reason, using xsl:copy caused an exception (java.lang.ArrayIndexOutOfBoundsException)
  452. -->
  453. <xsl:template match="*" mode="copy">
  454. <xsl:copy>
  455. <xsl:copy-of select="@*"/>
  456. <xsl:apply-templates mode="copy"/>
  457. </xsl:copy>
  458. </xsl:template>
  459. <xsl:template name="Options" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  460. <!-- save output -->
  461. <item xsi:type="bus:runOptionBoolean">
  462. <bus:name xsi:type="bus:runOptionEnum">saveOutput</bus:name>
  463. <bus:value xsi:type="xsd:boolean">false</bus:value>
  464. </item>
  465. <!-- prompt -->
  466. <xsl:if test="key('env-param', 'prompt')!=''">
  467. <item xsi:type="bus:runOptionBoolean">
  468. <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
  469. <bus:value xsi:type="xsd:boolean">
  470. <xsl:value-of select="key('env-param','prompt')"/>
  471. </bus:value>
  472. </item>
  473. </xsl:if>
  474. <!-- outputLocale -->
  475. <xsl:if test="key('env-param', 'outputLocale')!=''">
  476. <item xsi:type="bus:runOptionLanguageArray">
  477. <bus:name xsi:type="bus:runOptionEnum">outputLocale</bus:name>
  478. <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
  479. <item>
  480. <xsl:value-of select="key('env-param','outputLocale')"/>
  481. </item>
  482. </bus:value>
  483. </item>
  484. </xsl:if>
  485. <!-- Default is: outputEncapsulation=none, attachmentEncoding=MIME, and outputFormat=HTMLFragment -->
  486. <item xsi:type="bus:runOptionOutputEncapsulation">
  487. <bus:name xsi:type="bus:runOptionEnum">outputEncapsulation</bus:name>
  488. <bus:value xsi:type="bus:outputEncapsulationEnum">none</bus:value>
  489. </item>
  490. <!--layoutParameters for prompt reports-->
  491. <xsl:if test="/root/evts/configuration/property[@name='reportLayoutParameters']='true'">
  492. <item xsi:type="bus:runOptionBoolean">
  493. <bus:name xsi:type="bus:runOptionEnum">layoutParameters</bus:name>
  494. <bus:value xsi:type="xsd:boolean">true</bus:value>
  495. </item>
  496. </xsl:if>
  497. <!-- outputFormat -->
  498. <item xsi:type="bus:runOptionStringArray">
  499. <bus:name xsi:type="bus:runOptionEnum">outputFormat</bus:name>
  500. <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
  501. <item>XHTML</item>
  502. </bus:value>
  503. </item>
  504. <!-- version -->
  505. <xsl:if test="key('env-param', 'version')!=''">
  506. <item xsi:type="bus:runOptionDateTime">
  507. <bus:name xsi:type="bus:runOptionEnum">version</bus:name>
  508. <bus:value xsi:type="xsd:dateTime">
  509. <xsl:value-of select="key('env-param', 'version')"/>
  510. </bus:value>
  511. </item>
  512. </xsl:if>
  513. <!-- xslURL -->
  514. <xsl:if test="key('env-param', 'xslURL')!=''">
  515. <item xsi:type="bus:runOptionAnyURI">
  516. <bus:name xsi:type="bus:runOptionEnum">xslURL</bus:name>
  517. <bus:value xsi:type="xsd:string">
  518. <!--<xsl:text>null.xsl</xsl:text> -->
  519. <xsl:value-of select="key('env-param', 'xslURL')"/>
  520. </bus:value>
  521. </item>
  522. </xsl:if>
  523. <!-- credential parameters -->
  524. <xsl:if test="key('env-param', 'credentialParameters')!=''">
  525. <item xsi:type="bus:runOptionBoolean">
  526. <bus:name xsi:type="bus:runOptionEnum">credentialParameters</bus:name>
  527. <bus:value xsi:type="xsd:boolean">
  528. <xsl:value-of select="key('env-param', 'credentialParameters')"/>
  529. </bus:value>
  530. </item>
  531. </xsl:if>
  532. <!-- validate severity option -->
  533. <xsl:if test="key('env-param', 'severity')!=''">
  534. <item xsi:type="bus:validateOptionValidateSeverity">
  535. <bus:name xsi:type="bus:validateOptionEnum">severity</bus:name>
  536. <bus:value xsi:type="bus:validateSeverityEnum">
  537. <xsl:value-of select="key('env-param', 'severity')"/>
  538. </bus:value>
  539. </item>
  540. </xsl:if>
  541. <!-- validate member unique names -->
  542. <xsl:if test="key('env-param', 'checkMemberUniqueNames')!=''">
  543. <item xsi:type="bus:validateOptionBoolean">
  544. <bus:name xsi:type="bus:validateOptionEnum">checkMemberUniqueNames</bus:name>
  545. <bus:value xsi:type="xsd:boolean">
  546. <xsl:value-of select="key('env-param','checkMemberUniqueNames')"/>
  547. </bus:value>
  548. </item>
  549. </xsl:if>
  550. </xsl:template>
  551. </xsl:stylesheet>
  552. </xts:block>
  553. <!--
  554. ===============================================================================================
  555. appendPromptResponse - add the response from prompting into the tree as the response
  556. ===============================================================================================
  557. -->
  558. <xts:block id="appendPromptResponse" processor="XSLT" type="exec" dependency="getContent getOutput" mandatory="false" condition="/root/env/param[@name='promptResponse']" nodelist="env">
  559. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
  560. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  561. <xsl:template match="/root">
  562. <xsl:variable name="CRLF">
  563. <xsl:text>&#xA;</xsl:text>
  564. </xsl:variable>
  565. <xts:sequence>
  566. <xts:append>
  567. <response>
  568. <SOAP-ENV:Envelope>
  569. <SOAP-ENV:Header>
  570. <bus:biBusHeader xsi:type="bus:biBusHeader">
  571. <xsl:choose>
  572. <xsl:when test="/root/env/param[@name='disp_trackingInfo'] and /root/env/param[@name='disp_trackingInfo']!='' ">
  573. <!-- copy the tracking information from previous request -->
  574. <bus:tracking>
  575. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='disp_trackingInfo'])), true())" disable-output-escaping="yes"/>
  576. </bus:tracking>
  577. <xsl:copy-of select="/root/header/bus:biBusHeader/*[name() != 'bus:tracking']"/>
  578. </xsl:when>
  579. <xsl:otherwise>
  580. <xsl:copy-of select="/root/header/bus:biBusHeader/*"/>
  581. </xsl:otherwise>
  582. </xsl:choose>
  583. </bus:biBusHeader>
  584. </SOAP-ENV:Header>
  585. <SOAP-ENV:Body>
  586. <xsl:value-of select="xtsext:replace(/root/env/param[@name='promptResponse'], string($CRLF), string('&amp;#xA;'), false)" disable-output-escaping="yes"/>
  587. </SOAP-ENV:Body>
  588. </SOAP-ENV:Envelope>
  589. </response>
  590. </xts:append>
  591. </xts:sequence>
  592. </xsl:template>
  593. </xsl:stylesheet>
  594. </xts:block>
  595. <!--
  596. ===============================================================================================
  597. appendDocument - add the results of the requests into the right place
  598. ===============================================================================================
  599. -->
  600. <xts:block id="appendResponse" processor="XSLT" type="exec" dependency="appendPromptResponse" mandatory="false" nodelist="header,env,response,cookies" condition=".[(/root/env/param[@name = 'doSkip'] or /root/response/*/*/*/*/*[local-name() = 'status'] = 'complete' or /root/response/*/*/*/*/*[local-name() = 'status'] = 'conversationComplete') and not(/root/response/*/*/*/*/*[local-name() = 'details']/*/*[local-name()='status'] = 'prompting')]">
  601. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
  602. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  603. <xsl:template match="/root">
  604. <!-- need to concat the method name into the response - for secondary requests -->
  605. <xsl:variable name="method" select="/root/env/param[@name='method']"/>
  606. <!-- check we have a response -->
  607. <xsl:if test="/root/env/param[@name = 'doSkip'] or ./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'getOutputResponse' or local-name()='waitResponse' or local-name() = string(concat($method,'Response'))] or /root/env/param[@name='promptResponse'] ">
  608. <xts:sequence>
  609. <xts:append>
  610. <asyncResponse>
  611. <xsl:if test="/root/env/param[@name='buildResponseXTS'] and /root/env/param[@name='buildResponseXTS'] != '' ">
  612. <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildResponseXTS']}" option="xml">
  613. <!-- env -->
  614. <xsl:copy-of select="/root/env"/>
  615. <xsl:copy-of select="/root/header"/>
  616. <xsl:copy-of select="/root/cookies"/>
  617. <xsl:copy-of select="/root/credential"/>
  618. <!-- also have to copy out the SOAP-ENV from the reply -->
  619. <xsl:copy-of select="/root/response/SOAP-ENV:Envelope"/>
  620. </xts:request>
  621. </xsl:if>
  622. </asyncResponse>
  623. </xts:append>
  624. </xts:sequence>
  625. </xsl:if>
  626. </xsl:template>
  627. </xsl:stylesheet>
  628. </xts:block>
  629. <!--
  630. ===============================================================================================
  631. appendDocument - add the results of the requests into the right place
  632. ===============================================================================================
  633. -->
  634. <xts:block id="appendDocument" mode="output" mimeType="application/xml; charset=utf-8" processor="XSLT" type="exec" dependency="appendResponse" mandatory="false">
  635. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  636. <xts:logicsheet path="logicsheets/portal.xsl"/>
  637. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
  638. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  639. <pf:serialize-xml/>
  640. <pf:variables/>
  641. <xsl:template match="/root">
  642. <!-- need to concat the method name into the response - for secondary requests -->
  643. <xsl:variable name="method" select="/root/env/param[@name='method']"/>
  644. <xsl:variable name="trackingInfo">
  645. <xsl:call-template name="serialize-xml">
  646. <xsl:with-param name="node-set" select="./response/SOAP-ENV:Envelope/SOAP-ENV:Header/*[local-name()='biBusHeader']/*[local-name()='tracking']/*"/>
  647. </xsl:call-template>
  648. </xsl:variable>
  649. <xsl:variable name="conversation">
  650. <xsl:call-template name="serialize-xml">
  651. <xsl:with-param name="node-set" select="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/bus:result/bus:primaryRequest/*"/>
  652. </xsl:call-template>
  653. </xsl:variable>
  654. <xsl:variable name="routingServerGroup">
  655. <xsl:choose>
  656. <!-- get the routing server group from the model or object -->
  657. <xsl:when test="/root/routingServerGroup//*[local-name()='result']!=''">
  658. <xsl:value-of select="/root/routingServerGroup//*[local-name()='result'][last()]"/>
  659. </xsl:when>
  660. <!-- get the routing server group for a second pass through were we stored the result from the first invokation of asyncConv -->
  661. <xsl:when test="/root/env/param[@name='routingServerGroup'] and /root/env/param[@name='routingServerGroup'] != '' ">
  662. <xsl:value-of select="/root/env/param[@name='routingServerGroup']"/>
  663. </xsl:when>
  664. </xsl:choose>
  665. </xsl:variable>
  666. <xsl:choose>
  667. <xsl:when test="contains(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = string(concat($method,'Response'))]/*[local-name()='result']/*[local-name()='status'], 'working') or
  668. contains(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'waitResponse']/*[local-name()='result']/*[local-name()='status'], 'stillWorking')">
  669. <working>
  670. <context>
  671. <xsl:value-of select="/root/env/param[@name='context']"/>
  672. </context>
  673. <tracking>
  674. <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($trackingInfo), true()))"/>
  675. </tracking>
  676. <routingServerGroup>
  677. <xsl:value-of select="$routingServerGroup"/>
  678. </routingServerGroup>
  679. <conversation>
  680. <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))"/>
  681. </conversation>
  682. <originalSoapAction>
  683. <xsl:value-of select="/root/response/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:dispatcherTransportVars/item/bus:value"/>
  684. </originalSoapAction>
  685. </working>
  686. </xsl:when>
  687. <xsl:when test="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportStatus']/*[local-name()='status'] = 'prompting'">
  688. <prompting>
  689. <context>
  690. <xsl:value-of select="/root/env/param[@name='context']"/>
  691. </context>
  692. <tracking>
  693. <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($trackingInfo), true()))"/>
  694. </tracking>
  695. <conversation>
  696. <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))"/>
  697. </conversation>
  698. <routingServerGroup>
  699. <xsl:value-of select="$routingServerGroup"/>
  700. </routingServerGroup>
  701. <htmlFragment>
  702. <xsl:value-of select="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportOutput']/*[local-name()='outputPages']/item"/>
  703. </htmlFragment>
  704. </prompting>
  705. </xsl:when>
  706. <xsl:when test="not(/root/asyncResponse/soapFault) and ( /root/env/param[@name = 'doSkip'] or ./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'getOutputResponse' or local-name()='waitResponse' or local-name()= string(concat($method,'Response'))] or /root/env/param[@name='promptResponse'])">
  707. <!-- build the response -->
  708. <asyncResponse>
  709. <context>
  710. <xsl:value-of select="/root/env/param[@name='context']"/>
  711. </context>
  712. <tracking>
  713. <!-- send the tracking back if we haven't completed the converstaion - if we have the conversation is dead -->
  714. <xsl:if test="not(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='status'] = 'conversationComplete')">
  715. <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($trackingInfo), true()))"/>
  716. </xsl:if>
  717. </tracking>
  718. <conversation>
  719. <!-- send the conversation back if we haven't completed it - if we have the conversation is dead -->
  720. <xsl:if test="not(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='status'] = 'conversationComplete')">
  721. <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))"/>
  722. </xsl:if>
  723. </conversation>
  724. <routingServerGroup>
  725. <xsl:value-of select="$routingServerGroup"/>
  726. </routingServerGroup>
  727. <!-- copy the output from the response -->
  728. <xsl:value-of select="/root/asyncResponse/asyncReply" disable-output-escaping="yes"/>
  729. <!-- a copy of all the allowed secondary requests-->
  730. <secondaryRequests>
  731. <xsl:for-each select="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='secondaryRequests']/*[local-name()='item']">
  732. <secondaryRequest>
  733. <xsl:value-of select="./*[local-name()='name']"/>
  734. </secondaryRequest>
  735. </xsl:for-each>
  736. </secondaryRequests>
  737. </asyncResponse>
  738. </xsl:when>
  739. <xsl:when test="./response/*/*/*[local-name() = 'cancelResponse']">
  740. <cancelResponse>
  741. <xsl:copy-of select="/root/response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'cancelResponse']/*"/>
  742. </cancelResponse>
  743. </xsl:when>
  744. <xsl:when test="./routingServerGroup/authenticationFault/passport or ./response/authenticationFault/passport">
  745. <passport>
  746. <errorCode><xsl:value-of select="/root/response//SOAP-ENV:Envelope/SOAP-ENV:Body//*[local-name()='errorCode']"/></errorCode>
  747. <soapFault>
  748. <xsl:call-template name="entityEncode">
  749. <xsl:with-param name="strVal">
  750. <xsl:call-template name="serialize-xml">
  751. <xsl:with-param name="node-set" select="./*/authenticationFault/passport/soapFault"/>
  752. </xsl:call-template>
  753. </xsl:with-param>
  754. </xsl:call-template>
  755. </soapFault>
  756. </passport>
  757. </xsl:when>
  758. <xsl:when test="/root/asyncResponse/soapFault or ./response/soapFault or ./routingServerGroup/soapFault">
  759. <soapFault>
  760. <xsl:call-template name="entityEncode">
  761. <xsl:with-param name="strVal">
  762. <xsl:text/>FAULT<xsl:text/>
  763. </xsl:with-param>
  764. </xsl:call-template>
  765. <xsl:choose>
  766. <xsl:when test=".//fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']">
  767. <xsl:for-each select=".//fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']">
  768. <messageString>
  769. <xsl:attribute name="severity">
  770. <xsl:value-of select="ancestor::*[local-name()='exception']/*[local-name()='severity']"/>
  771. </xsl:attribute>
  772. <xsl:value-of select="./*[local-name()='messageString']"/>
  773. </messageString>
  774. </xsl:for-each>
  775. </xsl:when>
  776. <xsl:otherwise>
  777. <xsl:call-template name="entityEncode">
  778. <xsl:with-param name="strVal">
  779. <xsl:call-template name="serialize-xml">
  780. <xsl:with-param name="node-set" select="."/>
  781. </xsl:call-template>
  782. </xsl:with-param>
  783. </xsl:call-template>
  784. </xsl:otherwise>
  785. </xsl:choose>
  786. </soapFault>
  787. </xsl:when>
  788. </xsl:choose>
  789. </xsl:template>
  790. <!-- XML encoder - just put this into a node -->
  791. <xsl:template name="entityEncode">
  792. <xsl:param name="strVal"/>
  793. <a>
  794. <xsl:value-of select="$strVal"/>
  795. </a>
  796. </xsl:template>
  797. </xsl:stylesheet>
  798. </xts:block>
  799. </xts:morphlet>