gSOAP WS-Discovery 2.8 Stable

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Functions | Variables
/Users/engelen/Projects/gsoap/plugin/wsddapi.c File Reference
`#include "wsddapi.h"`
Include dependency graph for wsddapi.c:

## Functions
static int | soap_wsdd_serve___wsdd__Hello (struct soap *soap)
static int | soap_wsdd_serve___wsdd__Bye (struct soap *soap)
static int | soap_wsdd_serve___wsdd__Probe (struct soap *soap)
static int | soap_wsdd_serve___wsdd__ProbeMatches (struct soap *soap)
static int | soap_wsdd_serve___wsdd__Resolve (struct soap *soap)
static int | soap_wsdd_serve___wsdd__ResolveMatches (struct soap *soap)
static void | soap_wsdd_set_AppSequence (struct soap *)
static void | soap_wsdd_reset_AppSequence (struct soap *)
static void | soap_wsdd_delay (struct soap *)
int | soap_wsdd_Hello (struct soap *soap, soap_wsdd_mode mode, const char *endpoint, const char *MessageID, const char *RelatesTo, const char *EndpointReference, const char *Types, const char *Scopes, const char *MatchBy, const char *XAddrs, unsigned int MetadataVersion)
| TS or DP Hello message to join a network.
int | soap_wsdd_Bye (struct soap *soap, soap_wsdd_mode mode, const char *endpoint, const char *MessageID, const char *EndpointReference, const char *Types, const char *Scopes, const char *MatchBy, const char *XAddrs, unsigned int MetadataVersion)
| TS or DP Bye message to leave a network.
int | soap_wsdd_Probe (struct soap *soap, soap_wsdd_mode mode, soap_wsdd_to to, const char *endpoint, const char *MessageID, const char *ReplyTo, const char *Types, const char *Scopes, const char *MatchBy)
| Client Probe message to a TS or DP.
int | soap_wsdd_Resolve (struct soap *soap, soap_wsdd_mode mode, soap_wsdd_to to, const char *endpoint, const char *MessageID, const char *ReplyTo, const char *EndpointReference)
| Client Resolve message to a TS or DP.
void | soap_wsdd_init_ProbeMatches (struct soap *soap, struct wsdd__ProbeMatchesType *matches)
| Initalize the probe matches container.
int | soap_wsdd_add_ProbeMatch (struct soap *soap, struct wsdd__ProbeMatchesType *matches, const char *EndpointReference, const char *Types, const char *Scopes, const char *MatchBy, const char *XAddrs, unsigned int MetadataVersion)
| Add a match to the probe matches container.
int | soap_wsdd_ProbeMatches (struct soap *soap, const char *endpoint, const char *MessageID, const char *RelatesTo, const char *To, struct wsdd__ProbeMatchesType *matches)
| TS or DP ProbeMatches message.
int | soap_wsdd_ResolveMatches (struct soap *soap, const char *endpoint, const char *MessageID, const char *RelatesTo, const char *To, const char *EndpointReference, const char *Types, const char *Scopes, const char *MatchBy, const char *XAddrs, unsigned int MetadataVersion)
| TS or DP ResolveMatches message.
int | soap_wsdd_listen (struct soap *soap, int timeout)
| Listen on a port for inbound WS-Discovery messages.
int | soap_wsdd_serve_request (struct soap *soap)
int | __wsdd__Hello (struct soap *soap, struct wsdd__HelloType *Hello)
| Internal WS-Discovery service operation.
int | __wsdd__Bye (struct soap *soap, struct wsdd__ByeType *Bye)
| Internal WS-Discovery service operation.
static int | soap_wsdd_http (struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, size_t count)
int | __wsdd__Probe (struct soap *soap, struct wsdd__ProbeType *Probe)
| Internal WS-Discovery service operation.
int | __wsdd__ProbeMatches (struct soap *soap, struct wsdd__ProbeMatchesType *ProbeMatches)
| Internal WS-Discovery service operation.
int | __wsdd__Resolve (struct soap *soap, struct wsdd__ResolveType *Resolve)
| Internal WS-Discovery service operation.
int | __wsdd__ResolveMatches (struct soap *soap, struct wsdd__ResolveMatchesType *ResolveMatches)
| Internal WS-Discovery service operation.
void | soap_wsdd_set_InstanceId (unsigned int InstanceId)
| Set the global AppSequence InstanceId that is used to populate messages.
void | soap_wsdd_set_SequenceId (const char *SequenceId)
| Set the global AppSequence SequenceId that is used to populate messages.
## Variables
const char * | to_ts_URL = "urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01"
static MUTEX_TYPE | soap_wsdd_state = MUTEX_INITIALIZER
static unsigned int | soap_wsdd_InstanceId = 0
static const char * | soap_wsdd_SequenceId = NULL
static unsigned int | soap_wsdd_MessageNumber = 1

