Genivia Home Documentation
SOAP_ENV__Header Struct Reference

updated Fri Aug 19 2022 by Robert van Engelen
 
SOAP_ENV__Header Struct Reference

SOAP Header structure. More...

Detailed Description

SOAP Header structure.

This structure is generated by the wsdl2h tool from a WSDL with SOAP Header definitions and/or by soapcpp2 to complete the SOAP Header definitions. The SOAP Header definitions can also be specified manually in the interface header file for soapcpp2. If no SOAP Header structure is declared in the interface header file input to soapcpp2 then the soapcpp2 tool will generate an empty structure.

A SOAP Header contains meta-data, such as WS-Addressing and WS-Security headers, associated with messages. SOAP Header elements may be marked with mustUnderstand which produces and recognizes SOAP_ENV:mustUnderstand="true" in XML to force the receiver to produce an error if the header element was not recognized.

The //gsoap <prefix> service method-input-header-part: and //gsoap <prefix> service method-output-header-part: directives indicates which member (i.e. XML element) of SOAP_ENV__Header is relevant to the input and output SOAP Headers associated with a service operation.

Because this structure is declared mutable (which is a C/C++ extension that only soapcpp2 understands), multiple SOAP_ENV__Header structures in the interface header file input are combined into one structure generated by soapcpp2 for C/C++ compilation.

Example:
// example .h file for soapcpp2
//gsoap ns service name: example
//gsoap ns service namespace: urn:example
mustUnderstand int *ns__someHeaderValue; // optional element with SOAP_ENV:mustUnderstand="true" attribute
};
//gsoap ns service method-input-header-part: webmethod ns__someHeaderValue
//gsoap ns service method-output-header-part: webmethod ns__someHeaderValue
int ns__webmethod(...);
#include "soapH.h"
struct soap *soap = soap_new();
... // context initializations
// add a SOAP Header to the message
soap->header = NULL; // make sure we allocate a new header
soap_header(soap); // allocate SOAP_ENV__Header and set soap->header to point to it
int num = 123;
soap->header->ns__someHeaderValue = &num;
if (soap_call_ns__webmethod(soap, endpoint, NULL, ...))
{
}
else
{
if (soap->header) // received a SOAP_ENV__Header?
... // yes, inspect SOAP_ENV__Header ns__someHeaderValue
}
See also
soap::header, soap::actor, soap_header.
soap_new
struct soap * soap_new()
Allocate and initialize a new soap context.
soap_free
void soap_free(struct soap *soap)
Finalize and free the given soap context from unmanaged heap memory.
soap_destroy
void soap_destroy(struct soap *soap)
Delete all dynamically-allocated C++ objects managed by the specified soap context.
soap::endpoint
char endpoint[SOAP_TAGLEN]
The endpoint string as received on the server side.
Definition: stdsoap2.h:4009
soap_end
void soap_end(struct soap *soap)
Delete all data from heap memory managed by the specified soap context and release the freed memory b...
soap
Context with the engine state.
Definition: stdsoap2.h:2795
soap_print_fault
void soap_print_fault(struct soap *soap, FILE *fd)
Print error message on the specified output.
soap_header
void soap_header(struct soap *soap)
If soap::header is NULL then allocate SOAP_ENV__Header header and set soap::header to point to it.
soap::header
struct SOAP_ENV__Header * header
The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or tha...
Definition: stdsoap2.h:2946
SOAP_ENV__Header
SOAP Header structure.
Definition: stdsoap2.h:9187