本文整理汇总了C++中soap_end函数的典型用法代码示例。如果您正苦于以下问题:C++ soap_end函数的具体用法?C++ soap_end怎么用?C++ soap_end使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了soap_end函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ns__awizoDeleteSender
int ns__awizoDeleteSender(struct soap* soap, long id, long* result)
{
/* ------------------------------ */
long longRet = 0;
long attempt = 0;
queueNode_t* iterator = NULL;
char* host = NULL;
struct soap soap2Eawizo;
/* ------------------------------ */
attempt = MAX_ATTEMPT;
soap_init2(&soap2Eawizo,SOAP_C_UTFSTRING,SOAP_C_UTFSTRING);
iterator = (_GLOBAL_awizoConfig.bmdservers).head;
for(;;){
asprintf(&host, "http://%s:%s",((bmdserver_t*)(iterator->node))->addr,((bmdserver_t*)(iterator->node))->port);
longRet = soap_call_ns__awizoDeleteSender(&soap2Eawizo,host,NULL,id,result);
free0(host);
if (longRet == SOAP_OK) {
PRINT_INFO("Usunięto wystawcę o ID=%ld\n",id);
return SOAP_OK;
}
else {
if (iterator->prev){
iterator=iterator->prev;
continue;
}
else if (--attempt <= 0){
PRINT_ERROR("Nie udało się nawiązać połączenia z żadnym z serwerów e-Awiz. Error = %d\n", BMD_ERR_OP_FAILED);
//soap_end(&soap2Eawizo);
//soap_done(&soap2Eawizo);
//return soap_receiver_fault(soap, "Nie udało się nawiązać połączenia z żadnym z serwerów e-Awiz.", NULL);
attempt = MAX_ATTEMPT;
}
iterator = (_GLOBAL_awizoConfig.bmdservers).head;
sleep(1);
}
}
soap_end(&soap2Eawizo);
soap_done(&soap2Eawizo);
return SOAP_OK;
}
示例2: pthread_detach
void *process_request(void *soap) {
pthread_detach(pthread_self());
soap_serve((struct soap*)soap);
soap_destroy((struct soap*)soap);
soap_end((struct soap*)soap);
soap_done((struct soap*)soap);
free(soap);
return NULL;
}
示例3: if
int calcService::run(int port)
{ if (soap_valid_socket(this->master) || soap_valid_socket(bind(NULL, port, 100)))
{ for (;;)
{ if (!soap_valid_socket(accept()) || serve())
break;
soap_destroy(this);
soap_end(this);
}
}
return this->error;
}
示例4: simpleGsoap20
inline void simpleGsoap20()
{
struct soap *soap = soap_new();
soap_init(soap);
soap_set_omode(soap, SOAP_XML_GRAPH);
soap_imode(soap, SOAP_XML_GRAPH);
soap_begin(soap);
_ns1__simpleGsoap20 input, output;
input.soap = soap;
input.att1 = 1;
input.att2 = 2;
input.att3 = 3;
input.att4 = 4;
input.att5 = 5;
input.att6 = 6;
input.att7 = 7;
input.att8 = 8;
input.att9 = 9;
input.att10 = 10;
input.att11 = 11;
input.att12 = 12;
input.att13 = 13;
input.att14 = 14;
input.att15 = 15;
input.att16 = 16;
input.att17 = 17;
input.att18 = 18;
input.att19 = 19;
input.att20 = 20;
boost::asio::streambuf streambuf;
std::ostream *ost = new std::ostream(&streambuf);
std::istream *ist = new std::istream(&streambuf);
input.soap->os = ost;
input.soap->is = ist;
boost::timer::auto_cpu_timer t;
for(int i=0; i < NUMBER_OF_LOOPS; ++i){
soap_write__ns1__simpleGsoap20(soap, &input);
//streambuf.pubseekpos(0);
//ost->rdbuf(&streambuf);
//std::cout << "Str: " << streambuf.size() << endl;
//break;
soap_read__ns1__simpleGsoap20(soap, &output);
}
soap_destroy(soap);
soap_end(soap);
soap_done(soap);
}
示例5: if
int PullPointSubscriptionBindingService::run(int port)
{ if (soap_valid_socket(this->soap->master) || soap_valid_socket(bind(NULL, port, 100)))
{ for (;;)
{ if (!soap_valid_socket(accept()) || serve())
break;
soap_destroy(this->soap);
soap_end(this->soap);
}
}
return this->soap->error;
}
开发者ID:hummatli,项目名称:onvif-qt-server-client,代码行数:11,代码来源:onvifeventPullPointSubscriptionBindingService.cpp
示例6: soap_begin
int dpws_discoveryService::serve()
{
#ifndef WITH_FASTCGI
unsigned int k = this->max_keep_alive;
#endif
do
{ soap_begin(this);
#ifdef WITH_FASTCGI
if (FCGI_Accept() < 0)
{
this->error = SOAP_EOF;
return soap_send_fault(this);
}
#endif
soap_begin(this);
#ifndef WITH_FASTCGI
if (this->max_keep_alive > 0 && !--k)
this->keep_alive = 0;
#endif
if (soap_begin_recv(this))
{ if (this->error < SOAP_STOP)
{
#ifdef WITH_FASTCGI
soap_send_fault(this);
#else
return soap_send_fault(this);
#endif
}
soap_closesock(this);
continue;
}
if (soap_envelope_begin_in(this)
|| soap_recv_header(this)
|| soap_body_begin_in(this)
|| dispatch() || (this->fserveloop && this->fserveloop(this)))
{
#ifdef WITH_FASTCGI
soap_send_fault(this);
#else
return soap_send_fault(this);
#endif
}
#ifdef WITH_FASTCGI
soap_destroy(this);
soap_end(this);
} while (1);
#else
} while (this->keep_alive);
示例7: soap_destroy
void SoapHandler::CleanSoapEnv()
{
if ( m_SoapEnv )
{
soap_destroy(m_SoapEnv); // dealloc C++ data
soap_end(m_SoapEnv); // dealloc data and clean up
soap_done(m_SoapEnv); // detach soap struct
free(m_SoapEnv);
m_SoapEnv = NULL;
}
}
示例8: run_serve
int run_serve(int port)
{
struct soap *soap = soap_new1(SOAP_XML_INDENT);
int ret;
if (soap_register_plugin(soap, http_da))
exit(1);
if (!soap_valid_socket(soap_bind(soap, NULL, port, 100)))
soap_print_fault(soap, stderr);
else
{
fprintf(stderr, "Bind to port %d successful\n", port);
soap->accept_timeout = 3600; /* let server time out after one hour */
for (;;)
{
SOAP_SOCKET sock = soap_accept(soap);
if (!soap_valid_socket(sock))
{
if (soap->errnum)
soap_print_fault(soap, stderr);
else
{
fprintf(stderr, "Server timed out\n");
break;
}
}
fprintf(stderr, "Accepting socket %d connection from IP %d.%d.%d.%d\n", sock, (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
if (soap_serve(soap))
soap_print_fault(soap, stderr);
fprintf(stderr, "Served\n\n");
soap_destroy(soap);
soap_end(soap);
}
}
ret = soap->error;
soap_destroy(soap);
soap_end(soap);
soap_free(soap);
return ret;
}
示例9: rmc_unregister_alias
rmc_unregister_alias (const char *guid, const char *lfn, char *errbuf, int errbufsz)
{
struct rmc__removeAliasResponse out;
int ret;
struct soap soap;
if (rmc_init (&soap, errbuf, errbufsz) < 0)
return (-1);
if ((ret = soap_call_rmc__removeAlias (&soap, rmc_endpoint, "",
(char *) guid, (char *) lfn, &out))) {
gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
soap_end (&soap);
soap_done (&soap);
errno = ECOMM;
return (-1);
}
soap_end (&soap);
soap_done (&soap);
return (0);
}
示例10: soap_destroy
dli::DataLocationInterfaceSOAP::~DataLocationInterfaceSOAP()
{
// Finalise SOAP
//
soap_destroy(&m_soap);
soap_end(&m_soap);
soap_done(&m_soap);
if (m_ctx) {
glite_gsplugin_free_context(m_ctx);
}
} // destructor
示例11: VERB_LOG
// WS_QUERY_BY_KEY (CLIENT SIDE)
void audioDB::ws_query_by_key(const char*dbName, const char *trackKey, const char* featureFileName, const char* hostport){
struct soap soap;
adb__queryResponse adbQueryResponse;
/* JUST TRY TO USE A DATA STRUCTURE WITH PHP
adb__sequenceQueryParms asqp;
asqp.keyList = (char*)trackFileName;
asqp.timesFileName = (char*)timesFileName;
asqp.queryPoint = queryPoint;
asqp.pointNN = pointNN;
asqp.trackNN = trackNN;
asqp.sequenceLength = sequenceLength;
asqp.radius = radius;
asqp.relative_threshold = relative_threshold;
asqp.absolute_threshold = absolute_threshold;
asqp.usingQueryPoint = usingQueryPoint;
asqp.lsh_exact = lsh_exact;
*/
VERB_LOG(1, "Calling %s query on database %s with %s=%s\n", (trackKey&&strlen(trackKey))?"KEY":"FILENAME", dbName, (trackKey&&strlen(trackKey))?"KEY":"FILENAME",(trackKey&&strlen(trackKey))?trackKey:featureFileName);
soap_init(&soap);
if(queryType==O2_SEQUENCE_QUERY || queryType==O2_N_SEQUENCE_QUERY){
if(soap_call_adb__sequenceQueryByKey(&soap,hostport,NULL,
(char*)dbName,
(char*)trackKey,
(char*)featureFileName,
queryType,
(char*)trackFileName, // this means keyFileName
(char*)timesFileName,
queryPoint,
pointNN,
trackNN,
sequenceLength,
radius,
absolute_threshold,
usingQueryPoint,
lsh_exact,
no_unit_norming,
adbQueryResponse)==SOAP_OK){
//std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl;
for(int i=0; i<adbQueryResponse.result.__sizeRlist; i++)
std::cout << adbQueryResponse.result.Rlist[i] << " " << adbQueryResponse.result.Dist[i]
<< " " << adbQueryResponse.result.Qpos[i] << " " << adbQueryResponse.result.Spos[i] << std::endl;
} else {
char fault[MAXSTR];
soap_sprint_fault(&soap, fault, MAXSTR);
error(fault);
}
} else
;// FIX ME: WRITE NON-SEQUENCE QUERY BY KEY ?
soap_destroy(&soap);
soap_end(&soap);
soap_done(&soap);
}
示例12: main
int main(int argc, char **argv)
{ struct soap *soap = soap_new();
const char *endpoint;
matrix a(soap, 3); // matrix with 3 rows created in current soap env.
// set up matrix by specifying non-zero elements only (this is optional)
a[1].resize(1,2); // 2-element vector indexed from 1 to 2
a[1][1] = 2;
a[1][2] = 1;
a[2].resize(1,3); // 3-element vector
a[2][1] = 1;
a[2][2] = 2;
a[2][3] = 1;
a[3].resize(2,3); // 2-element vector indexed from 2 to 3
a[3][2] = 1;
a[3][3] = 2;
cout << "* Demonstration example *" << endl;
cout << "Matrix:" << endl;
a.print();
vector b(soap, 3);
b[1] = 1;
b[2] = 2;
b[3] = 3;
cout << "Vector:" << endl;
b.print();
vector x(soap);
if (argc < 2)
endpoint = luserver;
else
endpoint = argv[1];
/* solve ax=b */
if (soap_call_ns1__lusol(soap, endpoint, "", &a, &b, &x))
{ soap_print_fault(soap, stderr);
soap_print_fault_location(soap, stderr);
}
else
{ cout << "Solution vector from service:" << endl;
x.print();
}
matrix a1(soap);
if (soap_call_ns1__luinv(soap, endpoint, "", &a, &a1))
{ soap_print_fault(soap, stderr);
soap_print_fault_location(soap, stderr);
}
else
{ cout << "Inverse matrix matrix from service:" << endl;
a1.print();
}
soap_destroy(soap);
soap_end(soap);
free(soap);
return 0;
}
示例13: main
int main()
{ struct soap soap;
soap_init2(&soap, SOAP_IO_KEEPALIVE, SOAP_IO_KEEPALIVE);
if (soap_send_ns__handle(&soap, event_handler_endpoint, event_handler_action, EVENT_A))
soap_print_fault(&soap, stderr);
if (synchronous && soap_recv_empty_response(&soap))
soap_print_fault(&soap, stderr);
if (soap_send_ns__handle(&soap, event_handler_endpoint, event_handler_action, EVENT_B))
soap_print_fault(&soap, stderr);
if (synchronous && soap_recv_empty_response(&soap))
soap_print_fault(&soap, stderr);
/* reset keep-alive when client needs to inform the server that it will close the connection. It may reconnect later */
soap_clr_omode(&soap, SOAP_IO_KEEPALIVE);
if (soap_send_ns__handle(&soap, event_handler_endpoint, event_handler_action, EVENT_C))
soap_print_fault(&soap, stderr);
if (synchronous && soap_recv_empty_response(&soap))
soap_print_fault(&soap, stderr);
/* close the socket */
soap_closesock(&soap);
/* enable keep-alive which is required to accept and execute multiple receives */
soap_set_omode(&soap, SOAP_IO_KEEPALIVE);
if (soap_send_ns__handle(&soap, event_handler_endpoint, event_handler_action, EVENT_Z))
soap_print_fault(&soap, stderr);
else
{ struct ns__handle response;
for (;;)
{ if (!soap_valid_socket(soap.socket))
{ fprintf(stderr, "Connection was terminated (keep alive disabled?)\n");
break;
}
if (soap_recv_ns__handle(&soap, &response))
{ if (soap.error == SOAP_EOF)
fprintf(stderr, "Connection was gracefully closed by server\n");
else
soap_print_fault(&soap, stderr);
break;
}
else
{ switch (response.event)
{ case EVENT_A: fprintf(stderr, "Client Event: A\n"); break;
case EVENT_B: fprintf(stderr, "Client Event: B\n"); break;
case EVENT_C: fprintf(stderr, "Client Event: C\n"); break;
case EVENT_Z: fprintf(stderr, "Client Event: Z\n"); break;
}
}
}
}
soap_closesock(&soap); /* soap_send operations keep the socket open to possibly accept responses, so we need to explicitly close the socket now */
soap_end(&soap); /* this will close the socket too (if keep alive is off), just in case */
soap_done(&soap); /* detach environment (also closes sockets even with keep-alive) */
return 0;
}
示例14: lrc_guid_exists
lrc_guid_exists (const char *guid, char *errbuf, int errbufsz)
{
struct lrc__guidExistsResponse out;
int ret;
struct soap soap;
if (lrc_init (&soap, errbuf, errbufsz) < 0)
return (-1);
if ((ret = soap_call_lrc__guidExists (&soap, lrc_endpoint, "",
(char *) guid, &out))) {
gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
soap_end (&soap);
soap_done (&soap);
errno = ECOMM;
return (-1);
}
ret = out._guidExistsReturn ? 1 : 0;
soap_end (&soap);
soap_done (&soap);
return (ret);
}
示例15: if
int videooverlayService::run(int port)
{ if (soap_valid_socket(this->master) || soap_valid_socket(bind(NULL, port, 100)))
{ for (;;)
{ if (!soap_valid_socket(accept()) || serve())
return this->error;
soap_destroy(this);
soap_end(this);
}
}
else
return this->error;
return SOAP_OK;
}