• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ soap_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中soap_init函数的典型用法代码示例。如果您正苦于以下问题:C++ soap_init函数的具体用法?C++ soap_init怎么用?C++ soap_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了soap_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: soap_init

void TCSoapRunnable::run()
{
    struct soap soap;
    soap_init(&soap);
    soap_set_imode(&soap, SOAP_C_UTFSTRING);
    soap_set_omode(&soap, SOAP_C_UTFSTRING);

    // check every 3 seconds if world ended
    soap.accept_timeout = 3;
    soap.recv_timeout = 5;
    soap.send_timeout = 5;
    if (!soap_valid_socket(soap_bind(&soap, _host.c_str(), _port, 100)))
    {
        TC_LOG_ERROR("network.soap", "Couldn't bind to %s:%d", _host.c_str(), _port);
        exit(-1);
    }

    TC_LOG_INFO("network.soap", "Bound to http://%s:%d", _host.c_str(), _port);

    while (!World::IsStopped())
    {
        if (!soap_valid_socket(soap_accept(&soap)))
            continue;   // ran into an accept timeout

        TC_LOG_DEBUG("network.soap", "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF);
        struct soap* thread_soap = soap_copy(&soap);// make a safe copy

        ACE_Message_Block* mb = new ACE_Message_Block(sizeof(struct soap*));
        ACE_OS::memcpy(mb->wr_ptr(), &thread_soap, sizeof(struct soap*));
        process_message(mb);
    }

    soap_done(&soap);
}
开发者ID:Caydan,项目名称:WoWSCore548,代码行数:34,代码来源:TCSoap.cpp


示例2: main

int main(int argc, char* argv[])
{
	int m, s; /**//* master and slave sockets */
	struct soap sop;
	soap_init(&sop);
	
	if (argc < 2) {
		printf("usage:%s <server_port>\n", argv[0]);
		goto failed;
	}

	m = soap_bind(&sop, NULL, atoi(argv[1]), 100);
	if (m < 0) {
		soap_print_fault(&sop, stderr);
		goto failed;
	}
	fprintf(stderr, "Socket connection successful: master socket = %d\n", m);

	for ( ; ; ) {
		s = soap_accept(&sop);
		if (s < 0) {
			soap_print_fault(&sop, stderr);
			goto failed;
		}
		fprintf(stderr, "Socket connection successful: slave socket = %d\n", s);
		soap_serve(&sop);
		soap_end(&sop);
	}
	return 0;

failed:
	return 1;
}
开发者ID:beback1986,项目名称:MyGitProject,代码行数:33,代码来源:test.cpp


示例3: TCSoapThread

void TCSoapThread(const std::string& host, uint16 port)
{
    struct soap soap;
    soap_init(&soap);
    soap_set_imode(&soap, SOAP_C_UTFSTRING);
    soap_set_omode(&soap, SOAP_C_UTFSTRING);

    // check every 3 seconds if world ended
    soap.accept_timeout = 3;
    soap.recv_timeout = 5;
    soap.send_timeout = 5;
    if (!soap_valid_socket(soap_bind(&soap, host.c_str(), port, 100)))
    {
        TC_LOG_ERROR("network.soap", "Couldn't bind to %s:%d", host.c_str(), port);
        exit(-1);
    }

    TC_LOG_INFO("network.soap", "Bound to http://%s:%d", host.c_str(), port);

    while (!World::IsStopped())
    {
        if (!soap_valid_socket(soap_accept(&soap)))
            continue;   // ran into an accept timeout

        TC_LOG_DEBUG("network.soap", "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF);
        struct soap* thread_soap = soap_copy(&soap);// make a safe copy
        process_message(thread_soap);
    }

    soap_done(&soap);
}
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:31,代码来源:TCSoap.cpp


示例4: init_gsoap

/**
 * gSOAP
 */
static void
init_gsoap (struct soap *p_soap)
{
	/* Initialize gSOAP */
	soap_init (p_soap);
	soap_set_namespaces (p_soap, simias_namespaces);
}
开发者ID:ifolder,项目名称:simias,代码行数:10,代码来源:simiasweb.c


示例5: main

int main(int argc, char**argv)
{ 


   struct soap soap; 
   int m, s;
   size = 0;
   soap_init(&soap); 
   m = soap_bind(&soap, hostname, port, 100); 
   if (m < 0) 
      soap_print_fault(&soap, stderr); 
   else
   { 
     fprintf(stderr, "Socket connection successful: master socket = %d; port = %d\n", m, port); 
      int i;
      for (i = 1; ; i++) 
      {
         s = soap_accept(&soap); 
         if (s < 0) 
         { 
            soap_print_fault(&soap, stderr); 
            break; 
         } 
         fprintf(stderr, "%d: accepted connection from IP=%d.%d.%d.%d socket=%d", i, 
            (soap.ip >> 24)&0xFF, (soap.ip >> 16)&0xFF, (soap.ip >> 8)&0xFF, soap.ip&0xFF, s); 
         if (soap_serve(&soap) != SOAP_OK)
            soap_print_fault(&soap, stderr);
         fprintf(stderr, "request served\n"); 
         soap_destroy(&soap);
         soap_end(&soap);
      } 
   } 
   soap_done(&soap);
} 
开发者ID:Thundzz,项目名称:ApplicationsReparties,代码行数:34,代码来源:server.c


示例6: getRequestStatus

//srm_array_of_strings getProtocols( srm_host_info host_info );
//
RequestStatus getRequestStatus( srm_int       requestId,
				srm_host_info host_info )
{
  char srmurl[SRM_MAX_URL_LEN];
  RequestStatus rs = NULL;

  if( fillSrmUrl( srmurl, host_info) ) {
    int ret;
    class tns__getRequestStatusResponse out;
    {
      struct soap soap;
      soap_init(&soap);

      ret = soap_call_tns__getRequestStatus( &soap, 
		 (const char*)srmurl, "getRequestStatus", (int)requestId, &out );
      if ( ret ) 
	soap_print_fault( &soap, stderr );
      else
	rs = g2srm_RequestStatus( out._Result );

      soap_end(  &soap );
      soap_done( &soap );
    }
  }
  return rs;
}
开发者ID:AndyMN,项目名称:dcache,代码行数:28,代码来源:srmImpl.cpp


示例7: get

RequestStatus get( srm_array_of_strings surls,
		   srm_array_of_strings protocols,
		   srm_host_info        host_info )
{
  char srmurl[SRM_MAX_URL_LEN];
  RequestStatus rs = NULL;

  if( fillSrmUrl( srmurl, host_info) ) {
    int   ret;
    class tns__getResponse out;

    class ArrayOfstring *arg0 = srm2g_string_array( surls );
    class ArrayOfstring *arg1 = srm2g_string_array( protocols );

    {
      struct soap soap;
      
      soap_init( &soap );
      
      ret = soap_call_tns__get ( &soap, (const char*)srmurl, "get", 
				 arg0, arg1, &out);
      if ( ret == SOAP_OK )
	rs = g2srm_RequestStatus( out._Result );
      else
	soap_print_fault( &soap, stderr );
      
      soap_end(  &soap );
      soap_done( &soap );
    }
    freeArrayOfstring( arg0 );
    freeArrayOfstring( arg1 );
  }
  return rs;
}
开发者ID:AndyMN,项目名称:dcache,代码行数:34,代码来源:srmImpl.cpp


示例8: soap_init

CWebServiceApi::CWebServiceApi()
{
    m_soap_endpoint = "";
    soap_init(&clientSOAP);
    setlocale(LC_ALL,"chs");
    soap_set_mode(&clientSOAP,SOAP_C_MBSTRING);
}
开发者ID:lidongqiang,项目名称:PCBATool,代码行数:7,代码来源:WebServiceApi.cpp


示例9: setFileStatus

RequestStatus setFileStatus ( srm_int       requestId,
			      srm_int       fileId,
			      srm_string    state,
			      srm_host_info host_info )
{
  char *statestr = (char*) state;
  char  srmurl[SRM_MAX_URL_LEN];
  class tns__setFileStatusResponse out;

  RequestStatus rs = NULL;

  if(    strcmp("Failed",  statestr)
      && strcmp("Pending", statestr)
      && strcmp("Ready",   statestr)
      && strcmp("Running", statestr)
      && strcmp("Done",    statestr) 
  )
    return NULL;     /* String NOT found, the state is invalid, just do nothing */

  if( fillSrmUrl( srmurl,  host_info)  ) {
    struct soap soap;
    soap_init(&soap);
    
    if ( soap_call_tns__setFileStatus ( &soap, (const char*)srmurl, "setFileStatus",
					(int)requestId, (int)fileId, state, &out))
      soap_print_fault( &soap, stderr );
    else
      rs = g2srm_RequestStatus( out._Result );

    soap_end(  &soap );
    soap_done( &soap );
  }
  return rs;
}
开发者ID:AndyMN,项目名称:dcache,代码行数:34,代码来源:srmImpl.cpp


示例10: rmc_init

	static int
rmc_init (struct soap *soap, char *errbuf, int errbufsz)
{
	int flags;

	soap_init (soap);
	soap->namespaces = namespaces_rmc;

	if (rmc_endpoint == NULL && (rmc_endpoint = getenv ("RMC_ENDPOINT")) == NULL) {
		if (!gfal_is_nobdii ()) {
			if (get_rls_endpoints (&lrc_endpoint, &rmc_endpoint, errbuf, errbufsz) != 0) {
				errno = EINVAL;
				return (-1);
			}
		} else {
			gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR,
					"You have to define 'RMC_ENDPOINT' and 'LRC_ENDPOINT' environment variables, when BDII calls are disabled");
			errno = EINVAL;
			return (-1);
		}
	}

#ifdef GFAL_SECURE
	if (strncmp (rmc_endpoint, "https", 5) == 0) {
		flags = CGSI_OPT_SSL_COMPATIBLE;
		soap_register_plugin_arg (soap, client_cgsi_plugin, &flags);
	}
#endif
	gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR,
			"RMC/LRC are obsolete! Please use LFC instead.");
	return (0);
}
开发者ID:ic-hep,项目名称:emi3,代码行数:32,代码来源:rmc_ifce.c


