当前位置: 首页>>代码示例>>C++>>正文


C++ soap_done函数代码示例

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


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

示例1: rmc_register_alias

rmc_register_alias (const char *guid, const char *lfn, char *errbuf, int errbufsz)
{
	struct rmc__addAliasResponse out;
	int ret;
	int sav_errno = 0;
	struct soap soap;

	if (rmc_init (&soap, errbuf, errbufsz) < 0)
		return (-1);

	if ((ret = soap_call_rmc__addAlias (&soap, rmc_endpoint, "",
				(char *) guid, (char *) lfn, &out))) {
		if (ret == SOAP_FAULT) {
			if (strstr (soap.fault->faultcode, "ALIASEXISTS"))
				sav_errno = EEXIST;
			else if (strstr (soap.fault->faultcode, "VALUETOOLONG"))
				sav_errno = ENAMETOOLONG;
			else {
				gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
				sav_errno = ECOMM;
			}
		} else {
			gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
			sav_errno = ECOMM;
		}
		soap_end (&soap);
		soap_done (&soap);
		errno = sav_errno;
		return (-1);
	}
	soap_end (&soap);
	soap_done (&soap);
	return (0);
}
开发者ID:ic-hep,项目名称:emi3,代码行数:34,代码来源:rmc_ifce.c

示例2: rmc_guidfromlfn

	char *
rmc_guidfromlfn (const char *lfn, char *errbuf, int errbufsz)
{
	struct rmc__guidForAliasResponse out;
	char *p;
	int ret;
	int sav_errno = 0;
	struct soap soap;

	if (rmc_init (&soap, errbuf, errbufsz) < 0)
		return (NULL);

	if ((ret = soap_call_rmc__guidForAlias (&soap, rmc_endpoint, "",
				(char *) lfn, &out))) {
		if (ret == SOAP_FAULT && strstr (soap.fault->faultcode, "NOSUCHALIAS"))
			sav_errno = ENOENT;
		else {
			gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
			sav_errno = ECOMM;
		}
		soap_end (&soap);
		soap_done (&soap);
		errno = sav_errno;
		return (NULL);
	} else {
		p = strdup (out._guidForAliasReturn);
		soap_end (&soap);
		soap_done (&soap);
		return (p);
	}
}
开发者ID:ic-hep,项目名称:emi3,代码行数:31,代码来源:rmc_ifce.c

示例3: lrc_guidforpfn

	char *
lrc_guidforpfn (const char *pfn, char *errbuf, int errbufsz)
{
	struct lrc__guidForPfnResponse out;
	char *p;
	int ret;
	int sav_errno = 0;
	struct soap soap;

	if (lrc_init (&soap, errbuf, errbufsz) < 0)
		return (NULL);

	if ((ret = soap_call_lrc__guidForPfn (&soap, lrc_endpoint, "",
					(char *) pfn, &out))) {
		if (ret == SOAP_FAULT && strstr (soap.fault->faultcode, "NOSUCHPFN")) {
			sav_errno = ENOENT;
		} else {
			gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
			sav_errno = ECOMM;
		}
		soap_end (&soap);
		soap_done (&soap);
		errno = sav_errno;
		return (NULL);
	}
	p = strdup (out._guidForPfnReturn);
	soap_end (&soap);
	soap_done (&soap);
	return (p);
}
开发者ID:ic-hep,项目名称:emi3,代码行数:30,代码来源:lrc_ifce.c

示例4: lrc_setfilesize

lrc_setfilesize (const char *pfn, GFAL_LONG64 filesize, char *errbuf, int errbufsz)
{
	struct lrc__setStringPfnAttributeResponse out;
	int ret;
	int sav_errno = 0;
	struct soap soap;
	char tmpbuf[21];

	if (lrc_init (&soap, errbuf, errbufsz) < 0)
		return (-1);

	sprintf (tmpbuf, GFAL_LONG64_FORMAT, filesize);
	if ((ret = soap_call_lrc__setStringPfnAttribute (&soap, lrc_endpoint,
				"", (char *) pfn, "size", tmpbuf, &out))) {
		if (ret == SOAP_FAULT && strstr (soap.fault->faultcode, "NOSUCHPFN")) {
			sav_errno = ENOENT;
		} else {
			gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
			sav_errno = ECOMM;
		}
		soap_end (&soap);
		soap_done (&soap);
		errno = sav_errno;
		return (-1);
	}
	soap_end (&soap);
	soap_done (&soap);
	return (0);
}
开发者ID:ic-hep,项目名称:emi3,代码行数:29,代码来源:lrc_ifce.c

示例5: lrc_replica_exists

	int
