⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example2.cpp

📁 一款开源的soap库
💻 CPP
字号:
/*example2.cppExample UDDI V2 Client--------------------------------------------------------------------------------gSOAP XML Web services toolsCopyright (C) 2004-2005, Robert van Engelen, Genivia Inc. All Rights Reserved.This software is released under one of the following two licenses:GPL or Genivia's license for commercial use.--------------------------------------------------------------------------------GPL license.This program is free software; you can redistribute it and/or modify it underthe terms of the GNU General Public License as published by the Free SoftwareFoundation; either version 2 of the License, or (at your option) any laterversion.This program is distributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR APARTICULAR PURPOSE. See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along withthis program; if not, write to the Free Software Foundation, Inc., 59 TemplePlace, Suite 330, Boston, MA 02111-1307 USAAuthor contact information:engelen@genivia.com / engelen@acm.org--------------------------------------------------------------------------------A commercial use license is available from Genivia, Inc., contact@genivia.com--------------------------------------------------------------------------------*/#include "inqH.h"int main(int argc, char **argv){   char *search_string = "xmethods";  if (argc > 1)    search_string = argv[1];  // Create a gSOAP context  struct soap *soap = soap_new();  // Create an object to find a business  uddi2__find_USCOREbusiness fb(soap, search_string);  // Send the request  uddi2__businessList *bl = fb.send("http://uddi.xmethods.net/inquire");  // Check if result is OK  if (!bl)    soap_print_fault(soap, stderr);  // If OK, report the business name(s) and unique identification keys  else if (bl->businessInfos)  {    std::cout << "Search results on " << search_string << ":" << std::endl << std::endl;    for (std::vector<uddi2__businessInfo*>::const_iterator bi = bl->businessInfos->businessInfo.begin(); bi != bl->businessInfos->businessInfo.end(); ++bi)    {      // Report businessKey      std::cout << "businessKey=" << (*bi)->businessKey << std::endl;      // Report names      for (std::vector<uddi2__name*>::const_iterator n = (*bi)->name.begin(); n != (*bi)->name.end(); ++n)        std::cout << "name=" << (*n)->__item << std::endl;      std::cout << std::endl;    }  }  // Remove deserialized objects  soap_destroy(soap);  // Remove temporary data  soap_end(soap);  // Detach and free context  soap_done(soap);  free(soap);  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -