|  | Home | Documentation | wsddapi.c File Reference updated by Robert van Engelen |

Functions | Variables
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 *)
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 void SOAP_FMAC2 | soap_wsdd_init_ProbeMatches (struct soap *soap, struct wsdd__ProbeMatchesType *matches)
| Initalize the probe matches container.
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 int SOAP_FMAC2 | 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.
SOAP_FMAC1 int SOAP_FMAC2 | soap_wsdd_listen (struct soap *soap, int timeout)
| Listen on a port for inbound WS-Discovery messages, also cleans up memory with soap_destroy and soap_end.
SOAP_FMAC1 int SOAP_FMAC2 | soap_wsdd_serve_request (struct soap *soap)
SOAP_FMAC5 int SOAP_FMAC6 | __wsdd__Hello (struct soap *soap, struct wsdd__HelloType *Hello)
| Internal WS-Discovery service operation.
SOAP_FMAC5 int SOAP_FMAC6 | __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, ULONG64 count)
SOAP_FMAC5 int SOAP_FMAC6 | __wsdd__Probe (struct soap *soap, struct wsdd__ProbeType *Probe)
| Internal WS-Discovery service operation.
SOAP_FMAC5 int SOAP_FMAC6 | __wsdd__ProbeMatches (struct soap *soap, struct wsdd__ProbeMatchesType *ProbeMatches)
| Internal WS-Discovery service operation.
SOAP_FMAC5 int SOAP_FMAC6 | __wsdd__Resolve (struct soap *soap, struct wsdd__ResolveType *Resolve)
| Internal WS-Discovery service operation.
SOAP_FMAC5 int SOAP_FMAC6 | __wsdd__ResolveMatches (struct soap *soap, struct wsdd__ResolveMatchesType *ResolveMatches)
| Internal WS-Discovery service operation.
SOAP_FMAC1 void SOAP_FMAC2 | soap_wsdd_set_InstanceId (unsigned int InstanceId)
| Set the global AppSequence InstanceId that is used to populate messages.
SOAP_FMAC1 void SOAP_FMAC2 | 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

## ◆ __wsdd__Bye()

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

Internal WS-Discovery service operation.

## ◆ __wsdd__Hello()

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

Internal WS-Discovery service operation.

## ◆ __wsdd__Probe()

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

Internal WS-Discovery service operation.

## ◆ __wsdd__ProbeMatches()

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

Internal WS-Discovery service operation.

## ◆ __wsdd__Resolve()

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

Internal WS-Discovery service operation.

## ◆ __wsdd__ResolveMatches()

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

Internal WS-Discovery service operation.

## ◆ soap_wsdd_add_ProbeMatch()

SOAP_FMAC1 int SOAP_FMAC2 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 Probe 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).

## ◆ soap_wsdd_Bye()

SOAP_FMAC1 int SOAP_FMAC2 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.

## ◆ soap_wsdd_delay()

void soap_wsdd_delay | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_Hello()

SOAP_FMAC1 int SOAP_FMAC2 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.

## ◆ soap_wsdd_http()

int soap_wsdd_http | ( | struct soap * | soap,
|  | const char * | endpoint,
|  | const char * | host,
|  | int | port,
|  | const char * | path,
|  | const char * | action,
|  | ULONG64 | count )

static

## ◆ soap_wsdd_init_ProbeMatches()

SOAP_FMAC1 void SOAP_FMAC2 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

## ◆ soap_wsdd_listen()

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

Listen on a port for inbound WS-Discovery messages, also cleans up memory with soap_destroy and soap_end.

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.

## ◆ soap_wsdd_Probe()

SOAP_FMAC1 int SOAP_FMAC2 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.

## ◆ soap_wsdd_ProbeMatches()

SOAP_FMAC1 int SOAP_FMAC2 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.

## ◆ soap_wsdd_reset_AppSequence()

void soap_wsdd_reset_AppSequence | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_Resolve()

SOAP_FMAC1 int SOAP_FMAC2 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.

## ◆ soap_wsdd_ResolveMatches()

SOAP_FMAC1 int SOAP_FMAC2 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.

## ◆ soap_wsdd_serve___wsdd__Bye()

int soap_wsdd_serve___wsdd__Bye | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_serve___wsdd__Hello()

int soap_wsdd_serve___wsdd__Hello | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_serve___wsdd__Probe()

int soap_wsdd_serve___wsdd__Probe | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_serve___wsdd__ProbeMatches()

int soap_wsdd_serve___wsdd__ProbeMatches | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_serve___wsdd__Resolve()

int soap_wsdd_serve___wsdd__Resolve | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_serve___wsdd__ResolveMatches()

int soap_wsdd_serve___wsdd__ResolveMatches | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_serve_request()

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

## ◆ soap_wsdd_set_AppSequence()

void soap_wsdd_set_AppSequence | ( | struct soap * | soap | ) |

static

## ◆ soap_wsdd_set_InstanceId()

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

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

Parameters

  [in] | InstanceId |

## ◆ soap_wsdd_set_SequenceId()

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

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

Parameters

  [in] | SequenceId |

## Variable Documentation

## ◆ soap_wsdd_InstanceId

unsigned int soap_wsdd_InstanceId = 0

static

## ◆ soap_wsdd_MessageNumber

unsigned int soap_wsdd_MessageNumber = 1

static

## ◆ soap_wsdd_SequenceId

const char* soap_wsdd_SequenceId = NULL

static

## ◆ soap_wsdd_state

MUTEX_TYPE soap_wsdd_state = MUTEX_INITIALIZER

static

## ◆ to_ts_URL

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