This example shows you how to publish a Web service. In this case, the example template code obtains an authorization token, saves the tModel with the WSDL URL in the server, and saves the business service information in the server.
#include "pubH.h"
const char *server = "https://uddi.xmethods.net/publish";
const char *userid = "...";
const char *passwd = "...";
int main(int argc, char **argv)
{
struct soap *soap = soap_new();
if (soap_ssl_client_context(soap, SOAP_SSL_DEFAULT, NULL, NULL, "cacerts.pem", NULL, NULL))
{
soap_print_fault(soap, stderr);
exit(1);
}
if (!authToken)
{
soap_print_fault(soap, stderr);
exit(1);
}
tModel.soap_default(soap);
tModel.
name = soap_new_uddi2__name(soap, -1);
description[0].
__item =
"SHORT DESCRIPTION: ...";
description[1].
__item =
"SHORT DESCRIPTION: ...";
description[2].
__item =
"USAGE NOTES: ...";
description[3].
__item =
"HOMEPAGE URL: ...";
description[4].
__item =
"CONTACT EMAIL: ...";
description[5].
__item =
"IMPLEMENTATION: ...";
tModel.
overviewDoc = soap_new_uddi2__overviewDoc(soap, -1);
tModel.
categoryBag = soap_new_uddi2__categoryBag(soap, -1);
service.soap_default(soap);
bindingTemplate.soap_default(soap);
bindingTemplate.
accessPoint = soap_new_uddi2__accessPoint(soap, -1);
soap_destroy(soap);
soap_end(soap);
soap_done(soap);
free(soap);
return 0;
}