xmlsecurityengine/xmlsec/inc/xmlsec_soap.h
changeset 0 e35f40988205
child 24 74f0b3eb154c
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 /** 
       
     2  * XML Security Library (http://www.aleksey.com/xmlsec).
       
     3  *
       
     4  * Simple SOAP messages parsing/creation.
       
     5  *
       
     6  * This is free software; see Copyright file in the source
       
     7  * distribution for preciese wording.
       
     8  * 
       
     9  * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
       
    10  * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
       
    11  */
       
    12 #ifndef __XMLSEC_SOAP_H__
       
    13 #define __XMLSEC_SOAP_H__    
       
    14 #include "xmlsec_config.h"
       
    15 #ifndef XMLSEC_NO_SOAP
       
    16 
       
    17 #ifdef __cplusplus
       
    18 extern "C" {
       
    19 #endif /* __cplusplus */ 
       
    20 
       
    21 #include <libxml2_tree.h>
       
    22 #include "xmlsec_xmlsec.h"
       
    23 
       
    24 
       
    25 /***********************************************************************
       
    26  *
       
    27  * SOAP 1.1 
       
    28  *
       
    29  **********************************************************************/
       
    30 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11CreateEnvelope	(xmlDocPtr doc);
       
    31 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11EnsureHeader	(xmlNodePtr envNode);
       
    32 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11AddBodyEntry	(xmlNodePtr envNode,
       
    33 								 xmlNodePtr entryNode);
       
    34 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11AddFaultEntry	(xmlNodePtr envNode,
       
    35 								 const xmlChar* faultCodeHref,
       
    36 								 const xmlChar* faultCodeLocalPart,
       
    37 								 const xmlChar* faultString,
       
    38 								 const xmlChar* faultActor);
       
    39 XMLSEC_EXPORT int		xmlSecSoap11CheckEnvelope	(xmlNodePtr envNode);
       
    40 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11GetHeader		(xmlNodePtr envNode);
       
    41 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11GetBody		(xmlNodePtr envNode);
       
    42 XMLSEC_EXPORT xmlSecSize	xmlSecSoap11GetBodyEntriesNumber(xmlNodePtr envNode);
       
    43 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11GetBodyEntry	(xmlNodePtr envNode,
       
    44 								 xmlSecSize pos);
       
    45 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap11GetFaultEntry	(xmlNodePtr envNode);
       
    46 
       
    47 
       
    48 /***********************************************************************
       
    49  *
       
    50  * SOAP 1.2 
       
    51  *
       
    52  **********************************************************************/
       
    53 /**
       
    54  * xmlSecSoap12FaultCode:
       
    55  * @xmlSecSoap12FaultCodeUnknown:		The fault code is not available.
       
    56  * @xmlSecSoap12FaultCodeVersionMismatch:	The faulting node found an 
       
    57  *						invalid element information 
       
    58  *						item instead of the expected 
       
    59  *						Envelope element information item. 
       
    60  * @xmlSecSoap12FaultCodeMustUnderstand:	An immediate child element 
       
    61  *						information item of the SOAP 
       
    62  *						Header element information item 
       
    63  *						targeted at the faulting node 
       
    64  *						that was not understood by the 
       
    65  *						faulting node contained a SOAP 
       
    66  *						mustUnderstand attribute 
       
    67  *						information item with a value of "true"
       
    68  * @xmlSecSoap12FaultCodeDataEncodingUnknown:	A SOAP header block or SOAP 
       
    69  *						body child element information 
       
    70  *						item targeted at the faulting 
       
    71  *						SOAP node is scoped with a data 
       
    72  *						encoding that the faulting node 
       
    73  *						does not support.
       
    74  * @xmlSecSoap12FaultCodeSender:		The message was incorrectly 
       
    75  *						formed or did not contain the 
       
    76  *						appropriate information in order 
       
    77  *						to succeed. 
       
    78  * @xmlSecSoap12FaultCodeReceiver:		The message could not be processed 
       
    79  *						for reasons attributable to the 
       
    80  *						processing of the message rather 
       
    81  *						than to the contents of the 
       
    82  *						message itself. 
       
    83  * 
       
    84  * The values of the <Value> child element information item of the 
       
    85  * <Code> element information item (http://www.w3.org/TR/2003/REC-soap12-part1-20030624/#faultcodes).
       
    86  */
       
    87 typedef enum {
       
    88     xmlSecSoap12FaultCodeUnknown = 0,
       
    89     xmlSecSoap12FaultCodeVersionMismatch,
       
    90     xmlSecSoap12FaultCodeMustUnderstand,
       
    91     xmlSecSoap12FaultCodeDataEncodingUnknown,
       
    92     xmlSecSoap12FaultCodeSender,
       
    93     xmlSecSoap12FaultCodeReceiver
       
    94 } xmlSecSoap12FaultCode; 
       
    95 
       
    96 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12CreateEnvelope	(xmlDocPtr doc);
       
    97 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12EnsureHeader	(xmlNodePtr envNode);
       
    98 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12AddBodyEntry	(xmlNodePtr envNode,
       
    99 								 xmlNodePtr entryNode);
       
   100 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12AddFaultEntry	(xmlNodePtr envNode,
       
   101 								 xmlSecSoap12FaultCode faultCode,
       
   102 								 const xmlChar* faultReasonText,
       
   103 								 const xmlChar* faultReasonLang,
       
   104 								 const xmlChar* faultNodeURI,
       
   105 								 const xmlChar* faultRole);
       
   106 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12AddFaultSubcode	(xmlNodePtr faultNode,
       
   107 								 const xmlChar* subCodeHref,
       
   108 								 const xmlChar* subCodeName);								 
       
   109 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12AddFaultReasonText	(xmlNodePtr faultNode,
       
   110 								 const xmlChar* faultReasonText,
       
   111 								 const xmlChar* faultReasonLang);
       
   112 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12AddFaultDetailEntry	(xmlNodePtr faultNode,
       
   113 								 xmlNodePtr detailEntryNode);
       
   114 XMLSEC_EXPORT int		xmlSecSoap12CheckEnvelope	(xmlNodePtr envNode);
       
   115 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12GetHeader		(xmlNodePtr envNode);
       
   116 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12GetBody		(xmlNodePtr envNode);
       
   117 XMLSEC_EXPORT xmlSecSize	xmlSecSoap12GetBodyEntriesNumber(xmlNodePtr envNode);
       
   118 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12GetBodyEntry	(xmlNodePtr envNode,
       
   119 								 xmlSecSize pos);
       
   120 XMLSEC_EXPORT xmlNodePtr	xmlSecSoap12GetFaultEntry	(xmlNodePtr envNode);
       
   121 
       
   122 								 
       
   123 #endif /* XMLSEC_NO_SOAP */
       
   124 
       
   125 
       
   126 #ifdef __cplusplus
       
   127 }
       
   128 #endif /* __cplusplus */
       
   129 
       
   130 #endif /* __XMLSEC_SOAP_H__ */
       
   131