![]() |
Home | Documentation |
soap.soap_serve Struct Reference
updated by Robert van Engelen
|
Context with the engine state. More...
Public Attributes | |
| soap_mode | imode |
| The soap context input soap_mode flags that are set at context initialization and set or cleared with soap_set_imode or soap_clr_imode, respectively. | |
| soap_mode | omode |
| The soap context output soap_mode flags that are set at context initialization and set or cleared with soap_set_omode or soap_clr_omode, respectively. | |
| SSL_CTX * | ctx |
| OpenSSL context pointer. | |
| short | version |
| SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2). | |
| const char * | encodingStyle |
| User-definable SOAP-ENV:encodingStyle URI value. | |
| const char * | actor |
| User-definable SOAP-ENV:actor (SOAP 1.1) or SOAP-ENV:role (SOAP 1.2) attribute value of all SOAP-ENV:mustUnderstand attributed header elements. | |
| const char * | lang |
| User-definable xml:lang attribute value of SOAP-ENV:Text to output the SOAP Fault string/reason (the value is en by default). | |
| int | max_keep_alive |
| User-definable maximum number of keep-alive message exchanges per connection (the value is #SOAP_MAXKEEPALIVE by default). | |
| int | keep_alive |
| HTTP keep-alive flag (try to enable when -1, disabled when 0) and counter (enabled when >0). | |
| const char * | c14ninclude |
| User-definable string to control the XML namespace prefixes that are subject to XML canonicalization with the #SOAP_XML_CANONICAL output mode flag, specified by space-separated prefixes in the string, or * to specify that all prefixes are inclusive, or NULL when unused. | |
| const char * | c14nexclude |
| User-definable string to control the XML namespace prefixes that are subject to XML canonicalization with #SOAP_XML_CANONICAL output mode flag, specified by space-separated prefixes in the string, or NULL when unused. | |
| int | status |
| The soap context HTTP status code received at the client side (100 to 599), HTTP header method received at the server side (#SOAP_POST, #SOAP_PATCH, #SOAP_GET, #SOAP_PUT, #SOAP_DEL, #SOAP_HEAD, #SOAP_OPTIONS), or the HTTP method to use for sending a message with soap_connect_command or with soap_response (#SOAP_POST, #SOAP_POST_FILE, #SOAP_PATCH, #SOAP_GET, #SOAP_PUT, #SOAP_PUT, #SOAP_DEL, #SOAP_CONNECT, #SOAP_HEAD, #SOAP_OPTIONS). | |
| int | error |
| The soap context soap_status (int) error code of the last operation or #SOAP_OK (zero). | |
| int | errnum |
| The errno value of the last failed IO operation. | |
| struct SOAP_ENV__Header * | header |
| The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or that can be populated by the user to be sent, or NULL when no SOAP Header is present. | |
| struct SOAP_ENV__Fault * | fault |
| The soap::fault points to a SOAP_ENV__Fault structure with the SOAP Fault that was received or that can be populated by the user to be sent, or NULL when no SOAP Fault is present. | |
| void * | user |
| User-definable variable that may point to user-specified data of any type to pass the data through to callbacks and plugins. | |
| short | mustUnderstand |
| The soap::mustUnderstand flag is set when a SOAP Header element carries a SOAP-ENV:mustUnderstand attribute that is true. | |
| short | null |
| The soap::null flag is set when an element carries a xsi:nil attribute that is true. | |
| short | body |
| The soap::body flag is set when an element has element content during XML parsing or when a HTTP message has a body when parsing an HTTP header. | |
| const char * | prolog |
| User-definable XML declaration prolog (<?xml version="1.0" encoding="UTF-8"?> by default). | |
| const char * | cookie_domain |
| User-definable string that specifies the HTTP cookie domain of the running server. | |
| const char * | cookie_path |
| User-definable string that specifies the HTTP cookie path of the running server. | |
| int | cookie_max |
| User-definable maximum number of active cookies allowed to be set with soap_set_cookie before cookie memory is reused (the value is 32 by default). | |
| struct soap_cookie * | cookies |
| The cookie store is a linked list of cookies. | |
| const char * | http_content |
| String with HTTP content type header value received, can also be assigned to specify a content type header for soap_connect_command with #SOAP_POST_FILE, #SOAP_PUT and #SOAP_PATCH or for soap_response with #SOAP_FILE or for soap_PUT, soap_PATCH, soap_POST. The soap::http_content string is reset to NULL after each HTTP invocation and has to be set again when required. | |
| const char * | http_extra_header |
| User-definable string that specifies an extra HTTP header or multiple HTTP headers when separated by CRLF in the specified string, to include in the next HTTP request (client side) or to include with the HTTP response (server side). The specified headre or headers are checked by the engine to conform to HTTP header formats or otherwise will be ignored and not output. | |
| SOAP_SOCKET | master |
| The socket set by ::soap_bind (or the C++ service class bind method) to serve as the master socket bound to a specified port, or #SOAP_INVALID_SOCKET when unassigned. | |
| SOAP_SOCKET | socket |
| The socket set by ::soap_accept (or the C++ service class accept method) or ::soap_connect or soap_connect_command (or the C++ proxy methods) when successful, or #SOAP_INVALID_SOCKET when unassigned. | |
| int | recvfd |
| The file descriptor to read data from when no socket communications are set (soap::socket == #SOAP_INVALID_SOCKET) and soap:is == NULL, default value is 0 (stdin). | |
| int | sendfd |
| The file descriptor to write data to when no socket communications are set (soap::socket == #SOAP_INVALID_SOCKET) and soap:os == NULL, default value is 1 (stdout). | |
| SOAP_SOURCE * | is |
| The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-terminated string to be read, default value is NULL. | |
| SOAP_SINK * | os |
| The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer to a char* string variable that will be set to point to a managed 0-terminated string with the data, default value is NULL. | |
| ULONG64 | recv_maxlength |
| User-definable maximum message length that is permitted to be received, zero means unlimited (the value is 2GB by default). | |
| int | transfer_timeout |
| User-definable timeout to send or receive an entire message, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default). | |
| int | recv_timeout |
| User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default). | |
| int | send_timeout |
| User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default). | |
| int | accept_timeout |
| User-definable timeout when waiting to accept a request from a client at the server-side with ::soap_accept (or the C++ service class accept method), positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default). | |
| int | connect_timeout |
| User-definable timeout when waiting to connect to a server at the client-side, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default). | |
| int | connect_retry |
| User-definable number of retries to attempt at the client side when connecting to a server fails with SOAP_TCP_ERROR, using exponential backoff delays between reconnects, maxed at 32 seconds: 1, 2, 4, 8, 16, 32, 32, 32, ... seconds for retry values 1 to 8 respectively (the retry value is 0 by default, meaning no retry). | |
| unsigned int | maxlevel |
| User-definable maximum XML and JSON nesting level permitted, initially set to #SOAP_MAXLEVEL (the value is 10000 by default). | |
| long | maxlength |
| User-definable maximum string length parsed from XML and JSON, initially set to #SOAP_MAXLENGTH, zero or negative means unlimited (0 by default). | |
| size_t | maxoccurs |
| User-definable maximum array and container size (maximum item occurrence constraint) as parsed from XML and JSON, except when specifie XML schema validation constraints permit greater sizes, initially set to #SOAP_MAXOCCURS (the value is 100000 by default). | |
| int | socket_flags |
| User-definable socket send and recv flags, for example assign MSG_NOSIGNAL to disable sigpipe (the value is 0 by default). | |
| int | connect_flags |
| User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value is 0 by default). | |
| int | bind_flags |
| User-definable setsockopt level SOL_SOCKET flags when binding soap::master socket (the value is 0 by default). | |
| short | bind_inet6 |
| User-definable flag, when nonzero uses AF_INET6 instead of PF_UNSPEC when binding the soap::master socket in ::soap_bind (or the C++ service class bind method), to remap IPv4 to IPv6 addresses, meaningful only when used with #WITH_IPV6. | |
| short | bind_v6only |
| User-definable flag, when nonzero enables IPPROTO_IPV6 setsockopt IPV6_V6ONLY when binding the soap::master socket with ::soap_bind (or the C++ service class bind method), meaningful only when used with #WITH_IPV6. | |
| int | accept_flags |
| User-definable setsockopt level SOL_SOCKET flags (0 by default), when nonzero sets the soap::socket flags when accepting a request with ::soap_accept (or the C++ service class accept method). | |
| unsigned short | linger_time |
| User-definable linger time value, requires the SO_LINGER setsockopt flag value to be assigned to soap::socket_flags. | |
| int | rcvbuf |
| User-definable value to set SO_RCVBUF setsockopt (the value is #SOAP_BUFLEN by default). | |
| int | sndbuf |
| User-definable value to set SO_SNDBUF setsockopt (the value is #SOAP_BUFLEN by default). | |
| int | tcp_keep_alive |
| User-definable value to set SO_KEEPALIVE setsockopt (0 by default unless the #SOAP_IO_KEEPALIVE mode flag is set). | |
| unsigned int | tcp_keep_idle |
| User-definable value to set TCP_KEEPIDLE setsockopt (the value is 0 by default). | |
| unsigned int | tcp_keep_intvl |
| User-definable value to set TCP_KEEPINTVL setsockopt (the value is 0 by default). | |
| unsigned int | tcp_keep_cnt |
| User-definable value to set TCP_KEEPCNT setsockopt (the value is 0 by default). | |
| unsigned int | ipv6_multicast_if |
| User-definable value to set sockaddr_in6::sin6_scope_id when nonzero. | |
| char * | ipv4_multicast_if |
| User-definable value to set setsockopt level IPPROTO_IP to IP_MULTICAST_IF when non-NULL. | |
| unsigned char | ipv4_multicast_ttl |
| User-definable value to set setsockopt level IPPROTO_IP to IP_MULTICAST_TTL when nonzero. | |
| const char * | client_addr |
| User-definable client address to bind to before connecting to a server, when non-NULL (Windows: n/a). | |
| const char * | client_addr_ipv6 |
| User-definable client address to bind to before connecting to a server, when non-NULL, requires #WITH_IPV6. | |
| int | client_port |
| User-definable client port to bind to before connecting to a server, when non-negative. | |
| const char * | client_interface |
| User-definable client interface address to override when connecting to a server, when non-NULL (Windows: n/a). | |
| unsigned short | z_level |
| User-definable compression level for gzip compression (0=none, 1=fast to 9=best) default level is 6. | |
| float | z_ratio_in |
| The compression ratio = compressed.size/uncompressed.size of the compressed message received. | |
| float | z_ratio_out |
| The compression ratio = compressed.size/uncompressed.size of the compressed message sent. | |
| const char * | bearer |
| User-definable HTTP authorization bearer token value to be sent by the client, server side receives this string when the client sends authorization bearer. | |
| const char * | userid |
| User-definable HTTP and NTLM authorization user id string for HTTP basic and NTLM authentication by the client, server side receives this string when the client uses HTTP basic authentication, for HTTP digest authentication see the gSOAP HTTP digest authentication plugin. | |
| const char * | passwd |
| User-definable HTTP and NTLM authorization password string required for HTTP basic and NTLM authentication by the client, server side receives this string when the client uses HTTP basic authentication. | |
| const char * | authrealm |
| The HTTP and NTLM authorization realm/domain string received by the client with the WWW-Authenticate or Proxy-Authenticate HTTP headers, user-definable on the server side to send a WWW-Authenticate header to require authentication (service operation should return 401 to respond with "Unauthorized"), also serves as NTLM domain value. | |
| const char * | ntlm_challenge |
| User-definable NTLM authentication challenge key string. | |
| const char * | proxy_host |
| User-definable proxy host name string which should be set to connect through an HTTP proxy. | |
| int | proxy_port |
| User-definable proxy port which should be set to connect through an HTTP proxy (the value is 8080 by default). | |
| const char * | proxy_userid |
| User-definable proxy authorization user id string to authenticate and connect to an HTTP proxy. | |
| const char * | proxy_passwd |
| User-definable proxy authorization password string to authenticate and connect to an HTTP proxy. | |
| const char * | proxy_from |
| The X-Forwarding-For HTTP header string value received. | |
| unsigned int | ip |
| The IPv4 address in numeric form of the client as received on the server side by ::soap_accept (or the C++ service class accept method), possibly set to zero when #WITH_IPV6 is used. | |
| unsigned int | ip6 [4] |
| The IPv6 address in numeric form (upper ip6[0] to lower ip6[3]) of the client as received on the server side by ::soap_accept (or the C++ service class accept method), requires #WITH_IPV6. | |
| int | port |
| The client port connected to as received on the server side by ::soap_accept (or the C++ service class accept method). | |
| char | endpoint [SOAP_TAGLEN] |
| The endpoint URL as received on the server side. | |
| char | host [SOAP_TAGLEN] |
| The host IP address of the client, as received on the server side. | |
| char | path [SOAP_TAGLEN] |
| The client request path as received on the server side. | |
| const char * | override_host |
| User-definable string to override the host name or IP address in the HTTP header when connecting at the client side. | |
| int | override_port |
| User-definable port number to override the port address in the HTTP header when connecting at the client side. | |
| const char * | origin |
| The CORS Origin HTTP header string value received. | |
| const char * | cors_origin |
| The CORS Access-Control-Allow-Origin HTTP header string value received or the user-definable value to be returned by the server when set. | |
| const char * | cors_allow |
| User-definable CORS Access-Control-Allow-Origin HTTP header string default value (the value is * by default). | |
| const char * | cors_method |
| The CORS Access-Control-Request-Method HTTP header string received. | |
| const char * | cors_header |
| The CORS Access-Control-Request-Headers HTTP header string received. | |
| const char * | cors_methods |
| User-definable CORS Access-Control-Request-Methods HTTP header string to be returned by the server. | |
| const char * | cors_headers |
| User-definable CORS Access-Control-Request-Headers HTTP header string to be returned by the server. | |
| const char * | float_format |
| User-definable floating point format string (%.9G by default, the printed format must not exceed 1023 bytes). | |
| const char * | double_format |
| User-definable double floating point format string (%.17lG by default, the printed format must not exceed 1023 bytes). | |
| const char * | dime_id_format |
| User-definable long double floating point format string (NULL by default and defined by the long_double.c custom serializer, the printed format must not exceed 1023 bytes). | |
| *DOM tree received struct soap_dom_element * | dom |
| *DIME attachments received struct soap_dime | dime |
| *MIME attachments received struct soap_mime | mime |
| *Internal index that keeps track of the current position in the ::soap::buf buffer after receiving data into the buffer size_t | bufidx |
| *Internal index that keeps track of the length of the data available in the ::soap::buf | buffer |
| *Internal index that keeps track of the length of the data available in the ::soap::buf does not exceed size_t | buflen |
| *Internal buffer with partial data received or partial data to be | sent |
| *Internal buffer with partial data received or partial data to be where the data occupies ::soap::buflen bytes char | buf [SOAP_BUFLEN] |
| *Internal buffer to hold short | messages |
| *Internal buffer to hold short URLs and HTTP MIME header | lines |
| *Internal buffer to hold short URLs and HTTP MIME header must have at least char | msgbuf [SOAP_TMPLEN] |
| *Internal buffer to hold temporary strings such as string representations of primitive | values |
| *Internal buffer to hold temporary strings such as string representations of primitive XML tag | names |
| *Internal buffer to hold temporary strings such as string representations of primitive XML tag HTTP header lines and so | on |
| *Internal buffer to hold temporary strings such as string representations of primitive XML tag HTTP header lines and so must have at least char | tmpbuf [SOAP_TMPLEN] |
| *Message length counter value of the message received and counter value of the HTTP content length header to send a message ULONG64 | count |
| *The HTTP content length header value received or when HTTP transfer encoding is chunked ULONG64 | length |
| *Callback that populates and then sends HTTP headers from the client side to a connected HTTP server int(*) | fpost (struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, ULONG64 count) |
| *Callback that populates and then sends HTTP headers from the server side to a connected client int(*) | fresponse (struct soap *soap, int status, ULONG64 count) |
| *Callback that sends a single HTTP header given a key value pair int(*) | fposthdr (struct soap *soap, const char *key, const char *val) |
| *Callback that reads and parses HTTP and MIME headers int(*) | fparse (struct soap *soap) |
| *Callback that consumes an HTTP header that consists of a key value pair int(*) | fparsehdr (struct soap *soap, const char *key, const char *val) |
| *Callback to implement logic at the server side to serve responses to HTTP GET requests from clients int(*) | fget (struct soap *soap) |
| *Callback to implement logic at the server side to serve responses to HTTP PUT requests from clients int(*) | fput (struct soap *soap) |
| *Callback to implement logic at the server side to serve responses to HTTP PATCH requests from clients int(*) | fpatch (struct soap *soap) |
| *Callback to implement logic at the server side to serve responses to HTTP DELETE requests from clients int(*) | fdel (struct soap *soap) |
| *Callback to implement logic at the server side to serve responses to HTTP OPTION requests from clients int(*) | fopt (struct soap *soap) |
| *Callback to implement logic at the server side to serve responses to HTTP HEAD requests from clients int(*) | fhead (struct soap *soap) |
| *Callback to implement logic at the server side to handle HTML | forms |
| *Callback to implement logic at the server side to handle HTML such as done by the callbacks provided by the HTTP FORM handler plugin int(*) | fform (struct soap *soap) |
| *Callback to inspect the SOAP Header received before the rest of the message with the SOAP Body is consumed int(*) | fheader (struct soap *soap) |
| *Callback to catch unrecognized XML encoding formats int(*) | fencoding (struct soap *soap, const char *encoding) |
| *Callback to catch unrecognized XML elements and overrides int(*) | fignore (struct soap *soap, const char *tag) |
| *Callback to validate strings against XML regex patterns int(*) | fsvalidate (struct soap *soap, const char *pattern, const char *string) |
| *Callback to validate wide strings against XML regex patterns int(*) | fwvalidate (struct soap *soap, const char *pattern, const wchar_t *string) |
| *Callback to inspect or override fault code or fault string messages void(*) | fseterror (struct soap *soap, const char **faultcode, const char **faultstring) |
| *Callback that opens a socket connection to a server endpoint SOAP_SOCKET(*) | fopen (struct soap *soap, const char *endpoint, const char *host, int port) |
| *Callback that waits for and accepts a socket connection requested by a client SOAP_SOCKET(*) | faccept (struct soap *soap, SOAP_SOCKET sock, struct sockaddr *addr, int *len) |
| *Callback that closes the current socket connection int(*) | fclose (struct soap *soap) |
| *Callback that resolves a host name by address translation int(*) | fresolve (struct soap *soap, const char *name, struct in_addr *inaddr) |
| *Callback that overrides the client side connecting operations int(*) | fconnect (struct soap *soap, const char *endpoint, const char *host, int port) |
| *Callback that executes disconnect logic before closing int(*) | fdisconnect (struct soap *soap) |
| *Callback that closes a given socket int(*) | fclosesocket (struct soap *soap, SOAP_SOCKET sock) |
| *Callback that shuts down a given socket int(*) | fshutdownsocket (struct soap *soap, SOAP_SOCKET sock, int how) |
| *Callback that blocks until activity is detected on the ::soap::socket or ::soap::master | socket |
| *Callback that blocks until activity is detected on the ::soap::socket or ::soap::master times out when ::soap::send_timeout or ::soap::recv_timeout are set int(*) | fpoll (struct soap *soap) |
| *Callback that receives bytes of data into the given buffer size_t(*) | frecv (struct soap *soap, char *buf, size_t len) |
| *Callback that sends the given bytes of data int(*) | fsend (struct soap *soap, const char *data, size_t len) |
| *Callback executed by the engine at the server side immediately after a server operation successfully completed int(*) | fserveloop (struct soap *soap) |
| *Callback to override dynamic memory allocation and management void *(*) | fmalloc (struct soap *soap, size_t size) |
| *Callback to open a streaming DIME attachment for reading void *(*) | fdimereadopen (struct soap *soap, void *handle, const char *id, const char *type, const char *options) |
| *Callback to read data in a DIME attachment stream size_t(*) | fdimeread (struct soap *soap, void *handle, char *buf, size_t len) |
| *Callback to close a DIME attachment stream after reading void(*) | fdimereadclose (struct soap *soap, void *handle) |
| *Callback to open a streaming DIME attachment for writing void *(*) | fdimewriteopen (struct soap *soap, const char *id, const char *type, const char *options) |
| *Callback to write data in a DIME attachment stream int(*) | fdimewrite (struct soap *soap, void *, const char *, size_t) |
| *Callback to close a DIME attachment stream after writing void(*) | fdimewriteclose (struct soap *soap, void *handle) |
| *Callback to open a streaming MIME MTOM attachment for reading void *(*) | fmimereadopen (struct soap *soap, void *, const char *, const char *, const char *) |
| *Callback to read data in a MIME MTOM attachment stream size_t(*) | fmimeread (struct soap *soap, void *handle, char *buf, size_t len) |
| *Callback to close a MIME MTOM attachment stream after reading void(*) | fmimereadclose (struct soap *soap, void *handle) |
| *Callback to open a streaming MIME MTOM attachment for writing void *(*) | fmimewriteopen (struct soap *soap, void *handle, const char *id, const char *type, const char *description, enum soap_mime_encoding encoding) |
| *Callback to write data in a MIME attachment stream int(*) | fmimewrite (struct soap *soap, void *handle, const char *buf, size_t len) |
| *Callback to close a MIME MTOM attachment stream after writing void(*) | fmimewriteclose (struct soap *soap, void *handle) |
| *Callback to initialize the OpenSSL library int(*) | fsslauth (struct soap *soap) |
| *Callback to manage the verification of the certificate provided by a X509_STORE_CTX * | store |
Context with the engine state.
The soap context should be passed as the first parameter to all gSOAP functions and should only be used by a single thread at a time. Each thread should use a copy of the context created with ::soap_copy or with the soap::soap copy constructor.
To allocate a new soap context, use one of these three allocators that take soap_mode parameters:
Alternatively, use constructors in C++ as follows:
To copy the soap context, for example to be used by another thread, use:
Alternatively, use the copy constructor in C++ as follows:
To free the soap context or a copy of a soap context, use:
To stack-allocate a soap context (i.e. as opposed to heap-allocating it as shown above), initialize the soap context with one of these three initializers that take soap_mode parameters:
Alternatively, use constructors in C++:
Finalization of the soap context is automatically done by the C++ destructor. In C, you should finalize a stack-allocated soap context before it is reclaimed by the stack:
Before freeing or finalizating a soap context, you may want to delete all data allocated in managed heap memory with these two calls in this specific order:
Alternatively, in C++ you can simply invoke one method to perform both calls at once:
User-definable setsockopt level SOL_SOCKET flags (0 by default), when nonzero sets the soap::socket flags when accepting a request with ::soap_accept (or the C++ service class accept method).
Other ways to disable sigpipe:
User-definable timeout when waiting to accept a request from a client at the server-side with ::soap_accept (or the C++ service class accept method), positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default).
| const char* soap::actor |
User-definable SOAP-ENV:actor (SOAP 1.1) or SOAP-ENV:role (SOAP 1.2) attribute value of all SOAP-ENV:mustUnderstand attributed header elements.
| const char* soap::authrealm |
The HTTP and NTLM authorization realm/domain string received by the client with the WWW-Authenticate or Proxy-Authenticate HTTP headers, user-definable on the server side to send a WWW-Authenticate header to require authentication (service operation should return 401 to respond with "Unauthorized"), also serves as NTLM domain value.
| const char* soap::bearer |
User-definable HTTP authorization bearer token value to be sent by the client, server side receives this string when the client sends authorization bearer.
| int soap::bind_flags |
User-definable setsockopt level SOL_SOCKET flags when binding soap::master socket (the value is 0 by default).
| short soap::bind_inet6 |
User-definable flag, when nonzero uses AF_INET6 instead of PF_UNSPEC when binding the soap::master socket in ::soap_bind (or the C++ service class bind method), to remap IPv4 to IPv6 addresses, meaningful only when used with #WITH_IPV6.
| short soap::bind_v6only |
User-definable flag, when nonzero enables IPPROTO_IPV6 setsockopt IPV6_V6ONLY when binding the soap::master socket with ::soap_bind (or the C++ service class bind method), meaningful only when used with #WITH_IPV6.
| short soap::body |
The soap::body flag is set when an element has element content during XML parsing or when a HTTP message has a body when parsing an HTTP header.
| * Internal buffer with partial data received or partial data to be where the data occupies ::soap::buflen bytes char soap::buf[SOAP_BUFLEN] |
| * Internal index that keeps track of the length of the data available in the ::soap::buf soap::buffer |
| * Internal index that keeps track of the current position in the ::soap::buf buffer after receiving data into the buffer size_t soap::bufidx |
| * Internal index that keeps track of the length of the data available in the ::soap::buf does not exceed size_t soap::buflen |
| const char* soap::c14nexclude |
User-definable string to control the XML namespace prefixes that are subject to XML canonicalization with #SOAP_XML_CANONICAL output mode flag, specified by space-separated prefixes in the string, or NULL when unused.
| const char* soap::c14ninclude |
User-definable string to control the XML namespace prefixes that are subject to XML canonicalization with the #SOAP_XML_CANONICAL output mode flag, specified by space-separated prefixes in the string, or * to specify that all prefixes are inclusive, or NULL when unused.
| const char* soap::client_addr |
User-definable client address to bind to before connecting to a server, when non-NULL (Windows: n/a).
When non-NULL, sets the client address specified as IPv4 or IPv6 or as a host address to bind to before connecting to a server. The value is reset to NULL after connecting successfully or unsuccessfully to the server.
| const char* soap::client_addr_ipv6 |
User-definable client address to bind to before connecting to a server, when non-NULL, requires #WITH_IPV6.
When non-NULL and soap::client_addr is non-NULL and when connecting to a IPv6 server, sets the client address specified as IPv6 or as a host address to bind to before connecting to the server. The value is reset to NULL after connecting successfully or unsuccessfully to the server.
| const char* soap::client_interface |
User-definable client interface address to override when connecting to a server, when non-NULL (Windows: n/a).
When non-NULL, sets the client address before connecting to a server. The value is reset to NULL after connecting successfully or unsuccessfully to the server. Does not bind the address, unlike soap::client_addr and soap::client_addr_ipv6.
User-definable client port to bind to before connecting to a server, when non-negative.
When non-negative, executes a bind with this port number before connecting to a server. The value is reset to -1 after connecting successfully or unsuccessfully to the server.
User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value is 0 by default).
User-definable number of retries to attempt at the client side when connecting to a server fails with SOAP_TCP_ERROR, using exponential backoff delays between reconnects, maxed at 32 seconds: 1, 2, 4, 8, 16, 32, 32, 32, ... seconds for retry values 1 to 8 respectively (the retry value is 0 by default, meaning no retry).
User-definable timeout when waiting to connect to a server at the client-side, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default).
| const char* soap::cookie_domain |
User-definable string that specifies the HTTP cookie domain of the running server.
| int soap::cookie_max |
User-definable maximum number of active cookies allowed to be set with soap_set_cookie before cookie memory is reused (the value is 32 by default).
| const char* soap::cookie_path |
User-definable string that specifies the HTTP cookie path of the running server.
| struct soap_cookie* soap::cookies |
The cookie store is a linked list of cookies.
| const char* soap::cors_allow |
User-definable CORS Access-Control-Allow-Origin HTTP header string default value (the value is * by default).
CORS is automatic at the server side. At the client side, CORS requires the HTTP OPTIONS method with CORS headers.
| const char* soap::cors_header |
The CORS Access-Control-Request-Headers HTTP header string received.
CORS is automatic at the server side. At the client side, CORS requires the HTTP OPTIONS method with CORS headers.
| const char* soap::cors_headers |
User-definable CORS Access-Control-Request-Headers HTTP header string to be returned by the server.
CORS is automatic at the server side. At the client side, CORS requires the HTTP OPTIONS method with CORS headers.
| const char* soap::cors_method |
The CORS Access-Control-Request-Method HTTP header string received.
CORS is automatic at the server side. At the client side, CORS requires the HTTP OPTIONS method with CORS headers.
| const char* soap::cors_methods |
User-definable CORS Access-Control-Request-Methods HTTP header string to be returned by the server.
CORS is automatic at the server side. At the client side, CORS requires the HTTP OPTIONS method with CORS headers.
| const char* soap::cors_origin |
The CORS Access-Control-Allow-Origin HTTP header string value received or the user-definable value to be returned by the server when set.
| * Message length counter value of the message received and counter value of the HTTP content length header to send a message ULONG64 soap::count |
| SSL_CTX* soap::ctx |
OpenSSL context pointer.
This pointer is non-NULL after calling soap_ssl_server_context or soap_ssl_client_context and points to the OpenSSL context which can be configured with OpenSSL API functions such as SSL_CTX_set_cipher_list.
| * DIME attachments received struct soap_dime soap::dime |
This structure contains a linked list of DIME attachments received.
| const char* soap::dime_id_format |
User-definable long double floating point format string (NULL by default and defined by the long_double.c custom serializer, the printed format must not exceed 1023 bytes).
| * DOM tree received struct soap_dom_element* soap::dom |
This pointer points to the DOM tree received when #SOAP_XML_DOM mode is enabled and the engine is configured with #WITH_DOM.
| const char* soap::double_format |
User-definable double floating point format string (%.17lG by default, the printed format must not exceed 1023 bytes).
| const char* soap::encodingStyle |
User-definable SOAP-ENV:encodingStyle URI value.
This URI string value is pre-defined by the engine depending on the SOAP protocol version used, setting this to NULL means no SOAP encodingStyle. Setting this to an empty string "" means that the engine will set the encodingStyle URI according to the SOAP version used. However, the encodingStyle is always set if the interface header file for soappcpp2 explicitly specifies an encoding or literal.
| char soap::endpoint[SOAP_TAGLEN] |
The endpoint URL as received on the server side.
On the server side, the URL endpoint string is extracted from the HTTP header by soap::fparse called by soap_begin_recv and consists of the concatenated string of soap::host, soap::port, and soap::path to form a valid URL.
| int soap::errnum |
The errno value of the last failed IO operation.
The soap::errnum value is set to the value or errno when a #SOAP_EOF or #SOAP_TCP_ERROR error occurred. This allows for reporting the error condition with soap_print_fault, soap_stream_fault, and soap_sprint_fault. For the #SOAP_EOF error, soap::errnum is set to zero when IO operations timed out, when a client's connection attempt to a server timed out, or when a server-side ::soap_accept timed out.
| int soap::error |
The soap context soap_status (int) error code of the last operation or #SOAP_OK (zero).
| *Callback that waits for and accepts a socket connection requested by a client SOAP_SOCKET(*) soap::faccept(struct soap *soap, SOAP_SOCKET sock, struct sockaddr *addr, int *len) |
This callback is called by ::soap_accept (or the C++ service class accept method) to wait for and accept a socket connection requested by a client. Returns a valid socket or #SOAP_INVALID_SOCKET when an error occurred and sets soap::error to a soap_status value. The built-in function assigned to soap::faccept is tcp_accept.
| soap | soap context |
| sock | master socket |
| addr | points to a sockaddr structure to be populated |
| len | points to the length of the sockaddr structure, the length may be reduced by the callback function with the actual size of the sockaddr structure populated |
| struct SOAP_ENV__Fault* soap::fault |
The soap::fault points to a SOAP_ENV__Fault structure with the SOAP Fault that was received or that can be populated by the user to be sent, or NULL when no SOAP Fault is present.
| *Callback that closes the current socket connection int(*) soap::fclose(struct soap *soap) |
This callback is called by the engine at the client-side to close the current socket connection before a new socket connection is established. This callback may be called multiple times (e.g. by the engine and by plugins) to close the same socket soap::socket. Checks internally if soap::socket == #SOAP_INVALID_SOCKET before closing, which means that the socket was already closed. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fclose is tcp_disconnect.
| soap | soap context |
| *Callback that closes a given socket int(*) soap::fclosesocket(struct soap *soap, SOAP_SOCKET sock) |
This callback is called to close a socket by the engine. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fclosesocket is tcp_closesocket.
| soap | soap context |
| sock | socket to close |
| *Callback that overrides the client side connecting operations int(*) soap::fconnect(struct soap *soap, const char *endpoint, const char *host, int port) |
This callback is called by the engine to optionally override client-side connecting. The parameters host and port were micro-parsed from the endpoint prior to passing them to this callback. Returns #SOAP_OK or a soap_status (int) error code. No built-in function is assigned to soap::fconnect.
| soap | soap context |
| endpoint | URL of the endpoint connected to (string) |
| host | URL host of the endpoint connected to (string) |
| port | URL port of the endpoint connected to (int) |
| *Callback to implement logic at the server side to serve responses to HTTP DELETE requests from clients int(*) soap::fdel(struct soap *soap) |
This callback is called by the service dispatcher when an HTTP DELETE request is pending. Redefine this callback to respond to HTTP DELETE requests, see the http_post HTTP POST plugin for more details. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fdel is the internal static function http_del that returns the #SOAP_DEL_METHOD error.
| soap | soap context |
| *Callback to read data in a DIME attachment stream size_t(*) soap::fdimeread(struct soap *soap, void *handle, char *buf, size_t len) |
This callback is called by the engine to read a chunk of attachment data to transmit. The handle parameter contains the handle returned by the soap::fdimereadopen callback. The buf parameter is the buffer of length len into which a chunk of data should be written by the callback. The actual amount of data written into the buffer may be less than len and this actual amount should be returned by the callback. A return value of zero indicates an error and soap::error should be set. The __size member variable of the attachment struct/class with data (e.g. xsd__base64Binary or _xop__Include with __ptr, __size, id, type and options members) should be set by the application prior to the serialization of the message with attachments. The value of __size indicates the total size of the attachment data to be transmitted. If the __size member variable is zero and HTTP chunking is enabled (with #SOAP_IO_CHUNK), then DIME chunked transfers are activated by the engine, which is more flexible since the attachment data size does not need to be determined in adance. To use DIME chunked transfers, enable HTTP chunking with #SOAP_IO_CHUNK (also #SOAP_IO_STORE can be used, but this buffers the entire message in memory before transmission) and set the __size member variable of the attachment struct/class to zero. When DIME attachment chunking is enabled, this callback should completely fill the buf buffer with len bytes unless the last data chunk is reached and fewer bytes are returned.
See the example provided with the documentation for soap::fdimereadopen. To enable chunked DIME attachments, replace the last part of the example with:
| soap | soap context |
| handle | the value of the handle returned by soap::fdimereadopen |
| buf | buffer to fill |
| len | length of the buffer in bytes |
| *Callback to close a DIME attachment stream after reading void(*) soap::fdimereadclose(struct soap *soap, void *handle) |
This callback is called by the engine to close the DIME attachment stream after reading. The handle parameter contains the handle returned by the soap::fdimereadopen callback.
See the examples provided with the documentation for soap::fdimereadopen and soap::fdimeread.
| soap | soap context |
| handle | the value of the of the handle returned by soap::fdimereadopen |
| *Callback to open a streaming DIME attachment for reading void *(*) soap::fdimereadopen(struct soap *soap, void *handle, const char *id, const char *type, const char *options) |
This callback is called by the engine to start sending a streaming DIME attachment. This callback opens a stream to start reading the attachment data to send. The actual data stream will be read in chunks using the soap::fdimeread callback until no more data is available and the soap::fdimereadclose callback is called to close the stream. The handle parameter contains the value of the __ptr member variable of the attachment struct/class with data (e.g. xsd__base64Binary or _xop__Include with __ptr, __size, id, type and options members), which should be a pointer to specific information such as a file descriptor or a pointer to a some application-specific data to be passed to this callback. Both the __ptr and __size members of the attachment struct/class should have been set by the application prior to the serialization of the message with attachments. If the __size is zero and HTTP chunking is enabled (with #SOAP_IO_CHUNK), then chunked DIME attachments are sent, see soap::fdimeread. The id, type and options parameters are the id (optional ID), type (a MIME type) and options (DIME options are set with soap_dime_option) of the attachment struct/class, respectively, of which at least one member should be non-NULL. The callback should return the handle parameter value or another pointer value, which is passed as the new handle parameter to soap::fdimeread and soap::fdimereadclose callbacks. When an error occurred in this callback, the callback should return NULL and set soap::error to an error code, e.g. using soap_receiver_fault. The callback may return NULL and set soap::error to #SOAP_OK when this specific DIME attachment should not to be streamed and the engine will simply skip it.
This mechanism also works for DIME attachments attached with soap_set_dime_attachment.
The maximum size of DIME attachments that the engine allows to be received is limited to #SOAP_MAXDIMESIZE. Increase this size as necessary.
| soap | soap context |
| handle | the value of the __ptr member variable of the attachment struct/class with data |
| id | the value of the id member variable of the attachment struct/class with data |
| type | the value of the type member variable of the attachment struct/class with data |
| options | the value of the options member variable of the attachment struct/class with data |
| *Callback to write data in a DIME attachment stream int(*) soap::fdimewrite(struct soap *soap, void *, const char *, size_t) |
This callback is called by the engine to write a chunk of attachment data received. The handle parameter contains the handle returned by the soap::fdimewriteopen callback. The buf parameter contains the data of length len. Returns #SOAP_OK or a soap_status (int) error code.
| soap | soap context |
| handle | the value of the handle returned by soap::fdimewriteopen |
| *Callback to close a DIME attachment stream after writing void(*) soap::fdimewriteclose(struct soap *soap, void *handle) |
This callback is called by the engine to close the DIME attachment stream after writing. The handle parameter contains the handle returned by the soap::fdimewriteopen callback.
| soap | soap context |
| handle | the value of the of the handle returned by soap::fdimewriteopen |
| *Callback to open a streaming DIME attachment for writing void *(*) soap::fdimewriteopen(struct soap *soap, const char *id, const char *type, const char *options) |
Called by the to start receiving a streaming DIME attachment. This callback opens a stream to start writing the attachment data received. The actual data stream will be written in chunks using the soap::fdimewrite callback until no more data is available and the soap::fdimewriteclose callback is called to close the stream. The id, type and options parameters are the id, type and options of the attachment struct/class (e.g. xsd__base64Binary or _xop__Include with __ptr, __size, id, type and options members), respectively. The callback should return a handle, which is passed to the soap::fdimewrite and soap::fdimewriteclose callbacks. The __ptr member variable of the attachment struct/class is set by the engine to the value of this handle. The __size member variable is set to the size of the attachment received. The maximum DIME attachment size received is limited by #SOAP_MAXDIMESIZE.
The maximum size of DIME attachments that the engine allows to be received is limited to #SOAP_MAXDIMESIZE. Increase this size as necessary.
| soap | soap context |
| id | the value of the id member variable of the attachment struct/class with data |
| type | the value of the type member variable of the attachment struct/class with data |
| options | the value of the options member variable of the attachment struct/class with data |
| *Callback that executes disconnect logic before closing int(*) soap::fdisconnect(struct soap *soap) |
This callback is called by the engine ::soap_closesock before the soap::fclose callback is called to shutdown/disconnect. Returns #SOAP_OK or a soap_status (int) error code. No built-in function is assigned to soap::fdisconnect.
| soap | soap context |
| *Callback to catch unrecognized XML encoding formats int(*) soap::fencoding(struct soap *soap, const char *encoding) |
This callback is called when an unrecognized XML encoding format is encountered in an XML PI. Supported encoding formats are latin (ASCII) and UTF-8. Other encoding formats can be rejected or supported by setting this callback. To reject the encoding, return a nonzero error code. To accept the encoding without further action, return #SOAP_OK. To decode the encoding, the input stream should be redictected through a decoder, for example by overriding the soap::frecv callback with a specific handler to convert the encoding.
| soap | soap context |
| encoding | XML encoding extracted from the XML PI header |
| *Callback to implement logic at the server side to handle HTML such as done by the callbacks provided by the HTTP FORM handler plugin int(*) soap::fform(struct soap *soap) |
This callback is called by the HTTP FORM handler plugin to parse HTML forms received with HTTP POST and PUT requests, see the ;:http_form HTTP FORM plugin for more details. The HTTP body with the form data should be parsed by this callback, otherwise HTTP keep-alive messages will end up out of sync as a result of the current position not being advanced to the end of the HTTP body. Returns #SOAP_OK or a soap_status (int) error code. No built-in function is assigned to soap::fform.
| soap | soap context |
| *Callback to implement logic at the server side to serve responses to HTTP GET requests from clients int(*) soap::fget(struct soap *soap) |
This callback is called by the service dispatcher when an HTTP GET request is pending. Redefine this callback to respond to HTTP GET requests with content, see the http_get HTTP GET plugin for more details. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fget is the internal static function http_get that returns the #SOAP_GET_METHOD error.
| soap | soap context |
| *Callback to implement logic at the server side to serve responses to HTTP HEAD requests from clients int(*) soap::fhead(struct soap *soap) |
This callback is called by the service dispatcher when an HTTP HEAD request is pending. Redefine this callback to respond to HTTP HEAD requests more specifically. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fhead is the internal static function http_200 that returns HTTP 200 OK.
| soap | soap context |
| *Callback to inspect the SOAP Header received before the rest of the message with the SOAP Body is consumed int(*) soap::fheader(struct soap *soap) |
This callback is called immediately after parsing a SOAP Header into the soap::header structure. The SOAP Header structure soap::header can be inspected by this function and verified or rejected before the rest of the message with the SOAP Body is consumed. Returns #SOAP_OK or a soap_status (int) error code. No built-in function is assigned to soap::fheader.
| soap | soap context |
| *Callback to catch unrecognized XML elements and overrides int(*) soap::fignore(struct soap *soap, const char *tag) |
This callback is called when an unrecognized XML element was encountered on the input that could be ignored depending on some specified logic. The tag parameter is the offending XML element tag name string. The callback should return #SOAP_OK to ignore the element or return an soap_status error code such as #SOAP_TAG_MISMATCH to trigger a validation error. This callback also overrides mustUnderstand attributes on unrecognized SOAP Header elements that normally raise faults. It is strongly recommended that the callback returns #SOAP_MUSTUNDERSTAND when soap::mustUnderstand != 0. Returns #SOAP_OK or a soap_status (int) error code. No built-in function is assigned to soap::fignore.
| soap | soap context |
| tag | XML tag name |
| const char* soap::float_format |
User-definable floating point format string (%.9G by default, the printed format must not exceed 1023 bytes).
| *Callback to override dynamic memory allocation and management void *(*) soap::fmalloc(struct soap *soap, size_t size) |
This callback can be used to override memory allocation and management done by soap_malloc in C. Memory allocated via this callback will not be managed and not be automatically released by the engine. Instead, the application using this callback should release allocated memory. All allocations done by soap_malloc are replaced with a call to soap::fmalloc. However, no other allocations, such as ::soap_new and soap_new_T for C++ classes, are affected. This callback is therefore not useful for C++ applications. Returns a pointer to dynamically allocated memory or NULL on failure to allocate. No built-in function is assigned to soap::fmalloc.
| soap | soap context |
| size | number of bytes to allocate |
| *Callback to read data in a MIME MTOM attachment stream size_t(*) soap::fmimeread(struct soap *soap, void *handle, char *buf, size_t len) |
This callback is called by the engine to read a chunk of attachment data to transmit. The handle parameter contains the handle returned by the soap::fmimereadopen callback. The buf parameter is the buffer of length len into which a chunk of data should be written by the callback. The actual amount of data written into the buffer may be less than len and this actual amount should be returned by the callback. A return value of zero indicates an error and soap::error should be set. The __size member variable of the attachment struct/class with data (e.g. xsd__base64Binary or _xop__Include with __ptr, __size, id, type and options members) should be set by the application prior to the serialization of the message with attachments. The value of __size indicates the total size of the attachment data to be transmitted. If the __size member variable is zero and HTTP chunking is enabled (with #SOAP_IO_CHUNK), then MIME/MTOM chunked transfers are activated by the engine, which is more flexible since the attachment data size does not need to be determined in advance. To use MIME/MTOM chunked transfers, enable HTTP chunking with #SOAP_IO_CHUNK (also #SOAP_IO_STORE can be used, but this buffers the entire message in memory before transmission) and set the __size member variable of the attachment struct/class to zero. When MIME/MTOM attachment chunking is enabled, this callback should completely fill the buf buffer with len bytes unless the last data chunk is reached and fewer bytes are returned.
See the example provided with the documentation for soap::fmimereadopen.
| soap | soap context |
| handle | the value of the handle returned by soap::fmimereadopen |
| buf | buffer to fill |
| len | length of the buffer in bytes |
| *Callback to close a MIME MTOM attachment stream after reading void(*) soap::fmimereadclose(struct soap *soap, void *handle) |
This callback is called by the engine to close the MIME/MTOM attachment stream after reading. The handle parameter contains the handle returned by the soap::fmimereadopen callback.
See the example provided with the documentation for soap::fmimereadopen.
| soap | soap context |
| handle | the value of the of the handle returned by soap::fmimereadopen |
| *Callback to open a streaming MIME MTOM attachment for reading void *(*) soap::fmimereadopen(struct soap *soap, void *, const char *, const char *, const char *) |
This callback is called by the engine to start sending a streaming MIME/MTOM attachment. This callback opens a stream to start reading the attachment data to send. The actual data stream will be read in chunks using the soap::fmimeread callback until no more data is available and the soap::fmimereadclose callback is called to close the stream. The handle parameter contains the value of the __ptr member variable of the attachment struct/class with data (e.g. xsd__base64Binary or _xop__Include with __ptr, __size, id, type and options members), which should be a pointer to specific information such as a file descriptor or a pointer to a some application-specific data to be passed to this callback. Both the __ptr and __size members of the attachment struct/class should have been set by the application prior to the serialization of the message with attachments. If the __size is zero and HTTP chunking is enabled (with #SOAP_IO_CHUNK), then chunked MIME/MTOM attachments are sent, see soap::fmimeread. The id, type and options parameters are the id (an optional ID), type (a MIME type) and options (a descriptive string) of the attachment struct/class, respectively, of which at least one member should be non-NULL. The callback should return the handle parameter value or another pointer value, which is passed as the new handle parameter to soap::fmimeread and soap::fmimereadclose callbacks. When an error occurred in this callback, the callback should return NULL and set soap::error to an error code, e.g. using soap_receiver_fault. The callback may return NULL and set soap::error to #SOAP_OK when this specific MIME/MTOM attachment should not to be streamed and the engine will simply skip it.
To enable chunked MIME/MTOM attachments, replace the last part of the example with:
This mechanism also works for MIME/MTOM attachments that are explicitly attached with soap_set_mime_attachment.
| soap | soap context |
| handle | the value of the __ptr member variable of the attachment struct/class with data |
| id | the value of the id member variable of the attachment struct/class with data |
| type | the value of the type member variable of the attachment struct/class with data |
| options | the value of the options member variable of the attachment struct/class with data |
| *Callback to write data in a MIME attachment stream int(*) soap::fmimewrite(struct soap *soap, void *handle, const char *buf, size_t len) |
This callback is called by the engine to write a chunk of attachment data received. The handle parameter contains the handle returned by the soap::fmimewriteopen callback. The buf parameter contains the data of length len. Returns #SOAP_OK or a soap_status (int) error code.
| soap | soap context |
| handle | the value of the handle returned by soap::fmimewriteopen |
| *Callback to close a MIME MTOM attachment stream after writing void(*) soap::fmimewriteclose(struct soap *soap, void *handle) |
This callback is called by the engine to close the MIME/MTOM attachment stream after writing. The handle parameter contains the handle returned by the soap::fmimewriteopen callback.
| soap | soap context |
| handle | the value of the of the handle returned by soap::fmimewriteopen |
| *Callback to open a streaming MIME MTOM attachment for writing void *(*) soap::fmimewriteopen(struct soap *soap, void *handle, const char *id, const char *type, const char *description, enum soap_mime_encoding encoding) |
Called by the to start receiving a streaming MIME/MTOM attachment. This callback opens a stream to start writing the attachment data received. The actual data stream will be written in chunks using the soap::fmimewrite callback until no more data is available and the soap::fmimewriteclose callback is called to close the stream. The id, type and options parameters are the id, type and options of the attachment struct/class (e.g. xsd__base64Binary or _xop__Include with __ptr, __size, id, type and options members), respectively. The callback should return a handle, which is passed to the soap::fmimewrite and soap::fmimewriteclose callbacks. The __ptr member variable of the attachment struct/class is set by the engine to the value of this handle. The __size member variable is set to the size of the attachment received.
| soap | soap context |
| id | the value of the id member variable of the attachment struct/class with data |
| type | the value of the type member variable of the attachment struct/class with data |
| options | the value of the options member variable of the attachment struct/class with data |
| *Callback that opens a socket connection to a server endpoint SOAP_SOCKET(*) soap::fopen(struct soap *soap, const char *endpoint, const char *host, int port) |
This callback is called by the engine at the client-side by ::soap_connect or soap_connect_command to open a TCP or UDP connection to a server specified at an endpoint. Parameters host and port are micro-parsed from endpoint before being passed to soap::fopen. Returns a valid socket or #SOAP_INVALID_SOCKET with a soap::error set to a soap_status (int) error code and soap::errnum set to errno of the connection failure. The built-in function assigned to soap::fopen is tcp_connect.
| soap | soap context |
| endpoint | URL of the endpoint to connect to (string) |
| host | URL host of the endpoint to connect to (string) |
| port | URL port of the endpoint to connect to (int) |
| *Callback to implement logic at the server side to serve responses to HTTP OPTION requests from clients int(*) soap::fopt(struct soap *soap) |
Called by the service dispatcher when an HTTP OPTION request is pending. Redefine this callback to respond to HTTP OPTION requests, see the http_post HTTP POST plugin for more details. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fopt is the internal static function http_200 that returns HTTP 200 OK.
| soap | soap context |
| * Callback to implement logic at the server side to handle HTML soap::forms |
| *Callback that reads and parses HTTP and MIME headers int(*) soap::fparse(struct soap *soap) |
This callback is called by the engine (as a client or server) to read and parse HTTP headers or MIME headers. When redefined, this function should read or skip the entire HTTP header to reach the message body. Function soap_getline is used by this callback to read each header line into an internal buffer soap::msgbuf with soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)). Returns #SOAP_OK, or a gSOAP error code. The built-in function assigned to soap::fparse is http_parse.
| soap | soap context |
| *Callback that consumes an HTTP header that consists of a key value pair int(*) soap::fparsehdr(struct soap *soap, const char *key, const char *val) |
This callback is called by soap::fparse, consumes an HTTP header that is split in a key-value pair and updates the soap context state accordingly. The context is updated with the HTTP header information received, but HTTP headers are not literally retained by the engine. Returns #SOAP_OK or #SOAP_STOP to prevent further reading of the HTTP body, or a soap_status (int) error code. The built-in function assigned to soap::fparsehdr is http_parse_header.
| soap | soap context |
| key | HTTP header key received (non-NULL string) |
| val | HTTP header value received (non-NULL string) or an empty string |
| *Callback to implement logic at the server side to serve responses to HTTP PATCH requests from clients int(*) soap::fpatch(struct soap *soap) |
This callback is called by the service dispatcher when an HTTP PATCH request is pending. Redefine this callback to respond to HTTP PATCH requests, see the http_post HTTP POST plugin for more details. Returns #SOAP_OK or a soap_status error code. The built-in function assigned to soap::fpatch is the internal static function http_patch that returns the #SOAP_PATCH_METHOD error.
| soap | soap context |
| *Callback that blocks until activity is detected on the ::soap::socket or ::soap::master times out when ::soap::send_timeout or ::soap::recv_timeout are set int(*) soap::fpoll(struct soap *soap) |
This callback is called by the engine to wait for activity on the soap::socket or soap::master socket using poll or select. Times out when soap::send_timeout or soap::recv_timeout are nonzero. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fpoll is soap_poll.
| soap | soap context |
| *Callback that populates and then sends HTTP headers from the client side to a connected HTTP server int(*) soap::fpost(struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, ULONG64 count) |
This callback is called at the client side by the engine to send HTTP headers to the connected server. The parameters host, port, and path were micro-parsed from the endpoint prior to passing them to this callback. Parameter action is the SOAP Action header. Parameter count is the length of the HTTP body with the message or 0 when HTTP chunking is used. This callback sends the headers with POST by default, or when soap::status == #SOAP_POST or soap::status == #SOAP_POST_FILE. Alternatively, sends the HTTP headers with GET when soap::status == #SOAP_GET, PATCH when soap::status == #SOAP_PATCH, PUT when soap::status == #SOAP_PUT, DELETE when soap::status == #SOAP_DEL, CONNECT when soap::status == #SOAP_CONNECT, HEAD when soap::status == #SOAP_HEAD or OPTIONS when soap::status == #SOAP_OPTIONS. Extra HTTP headers are added when soap::http_extra_header is set to one or more header lines separated by CRLF. When redefining this callback, use function soap_send to write the header contents. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap:fpost is http_post.
| soap | soap context |
| endpoint | URL of the endpoint connected to (string) |
| host | URL host of the endpoint connected to (string) |
| port | URL port of the endpoint connected to (int) |
| path | URL path of the endpoint connected to (string) |
| action | SOAP Action or NULL (string) |
| count | HTTP content-length or 0 for HTTP chunked transfers (size_t) |
| *Callback that sends a single HTTP header given a key value pair int(*) soap::fposthdr(struct soap *soap, const char *key, const char *val) |
This callback is called by soap::fpost and soap::fresponse to send an HTTP header with a key and an optional value. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fposthdr is http_post_header.
| soap | soap context |
| key | HTTP header key (string) |
| val | optional HTTP header value (string), omitted when NULL |
| *Callback to implement logic at the server side to serve responses to HTTP PUT requests from clients int(*) soap::fput(struct soap *soap) |
This callback is called by the service dispatcher when an HTTP PUT request is pending. Redefine this callback to respond to HTTP PUT requests, see the http_post HTTP POST plugin for more details. Returns #SOAP_OK or a soap_status error code. The built-in function assigned to soap::fput is the internal static function http_put that returns the #SOAP_PUT_METHOD error.
| soap | soap context |
| *Callback that receives bytes of data into the given buffer size_t(*) soap::frecv(struct soap *soap, char *buf, size_t len) |
This callback is called by the engine to receive (or read) data into a specified buffer buf and len. The source for the data to read by this callback is soap::is when non-NULL, soap::socket when valid, or soap::recvfd. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::frecv is frecv.
| soap | soap context |
| buf | buffer to fill with bytes to be read (string) |
| len | maximum size of the buffer (size_t) |
| *Callback that resolves a host name by address translation int(*) soap::fresolve(struct soap *soap, const char *name, struct in_addr *inaddr) |
This callback is called by ::soap_bind (or the C++ service class bind method) at the server-side and by ::soap_connect or soap_connect_command at the client-side with a host name parameter to resolve to address inaddr by address translation. When successful sets parameter inaddr and returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fresolve is tcp_gethost.
| soap | soap context |
| name | host name (string) |
| inaddr | points to in_addr structure to set |
| *Callback that populates and then sends HTTP headers from the server side to a connected client int(*) soap::fresponse(struct soap *soap, int status, ULONG64 count) |
This callback is called at the server side by the engine to send the HTTP headers to the connected client. The parameter status should be an HTTP status error code or #SOAP_OK (200 OK) or #SOAP_HTML or #SOAP_FILE. Using #SOAP_HTML sets the content-type header to text/html; charset=utf-8. Using #SOAP_FILE sets the content-type header to the value of soap::http_content. Extra HTTP headers are added when soap::http_extra_header is set to one or more header lines separated by CRLF. When redefining this callback, use function soap_send to write the header contents. Returns #SOAP_OK or a soap_status error code. The built-in function assigned to soap::fresponse is http_response.
| soap | soap context |
| status | HTTP status code (> 100) or #SOAP_OK (200 OK), or #SOAP_HTML or #SOAP_FILE |
| count | HTTP content-length or 0 for HTTP chunked transfers |
| *Callback that sends the given bytes of data int(*) soap::fsend(struct soap *soap, const char *data, size_t len) |
This callback is called by the engine to send (or write) data specified by data bytes of length len. The sink for the data to be sent to is typically soap::socket, soap::sendfd or soap::os. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fsend is fsend.
| soap | soap context |
| data | bytes to be send (string) |
| len | number of bytes to be send (size_t) |
| *Callback executed by the engine at the server side immediately after a server operation successfully completed int(*) soap::fserveloop(struct soap *soap) |
This callback is called after each successful completion of a server operation in the server loop. Executes immediately after sending the response to a client and before the next keep-alive server loop iteration when enabled with #SOAP_IO_KEEPALIVE. This callback can be used to reclaim resources in the keep-alive server loop, for example managed memory can be reclaimed by calling ::soap_destroy and soap_end in that order and all deserialized and other dynamically-allocated data managed by the context will be deallocated. Returns #SOAP_OK or a soap_status (int) error code. No built-in function is assigned to soap::fserveloop.
| soap | soap context |
| *Callback to inspect or override fault code or fault string messages void(*) soap::fseterror(struct soap *soap, const char **faultcode, const char **faultstring) |
This callback is called by the engine when an error is raised to allow inspection or overriding of the fault code or fault string messages before the error is reported or transmitted. No built-in function is assigned to soap::fseterror.
| soap | soap context |
| faultcode | pointer to a string with the fault code message or NULL, can be reassigned |
| faultstring | pointer to a string with the fault string message or NULL, can be reassigned |
| *Callback that shuts down a given socket int(*) soap::fshutdownsocket(struct soap *soap, SOAP_SOCKET sock, int how) |
This callback is called to shut down a socket by the engine. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fshutdownsocket is tcp_shutdownsocket.
| soap | soap context |
| sock | socket to shut down |
| how | SHUT_RD (=0), SHUT_WR (=1) or SHUT_RDWR (=2) |
| *Callback to initialize the OpenSSL library int(*) soap::fsslauth(struct soap *soap) |
This callback is called to initialize the OpenSSL, GNUTLS, or WolfSSL context for HTTPS connections configured with the parameters passed to soap_ssl_client_context and soap_ssl_server_context. Returns #SOAP_OK or a soap_status (int) error code. The built-in function assigned to soap::fsslauth is ssl_auth_init.
| soap | soap context |
| *Callback to validate strings against XML regex patterns int(*) soap::fsvalidate(struct soap *soap, const char *pattern, const char *string) |
This callback is called to validate a string against an XML regex pattern. Patterns use XML schema regex syntax. This callback allows user-defined pattern validation that is normally disabled. Returns #SOAP_OK when the string matches the pattern or #SOAP_TYPE when the string does not match. No built-in function is assigned to soap::fsvalidate.
| soap | soap context |
| pattern | regex in XML schema syntax |
| string | to match pattern against |
| *Callback to validate wide strings against XML regex patterns int(*) soap::fwvalidate(struct soap *soap, const char *pattern, const wchar_t *string) |
This callback is called to validate a wide string against an XML regex pattern. Patterns use XML schema regex syntax. This callback allows user-defined pattern validation that is normally disabled. Returns #SOAP_OK when the string matches the pattern or #SOAP_TYPE when the string does not match. No built-in function is assigned to soap::fwvalidate.
| soap | soap context |
| pattern | regex in XML schema syntax |
| string | to match pattern against |
| struct SOAP_ENV__Header* soap::header |
The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or that can be populated by the user to be sent, or NULL when no SOAP Header is present.
| char soap::host[SOAP_TAGLEN] |
The host IP address of the client, as received on the server side.
On the server side, the host string is the IPv4 or IPv6 address, depending on #WITH_IPV6. On the client side, the host string is extracted from soap::endpoint, i.e. the endpoint URL of the server.
| const char* soap::http_content |
String with HTTP content type header value received, can also be assigned to specify a content type header for soap_connect_command with #SOAP_POST_FILE, #SOAP_PUT and #SOAP_PATCH or for soap_response with #SOAP_FILE or for soap_PUT, soap_PATCH, soap_POST. The soap::http_content string is reset to NULL after each HTTP invocation and has to be set again when required.
| const char* soap::http_extra_header |
User-definable string that specifies an extra HTTP header or multiple HTTP headers when separated by CRLF in the specified string, to include in the next HTTP request (client side) or to include with the HTTP response (server side). The specified headre or headers are checked by the engine to conform to HTTP header formats or otherwise will be ignored and not output.
The soap context input soap_mode flags that are set at context initialization and set or cleared with soap_set_imode or soap_clr_imode, respectively.
| unsigned int soap::ip |
The IPv4 address in numeric form of the client as received on the server side by ::soap_accept (or the C++ service class accept method), possibly set to zero when #WITH_IPV6 is used.
| unsigned int soap::ip6[4] |
The IPv6 address in numeric form (upper ip6[0] to lower ip6[3]) of the client as received on the server side by ::soap_accept (or the C++ service class accept method), requires #WITH_IPV6.
| char* soap::ipv4_multicast_if |
User-definable value to set setsockopt level IPPROTO_IP to IP_MULTICAST_IF when non-NULL.
This value is used by the engine for UDP multicast messaging at the client side, sets setsockopt level IPPROTO_IP to IP_MULTICAST_IF with value soap::ipv4_multicast_if when non-NULL.
| unsigned char soap::ipv4_multicast_ttl |
User-definable value to set setsockopt level IPPROTO_IP to IP_MULTICAST_TTL when nonzero.
This value is used by the engine for UDP multicast messaging at the client side, sets setsockopt level IPPROTO_IP to IP_MULTICAST_TTL with value soap::ipv4_multicast_ttl when nonzero. Requires #WITH_IPV6.
Refer to the socket options for IPPROTO_IP IP_MULTICAST_TTL to limit the lifetime of the packet. Multicast datagrams are sent with a default value of 1, to prevent them to be forwarded beyond the local network. This parameter can be set between 1 to 255.
| unsigned int soap::ipv6_multicast_if |
User-definable value to set sockaddr_in6::sin6_scope_id when nonzero.
This value is used by the engine for UDP multicast messaging at the client side, sets sockaddr_in6::sin6_scope_id to soap::ipv6_multicast_if when nonzero. Requires #WITH_IPV6.
| SOAP_SOURCE* soap::is |
The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-terminated string to be read, default value is NULL.
| int soap::keep_alive |
HTTP keep-alive flag (try to enable when -1, disabled when 0) and counter (enabled when >0).
| const char* soap::lang |
User-definable xml:lang attribute value of SOAP-ENV:Text to output the SOAP Fault string/reason (the value is en by default).
| * The HTTP content length header value received or when HTTP transfer encoding is chunked ULONG64 soap::length |
| * Internal buffer to hold short URLs and HTTP MIME header soap::lines |
| unsigned short soap::linger_time |
User-definable linger time value, requires the SO_LINGER setsockopt flag value to be assigned to soap::socket_flags.
The socket set by ::soap_bind (or the C++ service class bind method) to serve as the master socket bound to a specified port, or #SOAP_INVALID_SOCKET when unassigned.
User-definable maximum number of keep-alive message exchanges per connection (the value is #SOAP_MAXKEEPALIVE by default).
| long soap::maxlength |
User-definable maximum string length parsed from XML and JSON, initially set to #SOAP_MAXLENGTH, zero or negative means unlimited (0 by default).
The length of a string is the number of characters it contains. Multi-byte strings with UTF-8 content (enabled with #SOAP_C_UTFSTRING) contain up to the specified number of multi-byte characters. The byte length depends on the UTF-8 encoding. The specified limit applies to strings that are not subject to string length schema validation constraints, to ensure that schema validation is not affected.
| unsigned int soap::maxlevel |
User-definable maximum XML and JSON nesting level permitted, initially set to #SOAP_MAXLEVEL (the value is 10000 by default).
| size_t soap::maxoccurs |
User-definable maximum array and container size (maximum item occurrence constraint) as parsed from XML and JSON, except when specifie XML schema validation constraints permit greater sizes, initially set to #SOAP_MAXOCCURS (the value is 100000 by default).
The specified occurrence limit applies to arrays and containers that are not subject to occurrence validation constraints (minOccurs and maxOccurs, to ensure that schema validation is not affected.
| * Internal buffer to hold short soap::messages |
| * MIME attachments received struct soap_mime soap::mime |
This structure contains a linked list of MIME attachments received.
| * Internal buffer to hold short URLs and HTTP MIME header must have at least char soap::msgbuf[SOAP_TMPLEN] |
| short soap::mustUnderstand |
The soap::mustUnderstand flag is set when a SOAP Header element carries a SOAP-ENV:mustUnderstand attribute that is true.
| * Internal buffer to hold temporary strings such as string representations of primitive XML tag soap::names |
| const char* soap::ntlm_challenge |
User-definable NTLM authentication challenge key string.
| short soap::null |
The soap::null flag is set when an element carries a xsi:nil attribute that is true.
The soap context output soap_mode flags that are set at context initialization and set or cleared with soap_set_omode or soap_clr_omode, respectively.
| * Internal buffer to hold temporary strings such as string representations of primitive XML tag HTTP header lines and so soap::on |
| const char* soap::origin |
The CORS Origin HTTP header string value received.
CORS is automatic at the server side. The server internally calls the soap::fopt callback to serve the OPTION method CORS request, which returns HTTP 200 OK with CORS headers. The default value of the CORS Access-Control-Allow-Origin header is "*".
At the client side, CORS requires the HTTP OPTIONS method with CORS headers. Use the following code to send HTTP OPTIONS with CORS headers to a server:
| SOAP_SINK* soap::os |
The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer to a char* string variable that will be set to point to a managed 0-terminated string with the data, default value is NULL.
| const char* soap::override_host |
User-definable string to override the host name or IP address in the HTTP header when connecting at the client side.
User-definable port number to override the port address in the HTTP header when connecting at the client side.
| const char* soap::passwd |
User-definable HTTP and NTLM authorization password string required for HTTP basic and NTLM authentication by the client, server side receives this string when the client uses HTTP basic authentication.
| char soap::path[SOAP_TAGLEN] |
The client request path as received on the server side.
The URL path string is extracted from the HTTP header by soap::fparse called by soap_begin_recv and starts with a "/".
| int soap::port |
| const char* soap::prolog |
User-definable XML declaration prolog (<?xml version="1.0" encoding="UTF-8"?> by default).
| const char* soap::proxy_from |
The X-Forwarding-For HTTP header string value received.
| const char* soap::proxy_host |
User-definable proxy host name string which should be set to connect through an HTTP proxy.
| const char* soap::proxy_passwd |
User-definable proxy authorization password string to authenticate and connect to an HTTP proxy.
| int soap::proxy_port |
User-definable proxy port which should be set to connect through an HTTP proxy (the value is 8080 by default).
| const char* soap::proxy_userid |
User-definable proxy authorization user id string to authenticate and connect to an HTTP proxy.
| int soap::rcvbuf |
User-definable value to set SO_RCVBUF setsockopt (the value is #SOAP_BUFLEN by default).
User-definable maximum message length that is permitted to be received, zero means unlimited (the value is 2GB by default).
User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default).
| int soap::recvfd |
The file descriptor to read data from when no socket communications are set (soap::socket == #SOAP_INVALID_SOCKET) and soap:is == NULL, default value is 0 (stdin).
User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default).
| int soap::sendfd |
The file descriptor to write data to when no socket communications are set (soap::socket == #SOAP_INVALID_SOCKET) and soap:os == NULL, default value is 1 (stdout).
| * Internal buffer with partial data received or partial data to be soap::sent |
| int soap::sndbuf |
User-definable value to set SO_SNDBUF setsockopt (the value is #SOAP_BUFLEN by default).
| * Callback that blocks until activity is detected on the ::soap::socket or ::soap::master soap::socket |
The socket set by ::soap_accept (or the C++ service class accept method) or ::soap_connect or soap_connect_command (or the C++ proxy methods) when successful, or #SOAP_INVALID_SOCKET when unassigned.
User-definable socket send and recv flags, for example assign MSG_NOSIGNAL to disable sigpipe (the value is 0 by default).
Other ways to disable sigpipe:
| int soap::status |
The soap context HTTP status code received at the client side (100 to 599), HTTP header method received at the server side (#SOAP_POST, #SOAP_PATCH, #SOAP_GET, #SOAP_PUT, #SOAP_DEL, #SOAP_HEAD, #SOAP_OPTIONS), or the HTTP method to use for sending a message with soap_connect_command or with soap_response (#SOAP_POST, #SOAP_POST_FILE, #SOAP_PATCH, #SOAP_GET, #SOAP_PUT, #SOAP_PUT, #SOAP_DEL, #SOAP_CONNECT, #SOAP_HEAD, #SOAP_OPTIONS).
| *Callback to manage the verification of the certificate provided by a X509_STORE_CTX* soap::store |
User-definable value to set SO_KEEPALIVE setsockopt (0 by default unless the #SOAP_IO_KEEPALIVE mode flag is set).
HTTP keep-alive together with TCP SO_KEEPALIVE is enabled with:
| unsigned int soap::tcp_keep_cnt |
User-definable value to set TCP_KEEPCNT setsockopt (the value is 0 by default).
HTTP keep-alive with TCP SO_KEEPALIVE is enabled with:
| unsigned int soap::tcp_keep_idle |
User-definable value to set TCP_KEEPIDLE setsockopt (the value is 0 by default).
HTTP keep-alive with TCP SO_KEEPALIVE is enabled with:
| unsigned int soap::tcp_keep_intvl |
User-definable value to set TCP_KEEPINTVL setsockopt (the value is 0 by default).
HTTP keep-alive with TCP SO_KEEPALIVE is enabled with:
| * Internal buffer to hold temporary strings such as string representations of primitive XML tag HTTP header lines and so must have at least char soap::tmpbuf[SOAP_TMPLEN] |
User-definable timeout to send or receive an entire message, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default).
| void* soap::user |
User-definable variable that may point to user-specified data of any type to pass the data through to callbacks and plugins.
| const char* soap::userid |
User-definable HTTP and NTLM authorization user id string for HTTP basic and NTLM authentication by the client, server side receives this string when the client uses HTTP basic authentication, for HTTP digest authentication see the gSOAP HTTP digest authentication plugin.
| * Internal buffer to hold temporary strings such as string representations of primitive soap::values |
| short soap::version |
SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2).
The SOAP version is determined from the SOAP or XML message received. The version is automatically set before sending messages when SOAP 1.1 or SOAP 1.2 namespaces are defined in the Namespace table or when SOAP namespaces are omitted from the table. The version can be explicitly set or overruled by calling ::soap_set_version.
| unsigned short soap::z_level |
User-definable compression level for gzip compression (0=none, 1=fast to 9=best) default level is 6.
| float soap::z_ratio_in |
The compression ratio = compressed.size/uncompressed.size of the compressed message received.
| float soap::z_ratio_out |
The compression ratio = compressed.size/uncompressed.size of the compressed message sent.