gsoap编写webservice应用

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





你可能感兴趣的:(C++,c,Web,webservice,C#)