lrc_replica_exists (const char *guid, char *errbuf, int errbufsz)
{
	struct lrc__getPfnsResponse out;
	int ret;
	int sav_errno = 0;
	struct soap soap;

	if (lrc_init (&soap, errbuf, errbufsz) < 0)
		return (-1);

	if ((ret = soap_call_lrc__getPfns (&soap, lrc_endpoint, "",
					(char *) guid, &out))) {
		if (ret == SOAP_FAULT && strstr (soap.fault->faultcode, "NOSUCHGUID")) {
			sav_errno = 0;
		} else {
			gfal_errmsg (errbuf, errbufsz, GFAL_ERRLEVEL_ERROR, "%s", soap.fault->faultstring);
			sav_errno = ECOMM;
		}
		soap_end (&soap);
		soap_done (&soap);
		// return 'false' if guid does not exist in LRC
		if(sav_errno == 0)
			return (0);

		errno = sav_errno;
		return (-1);
	}
	soap_end (&soap);
	soap_done (&soap);
	return (out._getPfnsReturn->__size==0?0:1);
}
开发者ID:ic-hep,项目名称:emi3,代码行数:32,代码来源:lrc_ifce.c

示例6: save_options

int 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,代码来源:options.c

示例7: if

std::ostream &operator<<(std::ostream &o, const struct soap_dom_element &e)
{ if (!e.soap)
  { struct soap soap;
    soap_init2(&soap, SOAP_IO_DEFAULT, SOAP_XML_GRAPH);
    soap_mark_xsd__anyType(&soap, &e);
    soap_begin_send(&soap);
    soap_put_xsd__anyType(&soap, &e, NULL, NULL);
    soap_end_send(&soap);
    soap_end(&soap);
    soap_done(&soap);
  }
  else
  { std::ostream *os = e.soap->os;
    e.soap->os = &o;
    short omode = e.soap->omode;
    soap_set_omode(e.soap, SOAP_XML_GRAPH);
    soap_mark_xsd__anyType(e.soap, &e);
    soap_begin_send(e.soap);
    soap_put_xsd__anyType(e.soap, &e, NULL, NULL);
    soap_end_send(e.soap);
    e.soap->os = os;
    e.soap->omode = omode;
  }
  return o;
}
开发者ID:hackshields,项目名称:antivirus,代码行数:25,代码来源:dom.c

示例8: 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

示例9: soap_destroy

CWebServiceApi::~CWebServiceApi()
{
    // 关闭SOAP
    soap_destroy(&clientSOAP);
    soap_end(&clientSOAP);
    soap_done(&clientSOAP);
}
开发者ID:lidongqiang,项目名称:PCBATool,代码行数:7,代码来源:WebServiceApi.cpp

示例10: 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

示例11: 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

示例12: 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

示例13: main

int main(int argc, char **argv)
{ struct soap soap;
  double a, b, result;
  if (argc < 4)
  { fprintf(stderr, "Usage: [setAuto] num[Sentido] num[Direccion]\n");
    exit(0);
  }
  soap_init1(&soap, SOAP_XML_INDENT);
  a = strtod(argv[2], NULL);
  b = strtod(argv[3], NULL);
  switch (*argv[1])
  { case 's':
      soap_call_ns__setAuto(&soap, server, "", a, b, &result);
      break;
    default:
      fprintf(stderr, "Unknown command\n");
      exit(0);
  }
  if (soap.error)
  { soap_print_fault(&soap, stderr);
    exit(1);
  }
  else
    printf("result = %g\n", result);
  soap_destroy(&soap);
  soap_end(&soap);
  soap_done(&soap);
  return 0;
}
开发者ID:ljprediger,项目名称:Auto_RasPi_WSGsoap_ClientConsole,代码行数:29,代码来源:autoclient.c

示例14: cleanup

void cleanup(struct soap* soap) {
  /* release our connection and context */
  xmpp_conn_release(conn);
  xmpp_ctx_free(ctx);
  
  /* final shutdown of the library */
  xmpp_shutdown();

  if (rsa_private_key) {
    EVP_PKEY_free(rsa_private_key);
  }

  if (cert) {
    X509_free(cert);
  }

  if (soap) {
    soap_end(soap);
    soap_done(soap);
    soap_free(soap);
  }
  
  ERR_remove_state(0);
  ENGINE_cleanup();
  CONF_modules_unload(1);

  ERR_free_strings();
  EVP_cleanup();
  CRYPTO_cleanup_all_ex_data();
}
开发者ID:abidinz,项目名称:Stormee,代码行数:30,代码来源:main.c

示例15: 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


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