官网文档:  http://axis.apache.org/axis2/c/core/docs/axis2c_manual.html

从文档中可以总结出:

1. Axis2/C是一个用C语言实现的Web Service引擎。
Axis2/C基于Axis2架构,支持SOAP1.1SOAP1.2协议,并且支持RESTful风格的Web Service。基于Axis2/C的Web Service可以同时暴露为SOAP和RESTful风格的服务。

2. 构建Axis2/c服务的基本步骤:

*Implement the functions corresponding to the operations of the service.

    In our sample, we will have one function that implements the "greet" operation. 
    We will name that function axis2_hello_greet.
   *Implement the functions defined by the axis2_svc_skeleton interface

    axis2_svc_skeleton interface expects the functions initinvokeon_fault and free to be implemented by our service.
    In our sample, we would implement those and name them as hello_inithello_invokehello_on_fault and hello_free respectively.

* Implement the create function, that would create an instance of the service skeleton

    The create function would create an axis2_svc_skeleton and assign the respective function pointers to map the axis2_svc_skeleton interface to   our interface implementation methods explained in the above step.

* Implement axis2_get_instance and axis2_remove_instance functions

    These functions are used to create and destroy service instances by the engine, and each service must define these functions.

   * Write the services.xml file for the service

    The services.xml file acts as the deployment descriptor file for the service. As the bare minimum, we need to configure the service name,       operations, and the shared library file name containing the service implementation in this file.
    As previously decided, we will name the service "hello", the operation "greet" and the shared library libhello.so on Linux and hello.dll on MS     Windows.

3. Server API  (官网文档)

4. REST 实现(官网文档)

编译命令:

gcc -shared -fPIC -o libhello.so -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver hello.c

构造XML

例如:

  <Config>
     <value>88</value>
      <type>get</type>
  </Config>
 
        axiom_node_t *
axis2_hello_getconfig(const axutil_env_t *env, axiom_node_t *node)
{
        axiom_node_t* root_node_t = NULL;
        axiom_node_t* node_value = NULL;
        axiom_node_t* node_type = NULL;
        axiom_element_t * ele_root = NULL;
        axiom_element_t * ele_value = NULL;
        axiom_element_t * ele_type = NULL;

ele_root = axiom_element_create(env, NULL, "Config", NULL, &root_node_t);

ele_value = axiom_element_create(env, root_node_t, "value", NULL, &node_value);
        axiom_element_set_text(ele_value, env, "88", node_value);

ele_type = axiom_element_create(env, root_node_t, "type", NULL, &node_type);
        axiom_element_set_text(ele_type, env, "get", node_type);

return root_node_t;
}

Axis2/c 知识点的更多相关文章

  1. axis2框架用wsdl文件生成的服务端MessageReceiveInOut文件注意事项

    在用axis2生成服务端文件和客户端文件,当客户端文件调用服务端文件时,都是通过wsdl文件生成的 配置文件进行相互的调用. 在一开始做开发测试的时候,通过soapUI进行调用接口的时候,可以调用成功 ...

  2. Java面试知识点总结及解析

    声明:有人说, 有些面试题很变态,个人认为其实是因为我们基础不扎实或者没有深入.本篇文章来自一位很资深的前辈对于最近java面试题目所做的总结归纳,有170道题目 ,知识面很广 ,而且这位前辈对于每个 ...

  3. ASP.NET Core 中的那些认证中间件及一些重要知识点

    前言 在读这篇文章之间,建议先看一下我的 ASP.NET Core 之 Identity 入门系列(一,二,三)奠定一下基础. 有关于 Authentication 的知识太广,所以本篇介绍几个在 A ...

  4. ASP.NET MVC开发:Web项目开发必备知识点

    最近加班加点完成一个Web项目,使用Asp.net MVC开发.很久以前接触的Asp.net开发还是Aspx形式,什么Razor引擎,什么MVC还是这次开发才明白,可以算是新手. 对新手而言,那进行A ...

  5. UWP开发必备以及常用知识点总结

    一直在学UWP,一直在写Code,自己到达了什么水平?还有多少东西需要学习才能独挡一面?我想对刚接触UWP的开发者都有这种困惑,偶尔停下来总结分析一下还是很有收获的! 以下内容是自己开发中经常遇到的一 ...

  6. C#高级知识点&(ABP框架理论学习高级篇)——白金版

    前言摘要 很早以前就有要写ABP高级系列教程的计划了,但是迟迟到现在这个高级理论系列才和大家见面.其实这篇博客很早就着手写了,只是楼主一直写写停停.看看下图,就知道这篇博客的生产日期了,谁知它的出厂日 ...

  7. lucene 基础知识点

    部分知识点的梳理,参考<lucene实战>及网络资料 1.基本概念 lucence 可以认为分为两大组件: 1)索引组件 a.内容获取:即将原始的内容材料,可以是数据库.网站(爬虫).文本 ...

  8. DoraCMS 源码知识点备注

    项目需要研究了下DoraCMS这款开源CMS,真心做的不错:).用的框架是常用的express 4 + mongoose,代码也很规范,值得学习. 源码中一些涉及到的小知识点备注下: https:// ...

  9. atitit 商业项目常用模块技术知识点 v3 qc29

    atitit 商业项目常用模块技术知识点 v3 qc29 条码二维码barcodebarcode 条码二维码qrcodeqrcode 条码二维码dm码生成与识别 条码二维码pdf147码 条码二维码z ...

随机推荐

  1. oh-my-zsh的使用

    一.自动安装wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh 二.配置文件~/. ...

  2. Oracle 10g bigfile表空间、smallfile 表空间

    smallfile tablespace设置不同大小的db_block_size时数据文件允许的最大大小 db_block_size=2KB,2KB*4M=8192M      8Gdb_block_ ...

  3. lucene 索引合并策略

    在索引算法确定的情况下,最为影响Lucene索引速度有三个参数--IndexWriter中的 MergeFactor, MaxMergeDocs, RAMBufferSizeMB .这些参数无非是控制 ...

  4. C++运算符重载详解

    1.什么是运算符重载 运算符重载是一种函数重载. 运算符函数的格式:operatorop(argument-list)例如,operator+()重载+运算符.其中的op,必须是有效的C++运算符,如 ...

  5. 怎么用CorelDRAW插入、删除与重命名页面

    在绘图之前,页面的各种设置也是一项重要的工作,本文主要讲解如何在CorelDRAW中插入.删除.重命名页面等操作.在CorelDRAW的绘图工作中,常常需要在同一文档中添加多个空白页面,删除一些无用的 ...

  6. 关于c语言char类型输入输出的一个bug

    题目 输入一个整数n,接下来n行每一行输入两个用一个空格分隔的字符. 对每一对字符,比较其大小关系并输出比较的结果:1.0.-1. 解决的代码如下: #include<stdio.h> i ...

  7. 2的N次方 【转】

    题目的链接为:http://acm.njupt.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=1009 题目为: 2的N次 ...

  8. JS 阻止浏览器默认行为和冒泡事件

    JS 冒泡事件   首先讲解一下js中preventDefault和stopPropagation两个方法的区别: preventDefault方法的起什么作用呢?我们知道比如<a href=& ...

  9. Java语言编码规范(Java Code Conventions)

    Java语言编码规范(Java Code Conventions) 名称 Java语言编码规范(Java Code Conventions) 译者 晨光(Morning) 简介 本文档讲述了Java语 ...

  10. redis报错Windows error 0x70(a large memory)

    redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...