C_mdsrvPingRequest.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /****************************************************************
  2. ** Licensed Materials - Property of IBM
  3. **
  4. ** IBM Cognos Products: mdsrv
  5. **
  6. ** (C) Copyright IBM Corp. 2008, 2010
  7. **
  8. ** US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *****************************************************************/
  10. /**
  11. * This class allows for the sending of an async ping request to the metadata service.
  12. *
  13. * @constructor
  14. * @requires G_BusServer
  15. * @extends C_BusRequest
  16. * @param {I_RequestListener} v_oListener The listener for this request. If null, then no events will be fired.
  17. * @param {String} v_sMetadataRequest The metadata request to send.
  18. */
  19. function C_mdsrvPingRequest( v_oListener )
  20. {
  21. var pingRequest =
  22. '<asyncRequest>' +
  23. '</asyncRequest>';
  24. var v_sBusRequest = '<md1:runSpecification>' +
  25. '<bus:specification xsi:type="bus:metadataServiceSpecification">' +
  26. '<bus:value xsi:type="bus:specification">' +
  27. String(pingRequest).F_XMLEncode() +
  28. '</bus:value>' +
  29. '</bus:specification>' +
  30. G_BusServer.F_GetParameterValues() +
  31. '<bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">' +
  32. '<item xsi:type="bus:asynchOptionInt">' +
  33. '<bus:name xsi:type="bus:asynchOptionEnum">primaryWaitThreshold</bus:name>' +
  34. '<bus:value xsi:type="xsd:int">' + C_mdsrvBusRequest.K_sPrimaryWaitThreshold + '</bus:value>' +
  35. '</item>' +
  36. '<item xsi:type="bus:asynchOptionInt">' +
  37. '<bus:name xsi:type="bus:asynchOptionEnum">secondaryWaitThreshold</bus:name>' +
  38. '<bus:value xsi:type="xsd:int">' + C_mdsrvBusRequest.K_sSecondaryWaitThreshold + '</bus:value>' +
  39. '</item>' +
  40. '<item xsi:type="bus:runOptionBoolean">' +
  41. '<bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>' +
  42. '<bus:value xsi:type="xsd:boolean">false</bus:value>' +
  43. '</item>' +
  44. '</bus:options>' +
  45. '</md1:runSpecification>';
  46. this.F_ConstructBaseClass( v_oListener, C_mdsrvBusRequest.K_sSOAPAction_metadataService, v_sBusRequest );
  47. this.F_SetAsyncBusRequest("md1:wait", "md1:cancel", "md1:getOutput");
  48. };
  49. C_mdsrvPingRequest.F_Extends( C_mdsrvBusRequest );
  50. /**
  51. * @private
  52. */
  53. C_mdsrvPingRequest.prototype.F_ProcessResponse = function()
  54. {
  55. // alert('in F_ProcessResponse' );
  56. C_mdsrvPingRequest.superClass.F_ProcessResponse.call( this );
  57. var v_docSoapResponse = this.F_GetResponse();
  58. //debugger;
  59. if ( !v_docSoapResponse )
  60. {
  61. var err = this.F_GetError();
  62. alert( err.F_GetErrorSummary() + err.F_GetErrorDetails() );
  63. return;
  64. }
  65. var data = v_docSoapResponse.selectNodes( "/SOAP-ENV:Envelope/SOAP-ENV:Body/*/result/details/item/data" );
  66. //debugger;
  67. if( data.length > 0 )
  68. {
  69. var encoded = new Base64();
  70. alert( encoded.decode64( data.item( 0 ).text ) );
  71. }
  72. // XXXXXXXXXX add body of processing here
  73. };