## Function Documentation

int __wsdd__Bye | ( | struct soap * | soap,
|  | struct wsdd__ByeType * | Bye
| ) |  |

Internal WS-Discovery service operation.

int __wsdd__Hello | ( | struct soap * | soap,
|  | struct wsdd__HelloType * | Hello
| ) |  |

Internal WS-Discovery service operation.

int __wsdd__Probe | ( | struct soap * | soap,
|  | struct wsdd__ProbeType * | Probe
| ) |  |

Internal WS-Discovery service operation.

int __wsdd__ProbeMatches | ( | struct soap * | soap,
|  | struct wsdd__ProbeMatchesType * | ProbeMatches
| ) |  |

Internal WS-Discovery service operation.

int __wsdd__Resolve | ( | struct soap * | soap,
|  | struct wsdd__ResolveType * | Resolve
| ) |  |

Internal WS-Discovery service operation.

int __wsdd__ResolveMatches | ( | struct soap * | soap,
|  | struct wsdd__ResolveMatchesType * | ResolveMatches
| ) |  |

Internal WS-Discovery service operation.

int soap_wsdd_add_ProbeMatch | ( | struct soap * | soap,
|  | struct wsdd__ProbeMatchesType * | matches,
|  | const char * | EndpointReference,
|  | const char * | Types,
|  | const char * | Scopes,
|  | const char * | MatchBy,
|  | const char * | XAddrs,
|  | unsigned int | MetadataVersion
| ) |  |

Add a match to the probe matches container.

Parameters:

  | soap | context
  | matches | the container to update with a new match
  [in] | EndpointReference | of this Target Server or Discovery Proxy
  [in] | Types | an unordered string of QNames or NULL, a Discovery Proxy MUST include "wsdd:DiscoveryProxy"
  [in] | Scopes | an unordered set of scopes or NULL
  [in] | MatchBy | NULL (unused, reserved)
  [in] | XAddrs | contains the transport address(es) that MAY be used to communicate with the Target Service or Discovery Proxy
  [in] | MetadataVersion | incremented by a positive value (>= 1) whenever there is a change in the metadata of the Target Service

Returns:
  SOAP_OK or error code

To populate a Prove matches container, first initialize with soap_wsdd_init_ProbeMatches, then use this function to add each match. The container is deallocated with soap_end(soap) and can be initialized again (without leaks).

int soap_wsdd_Bye | ( | struct soap * | soap,
|  | soap_wsdd_mode | mode,
|  | const char * | endpoint,
|  | const char * | MessageID,
|  | const char * | EndpointReference,
|  | const char * | Types,
|  | const char * | Scopes,
|  | const char * | MatchBy,
|  | const char * | XAddrs,
|  | unsigned int | MetadataVersion
| ) |  |

TS or DP Bye message to leave a network.

Parameters:

  | soap | context
  [in] | mode | SOAP_WSDD_MANAGED or SOAP_WSDD_ADHOC
  [in] | endpoint | to send Bye message to (unicast or multicast)
  [in] | MessageID | unique WS-Addressing message ID (soap_wsa_rand_uuid)
  [in] | EndpointReference | of this Target Server or Discovery Proxy
  [in] | Types | an unordered string of QNames or NULL, a Discovery Proxy MUST include "wsdd:DiscoveryProxy"
  [in] | Scopes | an unordered set of scopes or NULL
  [in] | MatchBy | NULL (unused, reserved)
  [in] | XAddrs | contains the transport address(es) that MAY be used to communicate with the Target Service or Discovery Proxy
  [in] | MetadataVersion | incremented by a positive value (>= 1) whenever there is a change in the metadata of the Target Service

Returns:
  SOAP_OK or error code

Bye is a one-way message sent by a Target Service to announce its unavailability as a best effort when it leaves the network.

static void soap_wsdd_delay | ( | struct soap * | soap | ) | `[static]`

int soap_wsdd_Hello | ( | struct soap * | soap,
|  | soap_wsdd_mode | mode,
|  | const char * | endpoint,
|  | const char * | MessageID,
|  | const char * | RelatesTo,
|  | const char * | EndpointReference,
|  | const char * | Types,
|  | const char * | Scopes,
|  | const char * | MatchBy,
|  | const char * | XAddrs,
|  | unsigned int | MetadataVersion
| ) |  |

