rpc_response_error.tpl 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * rpc_response_error.tpl
  4. *
  5. * Template for constructing a standard (SOAP-compliant)
  6. * response to an errant remote procedure call.
  7. *
  8. * The following variables are available in this template:
  9. *
  10. * string $rpc_action The RPC action being handled
  11. * int $error_code The numeric error code associated with the
  12. * current error condition
  13. * string $error_text Any error message associated with the
  14. * current error condition (optional; may not be
  15. * present)
  16. * string $guilty_party A string indicating the party who caused the
  17. * error: either "client" or "server" (optional;
  18. * may not be present)
  19. *
  20. * @copyright &copy; 1999-2008 The SquirrelMail Project Team
  21. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  22. * @version $Id$
  23. * @package squirrelmail
  24. * @subpackage templates
  25. */
  26. // retrieve the template vars
  27. //
  28. extract($t);
  29. echo '<?xml version="1.0" ?>'; ?>
  30. <soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sm="http://squirrelmail.org/rpc" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:soap-enc="http://www.w3.org/2003/05/soap-encoding" soap:encodingstyle="http://www.w3.org/2003/05/soap-encoding">
  31. <soap:header>
  32. <sm:result_code><?php echo $error_code; ?></sm:result_code>
  33. <sm:result_text><?php echo $error_text; ?></sm:result_text>
  34. </soap:header>
  35. <soap:body>
  36. <soap:fault>
  37. <faultcode>soap:<?php echo ucfirst(strtolower($guilty_party)); ?></faultcode>
  38. <faultstring><?php echo $error_text; ?></faultstring>
  39. <detail>
  40. <sm:result_code><?php echo $error_code; ?></sm:result_code>
  41. <sm:result_text><?php echo $error_text; ?></sm:result_text>
  42. </detail>
  43. </soap:fault>
  44. </soap:body>
  45. </soap:envelope>