这篇教程C++ soap_strdup函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中soap_strdup函数的典型用法代码示例。如果您正苦于以下问题:C++ soap_strdup函数的具体用法?C++ soap_strdup怎么用?C++ soap_strdup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了soap_strdup函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ns__poller_data_read_queueintns__poller_data_read_queue(soap* soap, int sessionID, int count, struct RadarDataInfoArray* result){ DarxendClient* client = client_manager_get_client(sessionID); if (!client) return die_bad_client(soap); RadarDataInfo* infos = darxend_client_read_queue(client, count); if (infos) { result->__size = count; result->array = (RadarDataInfo*)soap_malloc(soap, sizeof(RadarDataInfo) * count); int i; for (i = 0; i < count; i++) { result->array[i] = infos[i]; result->array[i].site = soap_strdup(soap, result->array[i].site); result->array[i].product = soap_strdup(soap, result->array[i].product); free(infos[i].site); free(infos[i].product); } free(infos); } else { result->__size = -1; } return SOAP_OK;}
开发者ID:darxen,项目名称:Darxen,代码行数:30,
示例2: bes_InvalidActivityFaultDOMstruct soap_dom_element*bes_InvalidActivityFaultDOM(struct soap *s, const char *faultstring, const char *message){ struct soap_dom_element *fault, *besdetail, *messageElt; fault = createBESFaultElement(s, "InvalidActivityIdentifierFault", faultstring, &besdetail); if (fault == NULL) { return NULL; } messageElt = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element)); if (messageElt == NULL) { return NULL; } memset(messageElt, 0, sizeof(struct soap_dom_element)); messageElt->name = soap_strdup(s, "Message"); messageElt->nstr = soap_strdup(s, BES_NS); messageElt->data = soap_strdup(s, message); messageElt->prnt = besdetail; messageElt->soap = s; besdetail->elts = messageElt; return fault;}
开发者ID:saga-project,项目名称:saga-cpp-adaptor-bes,代码行数:26,
示例3: soap_default_xsd__anyTypesoap_dom_element::soap_dom_element(struct soap *soap, const char *nstr, const char *name, void *node, int type){ soap_default_xsd__anyType(soap, this); this->nstr = soap_strdup(soap, nstr); this->name = soap_strdup(soap, name); this->node = node; this->type = type;}
开发者ID:BioinformaticsArchive,项目名称:GEMBASSY,代码行数:7,
示例4: allocate_faultstatic struct SOAP_ENV__Fault*allocate_fault(struct soap *s, const char *faultcode, const char *faultstring){ struct SOAP_ENV__Fault *fault; /* require a faultcode */ if (faultcode == NULL) { return NULL; } fault = (struct SOAP_ENV__Fault*)soap_malloc(s, sizeof(struct SOAP_ENV__Fault)); if (fault == NULL) { return NULL; } soap_default_SOAP_ENV__Fault(s, fault); fault->faultcode = soap_strdup(s, faultcode); if (faultstring) { fault->faultstring = soap_strdup(s, faultstring); } fault->detail = (struct SOAP_ENV__Detail*)soap_malloc(s, sizeof(struct SOAP_ENV__Detail)); if (fault->detail) { soap_default_SOAP_ENV__Detail(s, fault->detail); } return fault;}
开发者ID:saga-project,项目名称:saga-cpp-adaptor-bes,代码行数:32,
示例5: http_da_session_startstatic void http_da_session_start(const char *realm, const char *nonce, const char *opaque){ struct http_da_session *session; time_t now = time(NULL); if (now % 10 == 0) /* don't do this all the time to improve efficiency */ http_da_session_cleanup();#ifdef SOAP_DEBUG fprintf(stderr, "Starting session realm=%s nonce=%s/n", realm, nonce);#endif MUTEX_LOCK(http_da_session_lock); session = (struct http_da_session*)malloc(sizeof(struct http_da_session)); if (session) { session->next = http_da_session; session->modified = now; session->realm = soap_strdup(NULL, realm); session->nonce = soap_strdup(NULL, nonce); session->opaque = soap_strdup(NULL, opaque); session->nc = 0; http_da_session = session; } MUTEX_UNLOCK(http_da_session_lock);}
开发者ID:bmanojlovic,项目名称:bforce8583,代码行数:28,
示例6: soap_strdupsoap_dom_attribute::soap_dom_attribute(struct soap *soap, const char *nstr, const char *name, const char *data){ this->soap = soap; this->next = NULL; this->nstr = soap_strdup(soap, nstr); this->name = soap_strdup(soap, name); this->data = soap_strdup(soap, data); this->wide = NULL;}
开发者ID:BioinformaticsArchive,项目名称:GEMBASSY,代码行数:8,
示例7: ONVIF_FAULTGMI_RESULT ONVIF_FAULT(struct soap *soap_ptr, const char *Object, const char *Value1, const char *Value2, const char *Reason){ //fault code soap_ptr->fault = (struct SOAP_ENV__Fault*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Fault))); soap_ptr->fault->SOAP_ENV__Code = (struct SOAP_ENV__Code*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Code))); if (NULL == soap_ptr->fault->SOAP_ENV__Code) { return GMI_OUT_OF_MEMORY; } soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Value = soap_strdup(soap_ptr, Object); //fault subcode soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = (struct SOAP_ENV__Code*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Code))); if (NULL == soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode) { return GMI_OUT_OF_MEMORY; } soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value = soap_strdup(soap_ptr, Value1); //fault subcode subcode if (NULL != Value2) { soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode = (struct SOAP_ENV__Code*)soap_malloc_zero(soap_ptr, (sizeof(struct SOAP_ENV__Code))); if (NULL == soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode) { return GMI_OUT_OF_MEMORY; } soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Value = soap_strdup(soap_ptr, Value2); soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Subcode = NULL; } else { soap_ptr->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode = NULL; } soap_ptr->fault->faultcode = NULL; soap_ptr->fault->faultstring = NULL; soap_ptr->fault->faultactor = NULL; soap_ptr->fault->detail = NULL; //fault reason if (NULL != Reason) { soap_ptr->fault->SOAP_ENV__Reason = (struct SOAP_ENV__Reason *)soap_malloc_zero(soap_ptr, sizeof(struct SOAP_ENV__Reason)); if (NULL == soap_ptr->fault->SOAP_ENV__Reason) { return GMI_OUT_OF_MEMORY; } soap_ptr->fault->SOAP_ENV__Reason->SOAP_ENV__Text = soap_strdup(soap_ptr, Reason); } else { soap_ptr->fault->SOAP_ENV__Reason = NULL; } soap_ptr->fault->SOAP_ENV__Node = NULL; soap_ptr->fault->SOAP_ENV__Role = NULL; soap_ptr->fault->SOAP_ENV__Detail = NULL; return GMI_SUCCESS;}
开发者ID:JammyWei,项目名称:ver30,代码行数:57,
示例8: DBGstatic void *dime_write_open(struct soap *soap, const char *id, const char *type, const char *options){ DBG("/n"); // we can return NULL without setting soap->error if we don't want to use the streaming callback for this DIME attachment struct dime_write_handle *handle = (struct dime_write_handle*)soap_malloc(soap, sizeof(struct dime_write_handle)); if (!handle) { soap->error = SOAP_EOM; return NULL; }#if 0 char *name = tempnam(TMPDIR, "data"); fprintf(stderr, "Saving file %s/n", name); handle->name = soap_strdup(soap, name); free(name);#else time_t t = time(NULL); struct tm tm = *localtime(&t); char name[64]; memset(name, '/0', sizeof(name)); switch(bkev){ case EVENT_SET_FILENAME_CONFIG: sprintf(name, "configuration-%d-%d-%d-%d-%d-%d.conf", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); break; case EVENT_SET_FILENAME_FIRMWARE: sprintf(name, "firmware-%d-%d-%d-%d-%d-%d.ctfw", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); break; default: sprintf(name, "%d-%d-%d-%d-%d-%d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); break; } DBG("tmpname: %s/n", name); handle->name = soap_strdup(soap, name);#endif handle->fd = fopen(handle->name, "wb"); if (!handle->fd) { soap->error = SOAP_EOF; // could not open file for writing soap->errnum = errno; // get reason return NULL; } return (void*)handle;}
开发者ID:eslinux,项目名称:Windows,代码行数:57,
示例9: soap_wsse_add_Security_actor/**@fn _wsse__Security* soap_wsse_add_Security_actor(struct soap *soap, const char *actor)@brief Adds Security header element with actor or role attribute.@param soap context@param actor string@return _wsse__Security object*/struct _wsse__Security*soap_wsse_add_Security_actor(struct soap *soap, const char *actor){ _wsse__Security *security = soap_wsse_add_Security(soap); DBGFUN1("soap_wsse_add_Security_actor", "actor=%s", actor); if (soap->namespaces && !strcmp(soap->namespaces[0].ns, "http://schemas.xmlsoap.org/soap/envelope/")) security->SOAP_ENV__actor = soap_strdup(soap, actor); else security->SOAP_ENV__role = soap_strdup(soap, actor); return security;}
开发者ID:latelee,项目名称:onvif_fw_stl,代码行数:17,
示例10: my_soap_copy_faultstatic int my_soap_copy_fault(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) { char *r = NULL, *s = NULL, *t = NULL; if (faultsubcodeQName) r = soap_strdup(soap, faultsubcodeQName); if (faultstring) s = soap_strdup(soap, faultstring); if (faultdetailXML) t = soap_strdup(soap, faultdetailXML); return my_soap_set_error(soap, faultcode, r, s, t, SOAP_FAULT);}
开发者ID:johnnywww,项目名称:nvtonvifserverc,代码行数:12,
示例11: soap_strdupsoap_dom_element::soap_dom_element(struct soap *soap, const char *nstr, const char *name, const char *data){ this->soap = soap; this->next = NULL; this->prnt = NULL; this->nstr = soap_strdup(soap, nstr); this->name = soap_strdup(soap, name); this->data = soap_strdup(soap, data); this->wide = NULL; this->atts = NULL; this->elts = NULL; this->node = NULL; this->type = 0;}
开发者ID:hackshields,项目名称:antivirus,代码行数:13,
示例12: jp2s_errorstatic struct jptype__genericFault* jp2s_error(struct soap *soap, const glite_jp_error_t *err){ struct jptype__genericFault *ret = NULL; if (err) { ret = soap_malloc(soap,sizeof *ret); memset(ret,0,sizeof *ret); ret->code = err->code; ret->source = soap_strdup(soap,err->source); ret->text = soap_strdup(soap,strerror(err->code)); ret->description = err->desc ? soap_strdup(soap,err->desc) : NULL; ret->reason = jp2s_error(soap,err->reason); } return ret;}
开发者ID:CESNET,项目名称:glite-jp,代码行数:14,
示例13: createBESFaultElementstatic struct soap_dom_element*createBESFaultElement(struct soap *s, const char *bescode, const char *faultstring, struct soap_dom_element **besdetailpp){ struct soap_dom_element *fault, *faultcode, *faultstr; struct soap_dom_element *detail, *besdetail; if (!s || !bescode || !faultstring || !besdetailpp) { return NULL; } fault = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element)); faultcode = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element)); faultstr = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element)); detail = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element)); besdetail = (struct soap_dom_element*)soap_malloc(s, sizeof(struct soap_dom_element)); if (!fault || !faultcode || !faultstr || !detail || !besdetail) { return NULL; } memset(fault, 0, sizeof(struct soap_dom_element)); memset(faultcode, 0, sizeof(struct soap_dom_element)); memset(faultstr, 0, sizeof(struct soap_dom_element)); memset(detail, 0, sizeof(struct soap_dom_element)); memset(besdetail, 0, sizeof(struct soap_dom_element)); faultcode->name = soap_strdup(s, "faultcode"); faultcode->data = (char*)soap_malloc(s, strlen("bes:") + strlen(bescode) + 1); sprintf(faultcode->data, "bes:%s", bescode); faultcode->prnt = fault; faultcode->next = faultstr; faultcode->soap = s; faultstr->name = soap_strdup(s, "faultstring"); faultstr->data = soap_strdup(s, faultstring); faultstr->prnt = fault; faultstr->next = detail; faultstr->soap = s; detail->name = soap_strdup(s, "detail"); detail->elts = besdetail; detail->prnt = fault; detail->soap = s; besdetail->name = soap_strdup(s, bescode); besdetail->nstr = soap_strdup(s, BES_NS); besdetail->prnt = detail; besdetail->soap = s; fault->nstr = soap_strdup(s, BES_NS); fault->name = soap_strdup(s, "Fault"); fault->elts = faultcode; fault->soap = s; *besdetailpp = besdetail; return fault;}
开发者ID:saga-project,项目名称:saga-cpp-adaptor-bes,代码行数:58,
示例14: ns1__executeCommand/*Code used for generating stubs:int ns1__executeCommand(char* command, char** result);*/int ns1__executeCommand(soap* soap, char* command, char** result){ // security check if (!soap->userid || !soap->passwd) { DEBUG_LOG("MaNGOSsoap: Client didn't provide login information"); return 401; } uint32 accountId = sAccountMgr.GetId(soap->userid); if(!accountId) { DEBUG_LOG("MaNGOSsoap: Client used invalid username '%s'", soap->userid); return 401; } if(!sAccountMgr.CheckPassword(accountId, soap->passwd)) { DEBUG_LOG("MaNGOSsoap: invalid password for account '%s'", soap->userid); return 401; } if(sAccountMgr.GetSecurity(accountId) < SECURITY_ADMINISTRATOR) { DEBUG_LOG("MaNGOSsoap: %s's gmlevel is too low", soap->userid); return 403; } if(!command || !*command) return soap_sender_fault(soap, "Command mustn't be empty", "The supplied command was an empty string"); DEBUG_LOG("MaNGOSsoap: got command '%s'", command); SOAPCommand connection; // commands are executed in the world thread. We have to wait for them to be completed { // CliCommandHolder will be deleted from world, accessing after queueing is NOT save CliCommandHolder* cmd = new CliCommandHolder(accountId, SECURITY_CONSOLE, &connection, command, &SOAPCommand::print, &SOAPCommand::commandFinished); sWorld.QueueCliCommand(cmd); } // wait for callback to complete command int acc = connection.pendingCommands.acquire(); if(acc) { sLog.outError("MaNGOSsoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno); } // alright, command finished char* printBuffer = soap_strdup(soap, connection.m_printBuffer.c_str()); if(connection.hasCommandSucceeded()) { *result = printBuffer; return SOAP_OK; } else return soap_sender_fault(soap, printBuffer, printBuffer);}
开发者ID:Nedj,项目名称:Mysteria4,代码行数:65,
示例15: bes_UnsupportedFaultstruct SOAP_ENV__Fault*bes_UnsupportedFault(struct soap* s, const char *faultstring, const char *element){ struct SOAP_ENV__Fault *fault; fault = allocate_fault(s, BES_FAULT_UNSUPPORTED, faultstring); if (fault == NULL) { return NULL; } if (fault->detail) { fault->detail->bes__UnsupportedFeatureFault = (struct bes__UnsupportedFeatureFaultType*)soap_malloc(s, sizeof(struct bes__UnsupportedFeatureFaultType)); if (fault->detail->bes__UnsupportedFeatureFault) { memset(fault->detail->bes__UnsupportedFeatureFault, 0, sizeof(struct bes__UnsupportedFeatureFaultType)); } fault->detail->bes__UnsupportedFeatureFault->Feature = (char**)soap_malloc(s, sizeof(char*)); if (!fault->detail->bes__UnsupportedFeatureFault->Feature) { return NULL; } *fault->detail->bes__UnsupportedFeatureFault->Feature = soap_strdup(s, element?element:""); if (!*fault->detail->bes__UnsupportedFeatureFault->Feature) { return NULL; } fault->detail->bes__UnsupportedFeatureFault->__sizeFeature = 1; } return fault;}
开发者ID:saga-project,项目名称:saga-cpp-adaptor-bes,代码行数:33,
示例16: soap_mallocvoid *mime_server_write_open(struct soap *soap, void *unused_handle, const char *id, const char *type, const char *description, enum soap_mime_encoding encoding) { /* Note: the 'unused_handle' is always NULL */ /* Return NULL without setting soap->error if we don't want to use the streaming callback for this DIME attachment */ const char *file; struct mime_server_handle *handle = soap_malloc(soap, sizeof(struct mime_server_handle)); if (!handle) { soap->error = SOAP_EOM; return NULL; } /* Create a new file */ file = tempnam(TMPDIR, "data"); /* The file name is also the key */ handle->key = soap_strdup(soap, file); handle->fd = fopen(file, "wb"); free((void*) file); if (!handle->fd) { soap->error = soap_sender_fault(soap, "Cannot save data to file", handle->key); soap->errnum = errno; /* get reason */ return NULL; } fprintf(stderr, "Saving file %s type %s/n", handle->key, type ? type : ""); return (void*) handle;}
开发者ID:awesomeleo,项目名称:onvif-ipcam,代码行数:27,
示例17: bes_InvalidRequestFaultstruct SOAP_ENV__Fault*bes_InvalidRequestFault(struct soap* s, const char *faultstring, const char *element){ struct SOAP_ENV__Fault *fault; fault = allocate_fault(s, BES_FAULT_INVALID_REQUEST, faultstring); if (fault == NULL) { return NULL; } if (fault->detail) { fault->detail->bes__InvalidRequestMessageFault = (struct bes__InvalidRequestMessageFaultType*)soap_malloc(s, sizeof(struct bes__InvalidRequestMessageFaultType)); if (fault->detail->bes__InvalidRequestMessageFault) { memset(fault->detail->bes__InvalidRequestMessageFault, 0, sizeof(struct bes__InvalidRequestMessageFaultType)); fault->detail->bes__InvalidRequestMessageFault->InvalidElement = (char**)soap_malloc(s, sizeof(char*)); if (!fault->detail->bes__InvalidRequestMessageFault->InvalidElement) { return NULL; } *fault->detail->bes__InvalidRequestMessageFault->InvalidElement = soap_strdup(s, element?element:""); if (!*fault->detail->bes__InvalidRequestMessageFault->InvalidElement) { return NULL; } fault->detail->bes__InvalidRequestMessageFault->__sizeInvalidElement = 1; } } return fault;}
开发者ID:saga-project,项目名称:saga-cpp-adaptor-bes,代码行数:33,
示例18: MyFeedRefreshint MyFeedRefresh(struct soap *soap, glite_jpis_context_t ctx, long int uniqueid, const char *dest, int status, const char *feedid){ struct _jpelem__FeedIndexRefresh in; struct _jpelem__FeedIndexRefreshResponse out; lprintf("(%ld) for %s called, status = %d/n", uniqueid, feedid, status); if (refresh_gsoap(ctx, soap) != 0) return glite_jpis_stack_error(ctx->jpctx, EINVAL, "can't refresh credentials"); soap_begin(soap); memset(&in, 0, sizeof(in)); in.feedId = soap_strdup(soap, feedid); if (check_fault(soap,soap_call___jpsrv__FeedIndexRefresh(soap,dest,"", &in, &out)) != 0) { fprintf(stderr, "/n"); glite_jpis_unlockFeed(ctx, uniqueid); glite_jpis_stack_error(ctx->jpctx, EIO, "soap_call___jpsrv__FeedRefresh() returned error %d", soap->error); soap_end(soap); return EIO; } else { status &= (~GLITE_JP_IS_STATE_ERROR); lprintf("(%ld) FeedId: %s/n", uniqueid, feedid); lprintf("(%ld) Expires: %s", uniqueid, ctime(&out.feedExpires)); glite_jpis_initFeed(ctx, uniqueid, feedid, time(NULL) + (out.feedExpires - time(NULL)) / 2, status); glite_jpis_unlockFeed(ctx, uniqueid); } soap_end(soap); return 0;}
开发者ID:CESNET,项目名称:glite-jp,代码行数:31,
示例19: glite_delegation_destroyint glite_delegation_destroy(glite_delegation_ctx *ctx, const char *delegationID){ char *sdelegationID = ""; struct delegation__destroyResponse dest_resp; if(!ctx) return -1; /* error is already set */ if (!ctx->soap) return -1; if (delegationID) { sdelegationID = soap_strdup(ctx->soap, delegationID); if (!sdelegationID) { glite_delegation_set_error(ctx, "glite_delegation_destroy: soap_strdup()" " of delegationID failed!"); return -1; } } if (SOAP_OK != soap_call_delegation__destroy(ctx->soap, ctx->endpoint, NULL, sdelegationID, &dest_resp)) { _fault_to_error(ctx, __func__); return -1; } return 0;}
开发者ID:ic-hep,项目名称:emi3,代码行数:32,
示例20: zkcfg__getAllKeysint zkcfg__getAllKeys(struct soap *soap, void *notused, struct zkcfg__Keys *keys){ struct dbhlpColumn desc[1] = { { { 0 }, DBT_STRING }, }; sqlite3 *db = db_get(); struct dbhlpColumn **all = 0; int rows = 0, i; db_exec_select2(db, "SELECT key FROM config", desc, 1, &all, &rows); if (rows > 0) { keys->__ptr = (char**)soap_malloc(soap, rows * sizeof(char*)); keys->__size = rows; for (i = 0; i < rows; i++) { keys->__ptr[i] = soap_strdup(soap, all[i][0].data.s); } } else { keys->__ptr = 0; keys->__size = 0; } db_free_select2(desc, 1, all, rows); db_release(db); return SOAP_OK;}
开发者ID:sunkwei,项目名称:sysmgrt,代码行数:28,
示例21: zkcfg__getValueint zkcfg__getValue(struct soap *soap, char *key, struct zkcfg__Ret *res){ struct dbhlpColumn desc[1] = { {{ 0 }, DBT_STRING }, }; sqlite3 *db = db_get(); struct dbhlpColumn **all = 0; int rows = 0, i, rc; char *sql = (char*)alloca(1024); snprintf(sql, 1024, "SELECT value FROM config WHERE key='%s'", key); rc = db_exec_select2(db, sql, desc, 1, &all, &rows); if (rc >= 0) { if (rows == 0) { res->value = 0; res->result = -1; } else { res->value = soap_strdup(soap, all[0][0].data.s); res->result = 0; } db_free_select2(desc, 1, all, rows); } db_release(db); return SOAP_OK;}
开发者ID:sunkwei,项目名称:sysmgrt,代码行数:29,
示例22: bes_InvalidActivityFaultstruct SOAP_ENV__Fault*bes_InvalidActivityFault(struct soap* s, const char *faultstring, const char *message){ struct SOAP_ENV__Fault *fault; fault = allocate_fault(s, BES_FAULT_INVALID_ACTIVITY, faultstring); if (fault == NULL) { return NULL; } if (fault->detail) { fault->detail->bes__InvalidActivityIdentifierFault = (struct bes__InvalidActivityIdentifierFaultType*)soap_malloc( s, sizeof(struct bes__InvalidActivityIdentifierFaultType)); if (fault->detail->bes__InvalidActivityIdentifierFault) { memset(fault->detail->bes__InvalidActivityIdentifierFault, 0, sizeof(struct bes__InvalidActivityIdentifierFaultType)); fault->detail->bes__InvalidActivityIdentifierFault->Message = soap_strdup(s, message?message:""); if (!fault->detail->bes__InvalidActivityIdentifierFault->Message) { return NULL; } } } return fault;}
开发者ID:saga-project,项目名称:saga-cpp-adaptor-bes,代码行数:29,
示例23: glite_delegation_infoint glite_delegation_info(glite_delegation_ctx *ctx, const char *delegationID, time_t *expiration){ char *sdelegationID = ""; struct delegation__getTerminationTimeResponse resp; if(!ctx) return -1; /* error is already set */ if (!ctx->soap) return -1; if (delegationID) { sdelegationID = soap_strdup(ctx->soap, delegationID); if (!sdelegationID) { glite_delegation_set_error(ctx, "glite_delegation_info: soap_strdup()" " of delegationID failed!"); return -1; } } if (SOAP_OK != soap_call_delegation__getTerminationTime(ctx->soap, ctx->endpoint, NULL, sdelegationID, &resp)) { _fault_to_error(ctx, __func__); return -1; } *expiration = resp._getTerminationTimeReturn; return 0;}
开发者ID:ic-hep,项目名称:emi3,代码行数:35,
示例24: ns__echoStringint ns__echoString(struct soap *soap, char *str, char **res){ /* Get Header info and setup response Header */ if (check_header(soap)) { printf("Malformed header/n"); return SOAP_FAULT; /* there was a problem */ } /* If message with MessageID already received, ignore it */ if (check_received(soap->header->wsa__MessageID)) { printf("Request message %s already received/n", soap->header->wsa__MessageID); return SOAP_STOP; } printf("Request message %s accepted/n", soap->header->wsa__MessageID); /* Check ReplyTo has Address */ if (!soap->header->wsa__ReplyTo || !soap->header->wsa__ReplyTo->Address) return soap_sender_fault(soap, "No WS-Addressing ReplyTo address", NULL); /* Copy Header info into response Header */ soap->header->wsa__To = soap->header->wsa__ReplyTo->Address; /* Add info to response Header */ soap->header->wsa__MessageID = soap_strdup(soap, soap_int2s(soap, id_count++)); soap->header->wsa__Action = "http://genivia.com/udp/echoStringResponse"; /* Copy request string into response string */ printf("Response message %s returned/n", soap->header->wsa__MessageID); *res = str; return SOAP_OK;}
开发者ID:119-org,项目名称:TND,代码行数:31,
示例25: addSecurityvoid addSecurity(struct soap* soap) { struct _ns1__CAPHeaderTypeDef* CAPheader; int* CogId; soap_wsse_add_Security(soap); if (soap_wsse_sign_body(soap, SOAP_SMD_SIGN_RSA_SHA256, rsa_private_key, 0)) { printf("Error signing body/n"); exit(EXIT_FAILURE); } if (soap_wsse_add_BinarySecurityTokenX509(soap, "X509Token", cert)) { printf("Error adding security token/n"); exit(EXIT_FAILURE); } if (soap_wsse_add_KeyInfo_SecurityTokenReferenceX509(soap, "X509TokenReference")) { printf("Error adding security token reference/n"); exit(EXIT_FAILURE); } CAPheader = (struct _ns1__CAPHeaderTypeDef*) soap_malloc(soap, sizeof(struct _ns1__CAPHeaderTypeDef)); CogId = (int*) soap_malloc(soap, sizeof(int)); *CogId = 100014; soap_default__ns1__CAPHeaderTypeDef(soap, CAPheader); CAPheader->logonUser = soap_strdup(soap, "dmopentester"); CAPheader->logonCogId = CogId; soap->header->ns1__CAPHeaderTypeDef = CAPheader;}
开发者ID:abidinz,项目名称:Stormee,代码行数:29,
示例26: save_optionsint save_options(const char *file, const char *name, struct option *options){ struct soap soap; soap_init1(&soap, SOAP_XML_TREE); soap.namespaces = NULL; soap.encodingStyle = NULL; if (file) { soap.sendfd = open(file, O_CREAT | O_WRONLY); if (soap.sendfd < 0) { soap_done(&soap); return EOF; } } if (!soap_begin_send(&soap) && !soap_element_begin_out(&soap, name, 0, NULL)) { struct option *p; struct t__Option t; for (p = options; p->name; p++) { t.val = NULL; if (!p->name[0]) { if (!p->value) continue; t.key = NULL; t.val = p->value; } else if (p->name[1] == '.') t.key = (char*)p->name + 2; else t.key = (char*)p->name; if (p->selections && strchr(p->selections, ' ')) { const char *s = p->selections - 1; char *r; int i; for (i = p->selected; i > 0; i--) { s = strchr(s + 1, ' '); if (!s) break; } if (s) { t.val = soap_strdup(&soap, s + 1); r = strchr(t.val, ' '); if (r) *r = '/0'; } } else if (p->value) t.val = p->value; else if (!p->selected) continue; if (soap_out_t__Option(&soap, "option", 0, &t, NULL)) break; } if (!soap_element_end_out(&soap, name)) soap_end_send(&soap); } if (file) close(soap.sendfd); soap_end(&soap); soap_done(&soap); return soap.error;}
开发者ID:xin3liang,项目名称:platform_external_gsoap,代码行数:59,
示例27: ns1__executeCommand/*Code used for generating stubs:int ns1__executeCommand(char* command, char** result);*/int ns1__executeCommand(soap* soap, char* command, char** result){ // security check if (!soap->userid || !soap->passwd) { TC_LOG_INFO("network.soap", "Client didn't provide login information"); return 401; } uint32 accountId = AccountMgr::GetId(soap->userid); if (!accountId) { TC_LOG_INFO("network.soap", "Client used invalid username '%s'", soap->userid); return 401; } if (!AccountMgr::CheckPassword(accountId, soap->passwd)) { TC_LOG_INFO("network.soap", "Invalid password for account '%s'", soap->userid); return 401; } if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR) { TC_LOG_INFO("network.soap", "%s's gmlevel is too low", soap->userid); return 403; } if (!command || !*command) return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string"); TC_LOG_INFO("network.soap", "Received command '%s'", command); SOAPCommand connection; // commands are executed in the world thread. We have to wait for them to be completed { // CliCommandHolder will be deleted from world, accessing after queueing is NOT save CliCommandHolder* cmd = new CliCommandHolder(&connection, command, &SOAPCommand::print, &SOAPCommand::commandFinished); sWorld->QueueCliCommand(cmd); } // wait for callback to complete command int acc = connection.pendingCommands.acquire(); if (acc) TC_LOG_ERROR("network.soap", "Error while acquiring lock, acc = %i, errno = %u", acc, errno); // alright, command finished char* printBuffer = soap_strdup(soap, connection.m_printBuffer.c_str()); if (connection.hasCommandSucceeded()) { *result = printBuffer; return SOAP_OK; } else return soap_sender_fault(soap, printBuffer, printBuffer);}
开发者ID:Caydan,项目名称:WoWSCore548,代码行数:63,
注:本文中的soap_strdup函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ soap_url函数代码示例 C++ soap_set_version函数代码示例 |