TS or DP Hello message to join a network.

Parameters:

  | soap | context
  [in] | mode | SOAP_WSDD_MANAGED or SOAP_WSDD_ADHOC
  [in] | endpoint | to send Hello message to (unicast or multicast)
  [in] | MessageID | unique WS-Addressing message ID (soap_wsa_rand_uuid)
  [in] | RelatesTo | WS-Addressing message ID
  [in] | EndpointReference | of this Target Server or Discovery Proxy
  [in] | Types | an unordered string of QNames or NULL, a Discovery Proxy MUST include "wsdd:DiscoveryProxy"
  [in] | Scopes | an unordered set of scopes or NULL
  [in] | MatchBy | NULL (unused, reserved)
  [in] | XAddrs | contains the transport address(es) that MAY be used to communicate with the Target Service or Discovery Proxy
  [in] | MetadataVersion | incremented by a positive value (>= 1) whenever there is a change in the metadata of the Target Service

Returns:
  SOAP_OK or error code

Hello is a one-way message sent by a Target Service to announce its availability when it joins the network. It is also sent by a Discovery Proxy to reduce multicast traffic on an ad hoc network.

static int soap_wsdd_http | ( | struct soap * | soap,
|  | const char * | endpoint,
|  | const char * | host,
|  | int | port,
|  | const char * | path,
|  | const char * | action,
|  | size_t | count
| ) |  | `[static]`

void soap_wsdd_init_ProbeMatches | ( | struct soap * | soap,
|  | struct wsdd__ProbeMatchesType * | matches
| ) |  |

Initalize the probe matches container.

Parameters:

  soap | context
  matches | the container with matches to initialize

int soap_wsdd_listen | ( | struct soap * | soap,
|  | int | timeout
| ) |  |

Listen on a port for inbound WS-Discovery messages.

Parameters:

  | soap | context
  [in] | timeout | seconds to listen (use negative value for micro seconds)

Returns:
  SOAP_OK or error code

First you need to open a port with soap_bind(soap). Then invoke this function to listen to WS-Discovery messages on that port. Inbound messages are accepted and the information is relayed to the event handlers, see Section WS-Discovery Event Handlers. Use soap->user to pass a pointer to a state object that the event hanlders can use. The timeout allows a Client to periodically poll the port for messages. A value of zero will loop the listener forever or until an error occurs.

int soap_wsdd_Probe | ( | struct soap * | soap,
|  | soap_wsdd_mode | mode,
|  | soap_wsdd_to | to,
|  | const char * | endpoint,
|  | const char * | MessageID,
|  | const char * | ReplyTo,
|  | const char * | Types,
|  | const char * | Scopes,
|  | const char * | MatchBy
| ) |  |

Client Probe message to a TS or DP.

Parameters:

  | soap | context
  [in] | mode | SOAP_WSDD_MANAGED or SOAP_WSDD_ADHOC
  [in] | to | SOAP_WSDD_TO_TS or SOAP_WSDD_TO_DP
  [in] | endpoint | to send Probe to (unicast or multicast)
  [in] | MessageID | WS-Addressing message ID of the message
  [in] | ReplyTo | WS-Addressing ReplyTo message ID of the message
  [in] | Types | an unordered string of QNames to probe
  [in] | Scopes | an unordered set of scopes to probe
  [in] | MatchBy | matching rule to apply for this probe

Returns:
  SOAP_OK or error code

A Client sends a probe to find Target Services by the Type of the Target Service, a Scope in which the Target Service resides, both, or simply all Target Services. The matches will be delivered to wsdd_event_ProbeMatches when soap_wsdd_listen receives a ProbeMatch response. The RelatesTo of the ProbeMatches is the MessageID of the Probe.

int soap_wsdd_ProbeMatches | ( | struct soap * | soap,
|  | const char * | endpoint,
|  | const char * | MessageID,
|  | const char * | RelatesTo,
|  | const char * | To,
|  | struct wsdd__ProbeMatchesType * | matches
| ) |  |

TS or DP ProbeMatches message.

Parameters:

  | soap | context
  [in] | endpoint | to send Probe to (unicast or multicast)
  [in] | MessageID | WS-Addressing message ID of the message
  [in] | RelatesTo | WS-Addressing RelatesTo message ID of the message
  [in] | To | WS-Addressing endpoint IP and port or NULL for anonymous
  [in] | matches | contains the probe matches, use soap_wsdd_add_ProbeMatch to populate this container

Returns:
  SOAP_OK or error code

