![]() |
Home | Documentation |
Context with engine state
updated by Robert van Engelen
|
This module defines the soap context structure with the engine state with API functions to allocate, initialize, copy, and delete contexts. More...
Classes | |
| struct | soap |
| Context with the engine state. More... | |
Functions | |
| *Allocate and initialize a new ::soap context struct soap *soap_new *() * @returns pointer to allocated and initialized ` Allocate and initialize a new ::soap context with input and output ::soap_mode flags struct soap *soap_new1 *(soap_mode input_and_output_mode) * @returns pointer to allocated and initialized ` Allocate and initialize a new ::soap context with separate input and output ::soap_mode flags struct soap *soap_new2 *(soap_mode input_mode, soap_mode output_mode) * @returns pointer to allocated and initialized ` Initialize a stack allocated ::soap context void | soap_init (struct soap *soap) |
| *Initialize a stack allocated ::soap context with input and output ::soap_mode flags void | soap_init1 (struct soap *soap, soap_mode input_and_output_mode) |
| *Initialize a stack allocated ::soap context with input and output ::soap_mode flags void | soap_init2 (struct soap *soap, soap_mode input_mode, soap_mode output_mode) |
| *Set input and output ::soap_mode flags of the given ::soap context void | soap_set_mode (struct soap *soap, soap_mode input_and_output_mode) |
| *Set input ::soap_mode flags of the given ::soap context void | soap_set_imode (struct soap *soap, soap_mode input_mode) |
| *Set output ::soap_mode flags of the given ::soap context void | soap_set_omode (struct soap *soap, soap_mode output_mode) |
| *Clear input and output ::soap_mode flags of the given ::soap context void | soap_clr_mode (struct soap *soap, soap_mode input_and_output_mode) |
| *Clear input ::soap_mode flags of the given ::soap context void | soap_clr_imode (struct soap *soap, soap_mode input_mode) |
| *Clear output ::soap_mode flags of the given ::soap context void | soap_clr_omode (struct soap *soap, soap_mode output_mode) |
| *Copy the input output stream state of the given ::soap context to another context void | soap_copy_stream (struct soap *soap_destination, struct soap *soap_source) |
| *Free the input output stream state of the given ::soap context void | soap_free_stream (struct soap *soap) |
| *Finalize and free the given ::soap context from unmanaged heap memory void | soap_free (struct soap *soap) |
| *Finalize the given ::soap i e when the ::soap context is stack automatically invoked in C by the ::soap destructor on the ::soap context to delete void | soap_done (struct soap *soap) |
| *Allocate a block of heap memory managed by the specified ::soap context void * | soap_malloc (struct soap *soap, size_t len) * @returns pointer to the allocated block of memory or NULL on failure to allocate(out of memory) |
| *Copy a string to managed memory char * | soap_strdup (struct soap *soap, const char *string) * @returns copy of string or NULL when the specified string is NULL or on failure to allocate(out of memory) |
| *Copy a wide string to managed memory wchar_t * | soap_wstrdup (struct soap *soap, const wchar_t *string) * @returns copy of wide string or NULL when the specified wide string is NULL or on failure to allocate(out of memory) |
| *Unlink a block of heap memory managed by the specified ::soap to release the memory explicitly later int | soap_unlink (struct soap *soap, const void *ptr) * @returns ` |
| *Delete all dynamically allocated C objects managed by the specified ::soap context void | soap_destroy (struct soap *soap) |
| *Explicitly dealllocates a block of managed memory that is managed by the specified ::soap context and release the free memory back to the heap void | soap_dealloc (struct soap *soap, void *ptr) |
| *Delete temporary data void | soap_free_temp (struct soap *soap) |
| *Delete all data from heap memory managed by the specified ::soap context and release the freed memory back to the heap void | soap_end (struct soap *soap) |
| *Delegate the deletion of all managed objects and data from the specified ::soap context to another ::soap context void | soap_delegate_deletion (struct soap *soap, struct soap *soap_to) |
| *Set SOAP | version (0=no SOAP, 1=SOAP 1.1, 2=SOAP 1.2) void soap_set_version(struct soap *soap |
Variables | |
| *A built in string type containing literal XML content in UTF format typedef char * | _XML |
| *A built in string type containing normalized QName contents typedef char * | _QName |
| *Allocate and initialize a new ::soap context as a copy of the given ::soap context struct soap *soap_copy *(struct soap *soap) * @returns pointer to allocated and initialized ` Copy a given ::soap context to an uninitialized destination ::soap context voi | soap_copy_context )(struct soap *soap_destination, struct soap *soap_source) |
| *Finalize the given ::soap | context |
| *Finalize the given ::soap i e when the ::soap context is stack | allocated |
| *Set SOAP short | version |
| < soap contexr | |
This module defines the soap context structure with the engine state with API functions to allocate, initialize, copy, and delete contexts.
View the context structure with the engine state (a separate page) for more details on the context structure member variables. The member variables used in this page and elsewhere in the documentation are hyperlinked. Most structure member variables may be changed directly as is documented with illustrative examples.
| *Clear input ::soap_mode flags of the given ::soap context void soap_clr_imode | ( | struct soap * | soap, |
| soap_mode | input_mode ) |
| *Clear input and output ::soap_mode flags of the given ::soap context void soap_clr_mode | ( | struct soap * | soap, |
| soap_mode | input_and_output_mode ) |
| *Clear output ::soap_mode flags of the given ::soap context void soap_clr_omode | ( | struct soap * | soap, |
| soap_mode | output_mode ) |
| *Copy the input output stream state of the given ::soap context to another context void soap_copy_stream | ( | struct soap * | soap_destination, |
| struct soap * | soap_source ) |
This function copies the input/output state of the specified source context to the specified destination context. Both contexts will share the same input/output streams , i.e. soap::is, soap::os, soap::socket, soap::recvfd and soap::sendfd are shared and the current message buffer soap::buf content is copied. The destination context is set to the source context soap_mode flags and timeouts. To move the input/output state of one context to another, use this function and then call soap_free_stream on the source context to clear its input/output state.
| *Explicitly dealllocates a block of managed memory that is managed by the specified ::soap context and release the free memory back to the heap void soap_dealloc | ( | struct soap * | soap, |
| void * | ptr ) |
This function deallocates a managed block of memory from the managing soap context and releases the free memory back to the heap. This frees data allocated with soap_malloc and C++ objects allocated and instantiated with the soap_new_T functions. Normally this function should not be used to individually deallocate managed objects and data but rather soap_destroy and soap_end should be used to deallocate all objects and data managed by the context, which is much more efficient.
| soap | soap context |
| ptr | pointer to the block of managed heap memory to deallocate |
| *Delegate the deletion of all managed objects and data from the specified ::soap context to another ::soap context void soap_delegate_deletion | ( | struct soap * | soap, |
| struct soap * | soap_to ) |
This function delegates management of all dynamically-allocated data managed by the specified soap context to the target context soap_to for deletion by the target context using soap_destroy and soap_end in that order. Any pointers to the data remain valid (until deletion later) and can be safely used by an application. Only the management of the data is moved to the target context and is combined with any existing managed data.
| *Delete all dynamically allocated C objects managed by the specified ::soap context void soap_destroy | ( | struct soap * | soap | ) |
This function deletes all dynamically-allocated C++ objects managed by the specified soap context, i.e. data allocated with soap_new_T calls. This call should be followed by soap_end to delete all other dynamically-allocated data managed by the soap context. Or just invoke soap::destroy to delete objects and data and release the freed memory back to the heap.
| soap | soap context |
| *Finalize the given ::soap i e when the ::soap context is stack automatically invoked in C by the ::soap destructor on the ::soap context to delete void soap_done | ( | struct soap * | soap | ) |
This function finalizes the specified context. This function does not free memory managed by the context. To free memory managed by the context use soap_destroy and soap_end, or soap::destroy to call both.
| soap | soap context to finalize |
| *Delete all data from heap memory managed by the specified ::soap context and release the freed memory back to the heap void soap_end | ( | struct soap * | soap | ) |
This function deletes all dynamically-allocated data managed by the specified soap context, i.e. data allocated with soap_malloc. This call suffices to delete all managed data from C applications and release the freed memory back to the heap. C++ applications however should call soap_destroy first before soap_end or just invoke soap::destroy (or C++ proxy and service class member function destroy) to delete objects and data and release the freed memory back to the heap.
| soap | soap context |
| *Finalize and free the given ::soap context from unmanaged heap memory void soap_free | ( | struct soap * | soap | ) |
This function finalizes and frees the specified context. The finalization is done with soap_done before releasing its memory. This function does not free memory managed by the context. To free memory managed by the context use soap_destroy and soap_end, or soap::destroy to call both.
| soap | soap context to free |
| *Free the input output stream state of the given ::soap context void soap_free_stream | ( | struct soap * | soap | ) |
| soap | soap context |
| *Delete temporary data void soap_free_temp | ( | struct soap * | soap | ) |
This function deallocates temporary data such as buffers and hash tables but leaves deserialized managed data intact.
| soap | soap context |
| *Allocate and initialize a new ::soap context struct soap *soap_new *() *@returns pointer to allocated and initialized ` Allocate and initialize a new ::soap context with input and output ::soap_mode flags struct soap *soap_new1 *(soap_mode input_and_output_mode) *@returns pointer to allocated and initialized ` Allocate and initialize a new ::soap context with separate input and output ::soap_mode flags struct soap *soap_new2 *(soap_mode input_mode, soap_mode output_mode) *@returns pointer to allocated and initialized ` Initialize a stack allocated ::soap context void soap_init | ( | struct soap * | soap | ) |
This function allocates and initializes a new context.
There is no need to call soap_init to initialize the context allocated with ::soap_new, since ::soap_new initializes the allocated context. To change the input/output mode flags, use soap_set_mode and soap_clr_mode.
The context can be re-initialized for reuse after soap_done by calling soap_init.
| soap | soap context to initialize |
| *Initialize a stack allocated ::soap context with input and output ::soap_mode flags void soap_init1 | ( | struct soap * | soap, |
| soap_mode | input_and_output_mode ) |
This function initializes a context with the specified input and output soap_mode flags.
The context can be re-initialized for reuse after soap_done by calling soap_init.
| *Initialize a stack allocated ::soap context with input and output ::soap_mode flags void soap_init2 | ( | struct soap * | soap, |
| soap_mode | input_mode, | ||
| soap_mode | output_mode ) |
This function initializes a context with the specified input and output soap_mode flags.
| *Allocate a block of heap memory managed by the specified ::soap context void * soap_malloc | ( | struct soap * | soap, |
| size_t | len ) |
This function allocates a block of memory from the heap managed by the specified soap context. All such blocks allocated are deleted with a single call to soap_end. Returns a pointer to the allocated block of memory or NULL when out of memory without setting soap::error.
| soap | soap context |
| len | length of the block to allocate in number of bytes |
| *Set input ::soap_mode flags of the given ::soap context void soap_set_imode | ( | struct soap * | soap, |
| soap_mode | input_mode ) |
| *Set input and output ::soap_mode flags of the given ::soap context void soap_set_mode | ( | struct soap * | soap, |
| soap_mode | input_and_output_mode ) |
| *Set output ::soap_mode flags of the given ::soap context void soap_set_omode | ( | struct soap * | soap, |
| soap_mode | output_mode ) |
| *Copy a string to managed memory char * soap_strdup | ( | struct soap * | soap, |
| const char * | string ) |
This function copies the specified wide string to memory managed by the specified context. Returns a copy of the string or NULL when the specified string is NULL or when the function failed to allocate memory.
| soap | soap context |
| string | string to copy to managed memory |
| *Unlink a block of heap memory managed by the specified ::soap to release the memory explicitly later int soap_unlink | ( | struct soap * | soap, |
| const void * | ptr ) |
This function removes a managed block of memory from the managing soap context. This memory is not released but rather should be released explicitly later by the application logic using free or delete. Returns #SOAP_OK when successful or #SOAP_ERR when the block is not managed by the specified context.
| soap | soap context |
| ptr | pointer to the block of managed heap memory to unlink |
| *Copy a wide string to managed memory wchar_t * soap_wstrdup | ( | struct soap * | soap, |
| const wchar_t * | string ) |
This function copies the specified wide string to managed memory. Returns a copy of the wide string or NULL when the specified wide string is NULL or when the function failed to allocate memory.
| soap | soap context |
| string | wide string to copy to managed memory or NULL |
| *Set SOAP version | ( | 0 | = no SOAP, |
| 1 | = SOAP 1.1, | ||
| 2 | = SOAP 1.2 ) |
This function sets (or overrides) the SOAP version to use when sending a message. This function can be used prior to a client-side call to select the SOAP version to use for the request message (assuming the generated code does not fix the version already) or in a service operation to select the SOAP version of the response message. The response message of a service operation normally uses the same SOAP version of the SOAP request message received.
| * A built in string type containing normalized QName contents typedef char* _QName |
| * A built in string type containing literal XML content in UTF format typedef char* _XML |
| *Unlink a block of heap memory managed by the specified::soap context |
| *Allocate and initialize a new ::soap context as a copy of the given ::soap context struct soap *soap_copy *(struct soap *soap) *@returns pointer to allocated and initialized ` Copy a given ::soap context to an uninitialized destination ::soap context voi soap_copy_context) (struct soap *soap_destination, struct soap *soap_source) | ( | struct soap * | soap_destination, |
| struct soap * | soap_source ) |
This function allocates a new context and copies the state of the specified source context, except heap-allocated data managed by the specified source context, such as deserialized data. To delegate and move managed data from one context to another, use soap_delegate_deletion. Data is deleted with soap_destroy and soap_end in that order, then soap_free to delete the allocated context. After the copy the contexts do not share any data and can therefore be safely used by separate threads without requiring synchronization or mutex locking.
| *Set SOAP short version |
< soap contexr
< SOAP version (0 = REST (no SOAP), 1 = SOAP 1.1, 2 = SOAP 1.2)