加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

gsoap编写webservice应用

发布时间:2020-12-17 02:01:57 所属栏目:安全 来源:网络整理
导读:The gSOAP tools minimize application adaptation efforts for building Web Services by using an XML C/C++ data binding implemented by source-to-source code generation tools. The gSOAP wsdl2h tool imports one or more WSDLs and XML schemas and
The gSOAP tools minimize application adaptation efforts for building Web Services by using an XML C/C++ data binding implemented by source-to-source code generation tools. The gSOAP wsdl2h tool imports one or more WSDLs and XML schemas and generates a gSOAP header file in familiar C/C++ syntax with the Web service operations and the C/C++ data types used by the services. The gSOAP soapcpp2 compiler then takes this header file and generates XML serializers for the data types (soapH.h and soapC.cpp),the client-side stubs (soapClient.cpp),and server-side skeletons (soapServer.cpp). The gSOAP soapcpp2 compiler can also generate WSDL definitions for implementing a service from scratch,i.e. without defining a WSDL first. This "closes the circle" in that it enables Web services development from WSDL or directly from a set op C/C++ operations in a header file without the need for users to analyze Web service details. You only need to follow a few steps to execute the tools from the command line or Makefile (see also MSVC++ project examples in the samples directory with tool integration in the MSVC++ IDE). For example,to generate code for the calculator Web service,we run the wsdl2h tool from the command line on the URL of the WSDL and use option -o to specify the output file: 首先你已经拿到wsdl协议规范文件。 譬如编写客户端应用: ?? $ wsdl2h -o calc.h http://www.cs.fsu.edu/~engelen/calc.wsdl ?? $soapcpp2 -C -L -I../../import calc.h 即生成了代码: 编写服务端 ccid-m:/cs/test/tmp/gsoap-2.7/gsoap/bin/linux386/path>soapcpp2 -S -a -d./path/ -L -I../../import -x PortOfMark.h

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读