A Client sends a probe to find Target Services by the Type of the Target Service, a Scope in which the Target Service resides, both, or simply all Target Services. The Target Server(s) or Discovery Proxy responds by sending ProbeMatches to the Client.

static void soap_wsdd_reset_AppSequence | ( | struct soap * | soap | ) | `[static]`

int soap_wsdd_Resolve | ( | struct soap * | soap,
|  | soap_wsdd_mode | mode,
|  | soap_wsdd_to | to,
|  | const char * | endpoint,
|  | const char * | MessageID,
|  | const char * | ReplyTo,
|  | const char * | EndpointReference
| ) |  |

Client Resolve message to a TS or DP.

Parameters:

  | soap | context
  [in] | mode | SOAP_WSDD_MANAGED or SOAP_WSDD_ADHOC
  [in] | to | SOAP_WSDD_TO_TS or SOAP_WSDD_TO_DP
  [in] | endpoint | to send Resolve to (unicast or multicast)
  [in] | MessageID | WS-Addressing message ID of the message
  [in] | ReplyTo | WS-Addressing ReplyTo message ID of the message
  [in] | EndpointReference | of the Target Service or Discovery Proxy

Returns:
  SOAP_OK or error code

A Client sends a resolve to locate a Target Service, i.e., to retrieve its transport address(es). This server-side event handler returns the match(es). The matches will be delivered to wsdd_event_ResolveMatches when soap_wsdd_listen receives a ResolveMatch response. The RelatesTo of the ResolveMatches is the MessageID of the Resolve.

int soap_wsdd_ResolveMatches | ( | struct soap * | soap,
|  | const char * | endpoint,
|  | const char * | MessageID,
|  | const char * | RelatesTo,
|  | const char * | To,
|  | const char * | EndpointReference,
|  | const char * | Types,
|  | const char * | Scopes,
|  | const char * | MatchBy,
|  | const char * | XAddrs,
|  | unsigned int | MetadataVersion
| ) |  |

TS or DP ResolveMatches message.

Parameters:

  | soap | context
  [in] | endpoint | to send Probe to (unicast or multicast)
  [in] | MessageID | WS-Addressing message ID of the message
  [in] | RelatesTo | WS-Addressing RelatesTo message ID of the message
  [in] | To | WS-Addressing endpoint IP and port or NULL for anonymous
  [in] | EndpointReference | of the Target Service
  [in] | Types | an unordered string of QNames or NULL, a Discovery Proxy MUST include "wsdd:DiscoveryProxy"
  [in] | Scopes | an unordered set of scopes or NULL
  [in] | MatchBy | NULL (unused, reserved)
  [in] | XAddrs | contains the transport address(es) that MAY be used to communicate with the Target Service or Discovery Proxy
  [in] | MetadataVersion | incremented by a positive value (>= 1) whenever there is a change in the metadata of the Target Service

Returns:
  SOAP_OK or error code

A Client sends a resolve to locate a Target Service, i.e., to retrieve its transport address(es). The Target Server(s) or Discovery Proxy responds by sending ResolveMatches to the Client.

static int soap_wsdd_serve___wsdd__Bye | ( | struct soap * | soap | ) | `[static]`

static int soap_wsdd_serve___wsdd__Hello | ( | struct soap * | soap | ) | `[static]`

static int soap_wsdd_serve___wsdd__Probe | ( | struct soap * | soap | ) | `[static]`

static int soap_wsdd_serve___wsdd__ProbeMatches | ( | struct soap * | soap | ) | `[static]`

static int soap_wsdd_serve___wsdd__Resolve | ( | struct soap * | soap | ) | `[static]`

static int soap_wsdd_serve___wsdd__ResolveMatches | ( | struct soap * | soap | ) | `[static]`

int soap_wsdd_serve_request | ( | struct soap * | soap | ) |

static void soap_wsdd_set_AppSequence | ( | struct soap * | soap | ) | `[static]`

void soap_wsdd_set_InstanceId | ( | unsigned int | InstanceId | ) |

Set the global AppSequence InstanceId that is used to populate messages.

Parameters:

  [in] | InstanceId |

void soap_wsdd_set_SequenceId | ( | const char * | SequenceId | ) |

Set the global AppSequence SequenceId that is used to populate messages.

Parameters:

  [in] | SequenceId |

## Variable Documentation

unsigned int soap_wsdd_InstanceId = 0`[static]`

unsigned int soap_wsdd_MessageNumber = 1`[static]`

const char* soap_wsdd_SequenceId = NULL`[static]`

MUTEX_TYPE soap_wsdd_state = MUTEX_INITIALIZER`[static]`

const char* to_ts_URL = "urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01"