wsrp_driver.xts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  5. (C) Copyright IBM Corp. 2005, 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!-- $Header: //cpscrn/main/templates/cps4/producer/wsrp_driver.xts#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="/cps4/producer/messages/cpsproducermsgs.xml">
  16. <!-- perform schema validations of the request -->
  17. <xts:block id="validate" type="exec" mode="interpret" processor="XML" condition=".[/root/system/param[@name = 'validate'] = 'true']" mandatory="false">
  18. <xts:sequence>
  19. <xts:discard>
  20. <xts:transform name="VALIDATE" faultBlock="fault_validate">
  21. <xts:param name="systemId"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='morphlet']"/>@request</xts:param>
  22. <xts:param name="schemaLocation">http://schemas.xmlsoap.org/soap/envelope/ /cps4/producer/schemas/soap_v11.xsd</xts:param>
  23. <xts:param name="schemaLocation">urn:oasis:names:tc:wsrp:v1:types /cps4/producer/schemas/wsrp_v1_types.xsd</xts:param>
  24. <xts:param name="schemaLocation">http://www.w3.org/XML/1998/namespace /cps4/producer/schemas/xml.xsd</xts:param>
  25. <xts:queryNode select="/root/envelope/*"/>
  26. </xts:transform>
  27. </xts:discard>
  28. </xts:sequence>
  29. </xts:block>
  30. <!-- read the actual implementation based on the path info, if it's valid -->
  31. <xts:block id="read_impl" nodelist="interfaces" dependency="validate" type="exec" mode="interpret" processor="XSLT">
  32. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  33. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  34. <xsl:template match="/">
  35. <xts:sequence>
  36. <xts:append>
  37. <xts:request protocol="FILEREAD" target="{ /root/interfaces/interfaceInfo/param[@name = 'extraInfo'] }/implementation.xml" faultBlock="fault_no_impl"/>
  38. </xts:append>
  39. </xts:sequence>
  40. </xsl:template>
  41. </xsl:stylesheet>
  42. </xts:block>
  43. <!-- read the basic framework implementation -->
  44. <xts:block id="read_framework" dependency="read_impl" type="exec" mode="input" processor="XML" path="/cps4/producer/implementation.xml"/>
  45. <!-- validate the parameters -->
  46. <xts:block id="validate_params" dependency="read_impl read_framework" type="exec" mode="interpret" processor="XSLT" mandatory="false">
  47. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xtsext xts">
  48. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  49. <xsl:template match="/">
  50. <xts:sequence>
  51. <xts:append>
  52. <xsl:variable name="decoded-navigationalState">
  53. <xsl:if test="/root/envelope/*[local-name()='Envelope']/*[local-name()='Body']/*[1]/*[local-name()='markupParams']/*[local-name()='navigationalState']">
  54. <xsl:value-of select="xtsext:base64decode(xtsext:validator('verify','navigationalState',string(/root/envelope/*[local-name()='Envelope']/*[local-name()='Body']/*[1]/*[local-name()='markupParams']/*[local-name()='navigationalState'])), true())" disable-output-escaping="yes"/>
  55. </xsl:if>
  56. </xsl:variable>
  57. <xsl:variable name="decoded-portletState">
  58. <xsl:if test="/root/envelope/*[local-name()='Envelope']/*[local-name()='Body']/*[1]/*[local-name()='portletContext']/*[local-name()='portletState']">
  59. <xsl:value-of select="xtsext:base64decode(/root/envelope/*[local-name()='Envelope']/*[local-name()='Body']/*[1]/*[local-name()='portletContext']/*[local-name()='portletState'], true())" disable-output-escaping="yes"/>
  60. </xsl:if>
  61. </xsl:variable>
  62. <decodedStates>
  63. <navigationalState><xsl:value-of select="$decoded-navigationalState"/></navigationalState>
  64. <portletState><xsl:value-of select="$decoded-portletState"/></portletState>
  65. </decodedStates>
  66. <xsl:variable name="namespace">
  67. <xsl:text>urn:cognos:portlets:validator:</xsl:text><xsl:value-of select="xtsext:substringAfterLast( string( /root/interfaces/interfaceInfo/param[@name='extraInfo'] ), '/' )"/>
  68. </xsl:variable>
  69. <xsl:variable name="op" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]"/>
  70. <xsl:variable name="op-name" select="local-name($op)"/>
  71. <xsl:variable name="back-url" select="/root/envelope/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='formFieldVars']/item[name='backURL']/value"/>
  72. <xsl:if test="$op-name = 'performBlockingInteraction' or not($decoded-portletState = '') or not($decoded-navigationalState = '') or ($back-url != '')">
  73. <xts:transform name="VALIDATOR" faultBlock="fault_validate_parms">
  74. <xts:param name="action">verify</xts:param>
  75. <xts:param name="namespace"><xsl:value-of select="$namespace"/></xts:param>
  76. <xts:param name="validatorLocation">
  77. <xsl:value-of select="$namespace"/><xsl:text> </xsl:text><xsl:value-of select="/root/interfaces/interfaceInfo/param[@name = 'extraInfo']"/><xsl:text>/validator.xml</xsl:text></xts:param>
  78. <xts:param name="validatorLocation">urn:cognos:portlets:validator <xsl:value-of select="xtsext:substringBeforeLast( string( /root/interfaces/interfaceInfo/param[@name='extraInfo'] ), '/' )"/><xsl:text>/validator.xml</xsl:text></xts:param>
  79. <validatorParams>
  80. <xsl:if test="($back-url != '')">
  81. <param name="backURL"><xsl:value-of select="$back-url"/></param>
  82. </xsl:if>
  83. <xts:queryNode select="/root/envelope/*[local-name()='Envelope']/*[local-name()='Body']/*[1]/*[local-name()='interactionParams']/*[local-name()='formParameters']"/>
  84. <xsl:value-of select="$decoded-portletState" disable-output-escaping="yes"/>
  85. <xsl:value-of select="$decoded-navigationalState" disable-output-escaping="yes"/>
  86. </validatorParams>
  87. </xts:transform>
  88. </xsl:if>
  89. </xts:append>
  90. </xts:sequence>
  91. </xsl:template>
  92. </xsl:stylesheet>
  93. </xts:block>
  94. <!-- execute the XTS implementation (either the target implementer or the framework -->
  95. <xts:block id="exec_impl" nodelist="envelope,implementation,framework,setCookies,cookies,interfaces,configProps,decodedStates" dependency="validate_params" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/error)]" mandatory="false">
  96. <xsl:stylesheet version="1.0"
  97. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  98. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  99. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  100. xmlns:cpsext="http://developer.cognos.com/schemas/cps/wsrp/extensions/1/"
  101. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  102. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  103. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  104. exclude-result-prefixes="xtsext xts">
  105. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  106. <xsl:variable name="op" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]"/>
  107. <xsl:variable name="command" select="local-name( $op )"/>
  108. <xsl:variable name="handle" select="substring-before( concat( $op/wsrp:portletContext/wsrp:portletHandle, ':' ), ':' )"/>
  109. <xsl:variable name="portlet" select="/root/implementation/portlet[@handle = $handle]"/>
  110. <xsl:variable name="method" select="$portlet/method[@name = $command] | /root/implementation/method[@name = $command] | /root/framework/method[@name = $command]"/>
  111. <xsl:variable name="decodeStates" select="not($method/@decodeStates) or $method/@decodeStates='true'"/>
  112. <xsl:variable name="decoded-registration">
  113. <xsl:if test="($decodeStates = 'true' or not($portlet/method[@name = 'register'] | /root/implementation/method[@name = 'register']) ) and $op/wsrp:registrationContext/wsrp:registrationState != ''">
  114. <xsl:value-of select="xtsext:base64decode(string($op/wsrp:registrationContext/wsrp:registrationState), true())"/>
  115. </xsl:if>
  116. </xsl:variable>
  117. <xsl:template match="/">
  118. <xts:sequence>
  119. <xsl:choose>
  120. <xsl:when test="$method">
  121. <xsl:variable name="requestType" select="$method/@requestType"/>
  122. <xts:append select="/root/output">
  123. <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  124. <xos:entityHeader>
  125. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  126. </xos:entityHeader>
  127. <xos:entityBody>
  128. <xsl:choose>
  129. <xsl:when test="not($requestType) or $requestType='XTS'">
  130. <xts:request name="XTS" faultBlock="fault_handler" target="{ $method[1] }" protocolHeader="true" protocolHeaderSelect="/root/output">
  131. <xsl:apply-templates select="/root/envelope" mode="patch-prefix"/>
  132. <system>
  133. <xsl:apply-templates select="/root/implementation/property-description | $portlet/property-description" mode="system"/>
  134. </system>
  135. <cookies>
  136. <xsl:apply-templates select="/root/setCookies/cookie | /root/cookies/cookie[not(@name = /root/setCookies/cookie/@name)]" mode="patch-prefix" />
  137. </cookies>
  138. <xsl:copy-of select="/root/setCookies"/>
  139. <xsl:copy-of select="/root/interfaces"/>
  140. <xsl:if test="name( $method[1]/.. ) = 'framework'">
  141. <xts:queryNode select="/root/implementation"/>
  142. </xsl:if>
  143. </xts:request>
  144. </xsl:when>
  145. <xsl:when test="$requestType='CPS-URL'">
  146. <xts:request name="XTS" faultBlock="fault_handler" target="/cps4/producer/wsrp-impl/cps-urlhandler.xts" protocolHeader="true" protocolHeaderSelect="/root/output">
  147. <xsl:apply-templates select="/root/envelope" mode="patch-prefix"/>
  148. <cookies>
  149. <xsl:apply-templates select="/root/setCookies/cookie | /root/cookies/cookie[not(@name = /root/setCookies/cookie/@name)]" mode="patch-prefix" />
  150. </cookies>
  151. <xsl:copy-of select="/root/setCookies"/>
  152. <xsl:if test="contains($method[1], 'internalDispatcher')">
  153. <internalRequest/>
  154. </xsl:if>
  155. <xsl:variable name="target">
  156. <xsl:call-template name="substituteConfigSettings">
  157. <xsl:with-param name="input" select="$method[1]"/>
  158. </xsl:call-template>
  159. </xsl:variable>
  160. <target>
  161. <xsl:value-of select="$target"/>
  162. </target>
  163. </xts:request>
  164. </xsl:when>
  165. <xsl:otherwise>
  166. <xts:request name="{ $requestType }" faultBlock="fault_handler" target="{ $method[1] }" >
  167. <xsl:if test="$method/@soapAction">
  168. <xsl:attribute name="soapAction"><xsl:value-of select="$method/@soapAction"/></xsl:attribute>
  169. <xsl:attribute name="responseEnvelope">true</xsl:attribute>
  170. </xsl:if>
  171. <xsl:apply-templates select="/root/envelope" mode="patch-prefix"/>
  172. </xts:request>
  173. </xsl:otherwise>
  174. </xsl:choose>
  175. </xos:entityBody>
  176. </xos:part>
  177. </xts:append>
  178. </xsl:when>
  179. <xsl:otherwise>
  180. <xts:append>
  181. <error>
  182. <noImpl/>
  183. </error>
  184. </xts:append>
  185. </xsl:otherwise>
  186. </xsl:choose>
  187. </xts:sequence>
  188. </xsl:template>
  189. <xsl:template name="substituteConfigSettings">
  190. <xsl:param name="input"/>
  191. <xsl:choose>
  192. <xsl:when test="$input and contains($input,'{')">
  193. <xsl:variable name="after" select="substring-after($input,'{')"/>
  194. <xsl:choose>
  195. <xsl:when test="$after and contains($input,'}')">
  196. <xsl:value-of select="substring-before($input,'{')"/>
  197. <xsl:variable name="config-prop" select="substring-before($after,'}')"/>
  198. <xsl:value-of select="/root/configProps/param[@name='cps']/property[@name=$config-prop]"/>
  199. <xsl:call-template name="substituteConfigSettings">
  200. <xsl:with-param name="input" select="substring-after($after,'}')"/>
  201. </xsl:call-template>
  202. </xsl:when>
  203. <xsl:otherwise>
  204. <xsl:value-of select="$input"/>
  205. </xsl:otherwise>
  206. </xsl:choose>
  207. </xsl:when>
  208. <xsl:otherwise>
  209. <xsl:value-of select="$input"/>
  210. </xsl:otherwise>
  211. </xsl:choose>
  212. </xsl:template>
  213. <xsl:template match="property-description" mode="system">
  214. <param type="{ substring-after( @type, ':' ) }">
  215. <xsl:copy-of select="@*[name() != 'type']"/>
  216. <xsl:value-of select="default"/>
  217. </param>
  218. </xsl:template>
  219. <!-- The patch-prefix mode adds or fixes the WSRP namespace's prefix to be "wsrp:" -->
  220. <!-- Moreover, XSLTC can't handle properly namespaces without prefixes -->
  221. <!-- Finally, we base64decode stuff at the same time -->
  222. <xsl:template match="*[namespace-uri()='urn:oasis:names:tc:wsrp:v1:types']" priority="1" mode="patch-prefix">
  223. <xsl:element name="wsrp:{local-name()}" namespace="urn:oasis:names:tc:wsrp:v1:types">
  224. <xsl:choose>
  225. <xsl:when test="(local-name()='portletState' or local-name()='registrationState' or local-name()='navigationalState') and (. != '') and $decodeStates">
  226. <xsl:variable name="state-extension" select="parent::wsrp:portletContext/wsrp:extensions/cpsext:state/cpsext:externalRef"/>
  227. <xsl:choose>
  228. <xsl:when test="local-name()='portletState' and $state-extension">
  229. <xts:transform name="XSLT" src="/cps4/producer/wsrp-impl/transforms/portlet-state.xslt">
  230. <root>
  231. <state>
  232. <xsl:value-of select="/root/decodedStates/portletState" disable-output-escaping="yes"/>
  233. </state>
  234. <update>
  235. <xsl:copy-of select="$state-extension"/>
  236. </update>
  237. </root>
  238. </xts:transform>
  239. </xsl:when>
  240. <xsl:when test="local-name()='portletState'">
  241. <xsl:value-of select="/root/decodedStates/portletState" disable-output-escaping="yes"/>
  242. </xsl:when>
  243. <xsl:when test="local-name()='navigationalState'">
  244. <xsl:value-of select="/root/decodedStates/navigationalState" disable-output-escaping="yes"/>
  245. </xsl:when>
  246. <xsl:otherwise>
  247. <xsl:value-of select="xtsext:base64decode(string(.), true())" disable-output-escaping="yes"/>
  248. </xsl:otherwise>
  249. </xsl:choose>
  250. </xsl:when>
  251. <xsl:otherwise>
  252. <xsl:apply-templates select="*|@*|text()" mode="patch-prefix"/>
  253. </xsl:otherwise>
  254. </xsl:choose>
  255. </xsl:element>
  256. </xsl:template>
  257. <xsl:template match="*|@*|text()" priority="-1" mode="patch-prefix">
  258. <xsl:copy>
  259. <xsl:apply-templates select="*|@*|text()" mode="patch-prefix"/>
  260. </xsl:copy>
  261. </xsl:template>
  262. </xsl:stylesheet>
  263. </xts:block>
  264. <!-- handle all implementation errors (not execution errors) -->
  265. <xts:block id="exec_fault" dependency="exec_impl" type="exec" mode="interpret" processor="XSLT" condition=".[/root/error]">
  266. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  267. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  268. <xsl:template match="/">
  269. <xts:sequence>
  270. <xsl:choose>
  271. <xsl:when test=".[/root/error/badParams]">
  272. <xts:append select="/root/output">
  273. <xts:transform processor="XML" cache="false" option="part">
  274. <xts:param name="messageBase"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='location']"/>/messages/cpsproducermsgs.xml</xts:param>
  275. <xts:param name="systemId"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='morphlet']"/>@exec_fault</xts:param>
  276. <xts:param name="mediaType">text/xml</xts:param>
  277. <xts:param name="encoding">utf-8</xts:param>
  278. <xts:param name="src">
  279. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  280. <SOAP-ENV:Body>
  281. <SOAP-ENV:Fault>
  282. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">wsrp:OperationFailed</faultcode>
  283. <faultstring><xts:string id="IDS_PRO_WSF_SECURITYREJECTION"/></faultstring>
  284. <detail>
  285. <wsrp:OperationFailed xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  286. </detail>
  287. </SOAP-ENV:Fault>
  288. </SOAP-ENV:Body>
  289. </SOAP-ENV:Envelope>
  290. </xts:param>
  291. </xts:transform>
  292. </xts:append>
  293. </xsl:when>
  294. <xsl:otherwise>
  295. <xts:append select="/root/output">
  296. <xts:transform processor="XML" cache="false" option="part">
  297. <xts:param name="messageBase"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='location']"/>/messages/cpsproducermsgs.xml</xts:param>
  298. <xts:param name="systemId"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='morphlet']"/>@exec_fault</xts:param>
  299. <xts:param name="mediaType">text/xml</xts:param>
  300. <xts:param name="encoding">utf-8</xts:param>
  301. <xts:param name="src">
  302. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  303. <SOAP-ENV:Body>
  304. <SOAP-ENV:Fault>
  305. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">wsrp:OperationFailed</faultcode>
  306. <faultstring><xts:string id="IDS_PRO_WSF_NOTIMPLEMENTEDFAULT"/></faultstring>
  307. <detail>
  308. <wsrp:OperationFailed xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  309. </detail>
  310. </SOAP-ENV:Fault>
  311. </SOAP-ENV:Body>
  312. </SOAP-ENV:Envelope>
  313. </xts:param>
  314. </xts:transform>
  315. </xts:append>
  316. </xsl:otherwise>
  317. </xsl:choose>
  318. </xts:sequence>
  319. </xsl:template>
  320. </xsl:stylesheet>
  321. </xts:block>
  322. <!-- indicate an invalid producer (wrong path-info) -->
  323. <xts:block id="fault_no_impl" type="fault" processor="XML">
  324. <error>
  325. <invalidProducer/>
  326. </error>
  327. </xts:block>
  328. <!-- catch request parameter validation errors -->
  329. <xts:block id="fault_validate_parms" type="fault" processor="XML">
  330. <error>
  331. <badParams/>
  332. </error>
  333. </xts:block>
  334. <!-- handle execution errors -->
  335. <xts:block id="fault_handler" type="fault" processor="XSLT">
  336. <xsl:stylesheet version="1.0"
  337. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  338. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  339. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  340. <xsl:template match="/">
  341. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  342. <SOAP-ENV:Body>
  343. <SOAP-ENV:Fault>
  344. <xsl:variable name="xts-fault" select="/root/fault/xts:exception[last()]"/>
  345. <xsl:choose>
  346. <xsl:when test="$xts-fault/xts:exceptionCode ='com.ibm.cognos.tds.TDSException' or contains($xts-fault/xts:exceptionDetail/bus:exception/bus:message/messageString,'CM-REQ-4159')">
  347. <!-- If we have a TDS error or CM-REQ-4159 , most likely it is an expired passport. We throw an invalidCookie fault to force an initCookie request -->
  348. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" wsrp:dummy="">wsrp:InvalidCookie</faultcode>
  349. <faultstring><xsl:value-of select="$xts-fault/xts:exceptionMsg"/></faultstring>
  350. <detail>
  351. <wsrp:InvalidCookie xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" />
  352. </detail>
  353. </xsl:when>
  354. <xsl:otherwise>
  355. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">wsrp:OperationFailed</faultcode>
  356. <faultstring><xts:string id="IDS_PRO_WSF_OPERATIONFAILEDFAULT"/></faultstring>
  357. <detail>
  358. <wsrp:OperationFailed xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  359. <xsl:copy-of select="/root/fault/*"/>
  360. </detail>
  361. </xsl:otherwise>
  362. </xsl:choose>
  363. </SOAP-ENV:Fault>
  364. </SOAP-ENV:Body>
  365. </SOAP-ENV:Envelope>
  366. </xsl:template>
  367. </xsl:stylesheet>
  368. </xts:block>
  369. <!-- catch request validation errors -->
  370. <xts:block id="fault_validate" type="fault" processor="XSLT">
  371. <xsl:stylesheet version="1.0"
  372. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  373. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  374. <xsl:template match="/">
  375. <xsl:variable name="exception" select="/root/fault/xts:exception[last()]"/>
  376. <fault>
  377. <xts:exception>
  378. <xts:exceptionCode>RequestValidationFailed</xts:exceptionCode>
  379. <xts:exceptionMsg>
  380. <xsl:value-of select="$exception/xts:exceptionMsg"/>
  381. </xts:exceptionMsg>
  382. <xts:exceptionStackTrace>
  383. <xsl:value-of select="$exception/xts:exceptionStackTrace"/>
  384. </xts:exceptionStackTrace>
  385. <xts:exceptionDetail>
  386. <xsl:copy-of select="/root/envelope/*"/>
  387. </xts:exceptionDetail>
  388. </xts:exception>
  389. </fault>
  390. </xsl:template>
  391. </xsl:stylesheet>
  392. </xts:block>
  393. </xts:morphlet>