示例11: condor_base64_decode

// Caller needs to free *output if non-NULL
void condor_base64_decode(const char *input,unsigned char **output, int *output_length)
{
	ASSERT( input );
	ASSERT( output );
	ASSERT( output_length );
	int input_length = strlen(input);

		// safe to assume output length is <= input_length
	*output = (unsigned char *)malloc(input_length + 1);
	ASSERT( *output );
	memset(*output, 0, input_length);

	struct soap soap;
	soap_init(&soap);

	soap_base642s(&soap,input,(char*)(*output),input_length,output_length);

	soap_destroy(&soap);
	soap_end(&soap);
	soap_done(&soap);

	if( *output_length < 0 ) {
		free( *output );
		*output = NULL;
	}
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:27,代码来源:soapshell_main.cpp


示例12: condor_base64_encode

// Caller needs to free the returned pointer
char* condor_base64_encode(const unsigned char *input, int length)
{
	char *buff = NULL;

	if ( length < 1 ) {
		buff = (char *)malloc(1);
		buff[0] = '\0';
		return buff;
	}

	int buff_len = (length+2)/3*4+1;
	buff = (char *)malloc(buff_len);
	ASSERT(buff);
	memset(buff,0,buff_len);

	struct soap soap;
	soap_init(&soap);

	soap_s2base64(&soap,input,buff,length);

	soap_destroy(&soap);
	soap_end(&soap);
	soap_done(&soap);

	return buff;
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:27,代码来源:soapshell_main.cpp


示例13: main

int main()
{
  struct soap soap;
  int m, s; // master and slave sockets
  int i;

  soap_init(&soap);
  m = soap_bind(&soap, "127.0.0.1", 9111, 100);
  if (m < 0)
    soap_print_fault(&soap, stderr);
  else
    {
      fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
      for (i = 1; ; i++)
        {
          s = soap_accept(&soap);
          if (s < 0)
            {
              soap_print_fault(&soap, stderr);
              break;
            }

          fprintf(stderr,
                  "%d: accepted connection from IP=%d.%d.%d.%d socket=%d\n", i,
                  (soap.ip >> 24)&0xFF, (soap.ip>>16)&0xFF, (soap.ip>>8)&0xFF,
                  soap.ip&0xFF, s);
          if(soap_serve(&soap) != SOAP_OK) // process RPC request
            soap_print_fault(&soap, stderr); // print error
          fprintf(stderr,"request served\n");
          soap_destroy(&soap); // clean up class instances
          soap_end(&soap); // clean up everything and close socket
        }
    }
  soap_done(&soap); // close master socket and detach environment
}
开发者ID:AdaCore,项目名称:aws,代码行数:35,代码来源:c_server_rpc.c


示例14: main

int main(int argc, char **argv)
{ int m, s; /* master and slave sockets */
  struct soap soap;
  soap_init(&soap);
  if (argc < 2)
    soap_serve(&soap);	/* serve as CGI application */
  else
  { m = soap_bind(&soap, NULL, atoi(argv[1]), 100);
    if (m < 0)
    { soap_print_fault(&soap, stderr);
      exit(-1);
    }
    fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
    for ( ; ; )
    { s = soap_accept(&soap);
      fprintf(stderr, "Socket connection successful: slave socket = %d\n", s);
      if (s < 0)
      { soap_print_fault(&soap, stderr);
        exit(-1);
      } 
      soap_serve(&soap);
      soap_end(&soap);
    }
  }
  return 0;
} 
开发者ID:xin3liang,项目名称:platform_external_gsoap,代码行数:26,代码来源:calcserver.cpp


示例15: main

int main(int argc, char **argv)
{
int result = -1;
int id_count = 1;

struct Namespace namespaces[] =
{   // {"ns-prefix", "ns-name"}
   {"SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope"}, // MUST be first
   {"d", "http://schemas.xmlsoap.org/ws/2005/04/discovery"}, 
   {"wsa", "http://schemas.xmlsoap.org/ws/2004/08/addressing"}, 
   {"dn", "http://www.onvif.org/ver10/network/wsdl"}, // given by the service description
   {NULL, NULL} // end of table
}; 
	 
	 // Get UUID
	 uuid_t uuid;
	 char szUuid[36] = {0};
	 char szMsgID[50] = {0};
	 
	 uuid_generate_time(uuid);
	 
	 uuid_unparse(uuid, szUuid);
	 
	 snprintf(szMsgID, sizeof(szMsgID), "uuid:%s", szUuid);
	 
struct soap soap;
struct SOAP_ENV__Header header; // the SOAP Header

soap_init(&soap);
soap.send_timeout = 1; // 1s timeout
soap.recv_timeout = 1; // 1s timeout

soap_set_namespaces(&soap, namespaces);

soap_default_SOAP_ENV__Header(&soap, &header); // init SOAP Header
header.wsa__MessageID = szMsgID;
header.wsa__To = "urn:schemas-xmlsoap-org:ws:2005:04:discovery";
header.wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe";

soap.header = &header;

struct d__ProbeMatchType r;
// Send and receive messages over UDP:
if (soap_send_d__Probe(&soap, "soap.udp://239.255.255.250:3702", NULL, "", ""))
{
      soap_print_fault(&soap, stderr);
}

// Send and receive messages over UDP:
if (soap_send_d__ProbeMatches(&soap, "soap.udp://239.255.255.250:3702", NULL, NULL))
{
      soap_print_fault(&soap, stderr);
}

soap_destroy(&soap); // cleanup
soap_end(&soap); // cleanup
soap_done(&soap); // close connection (should not use soap struct after this) 

return 0;
}
开发者ID:songsanghoon2,项目名称:wsdiscovery,代码行数:60,代码来源:wsclient.c


示例16: main

int main(int argc, char **argv){

  struct soap mySoap;
  char       *rpDoc;
  char       *passPtr;
  const int   MAX_LEN = 1024;
  char        input[MAX_LEN];
  char        username[MAX_LEN];

  signal(SIGPIPE, sigpipe_handle); 

  if(argc != 2){
    printf("Usage:\n  getResourcePropertyDoc <EPR of SWS>\n");
    return 1;
  }
  snprintf(username, MAX_LEN, "%s", getenv("USER"));

  soap_init(&mySoap);

  /* If address of SWS begins with 'https' then initialize SSL context */
  if( (strstr(argv[1], "https") == argv[1]) ){

    /* - don't bother with mutually-authenticated SSL
    if( !(passPtr = getpass("Enter passphrase for key: ")) ){

      printf("Failed to get passphrase from command line\n");
      return 1;
    }
    strncpy(input, passPtr, MAX_LEN);
    */

    init_ssl_context(&mySoap,
		     REG_TRUE,
		     NULL,/* user's cert. & key file */
		     NULL,/* Password to read key file */
		     "/etc/grid-security/certificates");
  }

  if( !(passPtr = getpass("Enter SWS password: ")) ){

    fprintf(stderr, "Failed to get SWS password from command line\n");
    return 1;
  }

  get_resource_property_doc(&mySoap,
			    argv[1],
			    username,
			    passPtr,
			    &rpDoc);
	 
  fprintf(stdout, "\n\n%s\n\n", rpDoc);

  /* Explicitly wipe the passphrase from memory */
  memset((void *)(input), '\0', MAX_LEN);

  soap_end(&mySoap);
  soap_done(&mySoap);
  return 0;
}
开发者ID:RealityGrid,项目名称:wsrf_tools,代码行数:59,代码来源:getResourcePropertyDoc.c


示例17: main

int main(int argc, char **argv) {
  // initialize EMBASSY info
  embInitPV("kclique", argc, argv, "KBWS", "1.0.9");

  struct soap soap;
  char*  jobid;
  char*  result;

  AjPFile    infile;
  AjPFile    outf;
  AjPStr     substr;
  AjPStr     indata = NULL;
  AjPStr     line   = NULL;

  infile = ajAcdGetInfile("infile");
  outf   = ajAcdGetOutfile("outfile");

  while (ajReadline(infile, &line)) {
    ajStrAppendS(&indata, line);
    ajStrAppendC(&indata, "\n");
  }

  soap_init(&soap);

  char* in0;
  in0 = ajCharNewS(indata);
  if ( soap_call_ns1__runClique( &soap, NULL, NULL, in0, &jobid ) == SOAP_OK ) {
  } else {
    soap_print_fault(&soap, stderr);
  }

  int check = 0;
  while ( check == 0 ) {
    if ( soap_call_ns1__checkStatus( &soap, NULL, NULL, jobid,  &check ) == SOAP_OK ) {
    } else {
      soap_print_fault(&soap, stderr);
    }
    sleep(3);
  }

  if ( soap_call_ns1__getResult( &soap, NULL, NULL, jobid,  &result ) == SOAP_OK ) {
    substr = ajStrNewC(result);
    ajFmtPrintF(outf,"%S\n",substr);
  } else {
    soap_print_fault(&soap, stderr);
  }

  soap_destroy(&soap);
  soap_end(&soap);
  soap_done(&soap);

  ajFileClose(&infile);
  ajFileClose(&outf);
  ajStrDel(&substr);

  embExit();

  return 0;
}
开发者ID:agustin-avila,项目名称:KBWS,代码行数:59,代码来源:kclique.c


示例18: main

int main()
{
  struct soap soap;

  soap_init(&soap);
  soap_set_namespaces(&soap, xmas_namespaces);
  return xmas_serve(&soap);
}
开发者ID:119-org,项目名称:TND,代码行数:8,代码来源:xmas.c


示例19: complexGsoap4

inline void complexGsoap4()
{
	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__complexGsoap4 input, output;
	input.soap = soap;
	input.att1 = 0;
	input.att2 = 1;
	input.att3 = 2;
	input.att4 = 3;
	input.att5 = 0;
	input.att6 = 1;
	input.att7 = 2;
	input.att8 = 3;
	input.att9 = "TEST 0";
	input.att10 = "TEST 1";
	input.att11 = "TEST 2";
	input.att12 = "TEST 3";
	input.att13 = 2.5;
	input.att14 = 3.6;
	input.att15 = 4.7;
	input.att16 = 5.8;
	input.att17 = 27.1;
	input.att18 = 28.2;
	input.att19 = 29.3;
	input.att20 = 30.4;
	input.att21 = true;
	input.att22 = true;
	input.att23 = true;
	input.att24 = true;

	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__complexGsoap4(soap, &input);
		
		//streambuf.pubseekpos(0);
		//ost->rdbuf(&streambuf);
		//std::cout << "Str: " << streambuf.size() << endl;
		//break;
		
		soap_read__ns1__complexGsoap4(soap, &output);
	}

	soap_destroy(soap);
	soap_end(soap);
	soap_done(soap);
}
开发者ID:eProsima,项目名称:Dynamic-Fast-Buffers,代码行数:58,代码来源:main.cpp


示例20: main

int main()
{ struct soap soap;
  char *t;
  soap_init(&soap);
  if (soap_call_ns__LocalTimeByZipCode(&soap, "http://www.alethea.net/webservices/LocalTime.asmx", "http://www.alethea.net/webservices/LocalTimeByZipCode", "32306", &t))
    soap_print_fault(&soap, stderr);
  else
    printf("Time = %s\n", t);
  return 0;
}
开发者ID:carriercomm,项目名称:PrologMUD,代码行数:10,代码来源:localtime.c



注:本文中的soap_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ soap_lookup_plugin函数代码示例发布时间:2022-05-30
下一篇:
C++ soap_imode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap