Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | Publishing and Delivering Events | Publishing Events | Limits on Publication
 
Limits on Publication
The client group to which the BrokerClient belongs may limit the event types the Broker client may publish. See Client Groups for more information. The following example contains an excerpt from the publish1.c sample application that shows the use of the awCanPublish function to check for event publication permission. The function requires these parameters:
*A BrokerClient handle.
*An event type name.
*A BrokerBoolean where publication permission may be returned.
. . .
BrokerClient c;
BrokerBoolean can_publish;
. . .
err = awCanPublish(c, "Sample::SimpleEvent", &can_publish);
if (err != AW_NO_ERROR) {
printf("Error on check for can publish\n%s\n", awErrorToString(err));
return 0;
}
if (can_subscribe == 0) {
printf("Cannot publish event Sample::SimpleEvent.\n");
printf("Make sure it is loaded in the broker and \n");
printf("permission is given to publish it in the \n");
printf("%s client group.\n", client_group);
return 0;
}
. . .
You can also use the awGetCanPublishNames method to obtain the names of all the event types which a Broker client can publish.