soaplib.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**************************************************************************
  2. *
  3. * Copyright (c) 2000-2003 Intel Corporation
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions are met:
  8. *
  9. * - Redistributions of source code must retain the above copyright notice,
  10. * this list of conditions and the following disclaimer.
  11. * - Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. * - Neither name of Intel Corporation nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
  22. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  23. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  24. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  25. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  26. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  27. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. **************************************************************************/
  31. #ifndef SOAPLIB_H
  32. #define SOAPLIB_H
  33. /*!
  34. * \file
  35. */
  36. /* SOAP module API to be called in Upnp-Dk API */
  37. /*!
  38. * \brief This is a callback called by minisever after receiving the request
  39. * from the control point. This function will start processing the request.
  40. * It calls handle_invoke_action to handle the SOAP action.
  41. */
  42. void soap_device_callback(
  43. /*! [in] Parsed request received by the device. */
  44. http_parser_t *parser,
  45. /*! [in] HTTP request. */
  46. http_message_t *request,
  47. /*! [in,out] Socket info. */
  48. SOCKINFO *info);
  49. /****************************************************************************
  50. * Function: SoapSendAction
  51. *
  52. * Parameters:
  53. * IN char* action_url: device contrl URL
  54. * IN char *service_type: device service type
  55. * IN IXML_Document *action_node: SOAP action node
  56. * OUT IXML_Document **response_node: SOAP response node
  57. *
  58. * Description: This function is called by UPnP API to send the SOAP
  59. * action request and waits till it gets the response from the device
  60. * pass the response to the API layer
  61. *
  62. * Return: int
  63. * returns UPNP_E_SUCCESS if successful else returns appropriate error
  64. * Note:
  65. ****************************************************************************/
  66. int SoapSendAction(
  67. IN char* action_url,
  68. IN char *service_type,
  69. IN IXML_Document *action_node,
  70. OUT IXML_Document **response_node);
  71. /****************************************************************************
  72. * Function: SoapSendActionEx
  73. *
  74. * Parameters:
  75. * IN char* action_url: device contrl URL
  76. * IN char *service_type: device service type
  77. * IN IXML_Document *Header: Soap header
  78. * IN IXML_Document *action_node: SOAP action node (SOAP body)
  79. * OUT IXML_Document **response_node: SOAP response node
  80. *
  81. * Description: This function is called by UPnP API to send the SOAP
  82. * action request and waits till it gets the response from the device
  83. * pass the response to the API layer. This action is similar to the
  84. * the SoapSendAction with only difference that it allows users to
  85. * pass the SOAP header along the SOAP body ( soap action request)
  86. *
  87. * Return: int
  88. * returns UPNP_E_SUCCESS if successful else returns appropriate error
  89. * Note:
  90. ****************************************************************************/
  91. int SoapSendActionEx(
  92. IN char * ActionURL,
  93. IN char *ServiceType,
  94. IN IXML_Document *Header,
  95. IN IXML_Document *ActNode,
  96. OUT IXML_Document **RespNode);
  97. /****************************************************************************
  98. * Function: SoapGetServiceVarStatus
  99. *
  100. * Parameters:
  101. * IN char * action_url: Address to send this variable query message.
  102. * IN char *var_name: Name of the variable.
  103. * OUT char **var_value: Output value.
  104. *
  105. * Description: This function creates a status variable query message
  106. * send it to the specified URL. It also collect the response.
  107. *
  108. * Return: int
  109. *
  110. * Note:
  111. ****************************************************************************/
  112. int SoapGetServiceVarStatus(
  113. IN char * ActionURL,
  114. IN DOMString VarName,
  115. OUT DOMString *StVar);
  116. extern const char* ContentTypeHeader;
  117. #endif /* SOAPLIB_H */