soaplib.h

00001 
00002 //
00003 // Copyright (c) 2000-2003 Intel Corporation 
00004 // All rights reserved. 
00005 //
00006 // Redistribution and use in source and binary forms, with or without 
00007 // modification, are permitted provided that the following conditions are met: 
00008 //
00009 // * Redistributions of source code must retain the above copyright notice, 
00010 // this list of conditions and the following disclaimer. 
00011 // * Redistributions in binary form must reproduce the above copyright notice, 
00012 // this list of conditions and the following disclaimer in the documentation 
00013 // and/or other materials provided with the distribution. 
00014 // * Neither name of Intel Corporation nor the names of its contributors 
00015 // may be used to endorse or promote products derived from this software 
00016 // without specific prior written permission.
00017 // 
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
00021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR 
00022 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
00025 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
00026 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00027 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
00028 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00031 
00032 #ifndef SOAPLIB_H
00033 #define SOAPLIB_H 
00034 
00035 
00036 // SOAP module API to be called in Upnp-Dk API
00037 /****************************************************************************
00038 * Function :    soap_device_callback
00039 *
00040 * Parameters :
00041 *       IN http_parser_t *parser :      Parsed request received by the device
00042 *       IN http_message_t* request :    HTTP request 
00043 *       INOUT SOCKINFO *info :          socket info
00044 *
00045 * Description : This is a callback called by minisever after receiving 
00046 *       the request from the control point. This function will start 
00047 *       processing the request. It calls handle_invoke_action to handle the
00048 *       SOAP action
00049 *
00050 * Return : void
00051 *
00052 * Note :
00053 ****************************************************************************/
00054 void soap_device_callback(
00055         IN http_parser_t *parser, 
00056         IN http_message_t* request, 
00057         INOUT SOCKINFO *info );
00058 
00059 
00060 /****************************************************************************
00061 *       Function :      SoapSendAction
00062 *
00063 *       Parameters :
00064 *               IN char* action_url :   device contrl URL 
00065 *               IN char *service_type : device service type
00066 *               IN IXML_Document *action_node : SOAP action node        
00067 *               OUT IXML_Document **response_node :     SOAP response node
00068 *
00069 *       Description :   This function is called by UPnP API to send the SOAP 
00070 *               action request and waits till it gets the response from the device
00071 *               pass the response to the API layer
00072 *
00073 *       Return :        int
00074 *               returns UPNP_E_SUCCESS if successful else returns appropriate error
00075 *       Note :
00076 ****************************************************************************/
00077 int SoapSendAction( 
00078                 IN char* action_url, 
00079                 IN char *service_type,
00080                 IN IXML_Document *action_node,
00081                 OUT IXML_Document **response_node );
00082 
00083 /****************************************************************************
00084 *       Function :      SoapSendActionEx
00085 *
00086 *       Parameters :
00087 *               IN char* action_url :   device contrl URL 
00088 *               IN char *service_type : device service type
00089                 IN IXML_Document *Header: Soap header
00090 *               IN IXML_Document *action_node : SOAP action node ( SOAP body)   
00091 *               OUT IXML_Document **response_node :     SOAP response node
00092 *
00093 *       Description :   This function is called by UPnP API to send the SOAP 
00094 *               action request and waits till it gets the response from the device
00095 *               pass the response to the API layer. This action is similar to the 
00096 *               the SoapSendAction with only difference that it allows users to 
00097 *               pass the SOAP header along the SOAP body ( soap action request)
00098 *
00099 *       Return :        int
00100 *               returns UPNP_E_SUCCESS if successful else returns appropriate error
00101 *       Note :
00102 ****************************************************************************/
00103 int SoapSendActionEx(
00104                 IN char * ActionURL, 
00105                 IN char *ServiceType, 
00106                 IN IXML_Document *Header,
00107                 IN IXML_Document *ActNode , 
00108                 OUT IXML_Document **RespNode) ;
00109 
00110 /****************************************************************************
00111 *       Function :      SoapGetServiceVarStatus
00112 *
00113 *       Parameters :
00114 *                       IN  char * action_url : Address to send this variable 
00115 *                                                                       query message.
00116 *                       IN  char *var_name : Name of the variable.
00117 *                       OUT char **var_value :  Output value.
00118 *
00119 *       Description :   This function creates a status variable query message 
00120 *               send it to the specified URL. It also collect the response.
00121 *
00122 *       Return :        int
00123 *
00124 *       Note :
00125 ****************************************************************************/
00126 int SoapGetServiceVarStatus(
00127                                 IN char * ActionURL, 
00128                                 IN DOMString VarName, 
00129                                 OUT DOMString *StVar) ;   
00130 
00131 extern const char* ContentTypeHeader;
00132 
00133 #endif //SOAPLIB_H