Creation of an Axis Web Service and a gSOAP client

转载 2007年10月09日 19:51:00

 Creation of an Axis Web Service and a gSOAP client  

http://www.dfki.de/~sberg/smartweb/sysgroup/Axis_gSoap_Development.html





  • Linux platform
  • C(++) Compiler
  • gSOAP 2.7.0 [download]
  • Apache Axis 1.3 [download]
  • Java jdk 1.5
  • Tomcat 5.5.9 (This tutorial assumes, that the Tomcat server runs on Port 8080.)



  • 1) Create a WSDL file
    The WSDL file <TextService.wsdl> can be generated by hand or utilizing tools for the generation of WSDL files.


    2) Build the server-side classes
    command: java org.apache.axis.wsdl.WSDL2Java --server-side --skeletonDeploy true TextService.wsdl

    The optional setting 'skeletonDeploy true' causes the automatical generation of skeleton classes for each in the header file defined method. The skeleton routines can be readily used to implement one or more of the remote methods in a new SOAP Web Service.

    The server-side classes (skeleton and service) are saved in the directory, specified by the namespace. The example Web Services with Apache Axis explaines the creation and deployment of a service more precisely.


    3) Implementation of a Web Service
    The methods of the automatically created class TextServiceSoapBindingImpl.java must be implemented.



    1) Create a header file
    Use the WSDL parser wsdl2h to create the header file <gSoapTextClient.h>. Therefore it is necessary to call the WSDL file of the created Axis Web Service, which is located at the Tomcat Web server.

    command: wsdl2h -o gSoapTextClient.h http://localhost:8080/axis/services/TextService?wsdl

    The method processData must be changed in that effect, that the parameters are pointers.
    [ processData(std:string *request, std:string *response)]


    2) Build the necessary stub and skeleton classes
    The implementation of a SOAP client application needs a stub routine for each remote method. This classes are automatically generated by the stub and skeleton compiler soapcpp2.

    command: soapcpp2 -I/<gsoap-path> gSoapTextClient.h


    3) Implementation of the client class

            #include gSoapTextClient.nsmap
    	...
            // service address
    	const char server[] = "http://localhost:8080/axis/services/TextService";
    
    
    	main() {
    	 
    	    struct soap soap;
    	    soap_init(&soap); 
    	 
    	    // read input
    	    ifstream infile ... 
    
    	    // remote call
    	    int responseflag = soap_call___ns1__processData(&soap, server, "", requestData, &responseData);
    	    	...
    	}
       

     

    4) Compile the client class
    command:

    g++ -Wno-deprecated -I/<gsoap-path> -o  gSoapTextClient gSoapTextClient.cpp soapC.cpp soapClient.cpp <gsoap-path>/stdsoap2.cpp

     


    5) Start the gSOAP client
    To start the gSOAP client, the object file must be called.

    command: gSoapTextClient -i ExampleOutput_RDF

     

    tensorflow各版本间踩过的坑

    问题一:TypeError: Expected int32, got list containing Tensors of type ‘_Message’ instead.tensorflow 函数t...
    • wang2008start
    • wang2008start
    • 2017年05月10日 11:38
    • 5099

    Leetcode解题笔记(Array)

    源码见github https://github.com/Kelvinmao/Leetcode/tree/master/Array 2016-08-08更新154.Find Minimum in Ro...
    • kelvinmao
    • kelvinmao
    • 2016年07月23日 22:38
    • 1567

    Leetcode全数组问题

    目录 1、编号2 Median of Two Sorted Arrays There are two sorted arrays A and B of size m and n respe...
    • wangxiaojun911
    • wangxiaojun911
    • 2014年02月06日 03:32
    • 6336

    gsoap实现web service的server/client(c++)

    • 2013年05月13日 16:23
    • 10.8MB
    • 下载

    Building a JSON web service with Java and Axis2

    • 2012年11月21日 23:07
    • 126KB
    • 下载

    Building a JSON web service with Java and Axis2

    【http://www.marcusschiesser.de/2009/01/building-a-json-web-service-with-java-and-axis2/】 Building...
    • chinalian
    • chinalian
    • 2012年03月17日 00:38
    • 2531

    Steps to Set up and Implement Web Service via Eclipse and Axis2 1.6

    Part I Setup Step 1. Install Axis2 environment to c:\axis\ and run it. This step is simple. Ju...
    • sun9701210
    • sun9701210
    • 2012年05月10日 16:04
    • 1430

    Configuration of Individual Web Services and Web Service Clients .doc

    • 2009年03月10日 17:21
    • 48KB
    • 下载

    Linux下用gSOAP开发Web Service服务端和客户端程序

    • 2012年12月01日 13:20
    • 6KB
    • 下载

    axis web service的教程,入门到精通

    • 2013年07月24日 17:03
    • 1.08MB
    • 下载
    内容举报
    返回顶部
    收藏助手
    不良信息举报
    您举报文章: Creation of an Axis Web Service and a gSOAP client
    举报原因:
    原因补充:

    (最多只允许输入30个字)