Axis2/c 知识点

官网文档:  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 init, invoke, on_fault and free to be implemented by our service.
    In our sample, we would implement those and name them as hello_init, hello_invoke, hello_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;
}

 

转载于:https://www.cnblogs.com/maxpak/p/4720444.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最新版本的axis2c Apache Axis2/C What is it? ----------- The Apache Axis2/C is a SOAP engine implementation that can be used to provide and consume Web Services. Axis2/C is an effort to implement Axis2 architecture, in C. Please have a look at http://ws.apache.org/axis2/1_0/Axis2ArchitectureGuide.html for an overview on Axis2 architecture. Axis2/C supports both SOAP 1.1 and SOAP 1.2. The soap processing model is built on the AXIOM XML object model. Axis2/C is capable of handling one-way messaging (In-Only) as well as request response messaging (In-Out). It can be used in both synchronous and asynchronous modes. Axis2/C has built in WS-Addressing support. It implements WS-Addressing 1.0 specification completely. It also has built in MTOM/XOP support for handling binary attachments. As a project of the Apache Software Foundation, the developers aim to collaboratively develop and maintain a robust, commercial-grade, standards-based Web Services stack implementation with freely available source code. The Latest Version ------------------ Details of the latest version can be found on the Apache Axis2/C project page under http://ws.apache.org/axis2/c. Documentation ------------- The documentation available as of the date of this release is included in HTML format in the docs/ directory. The most up-to-date documentation can be found at http://ws.apache.org/axis2/c/docs/index.html. Installation ------------ Please see the file named INSTALL. You can also have a look at docs/installationguide.html. Licensing --------- Please see the file named LICENSE. Contacts -------- o If you want freely available support for using Apache Axis2/C please join the Apache Axis2/C user community by subscribing to users mailing list, axis-c-user@ws.apache.org' as described at http://ws.apache.org/axis2/c/mail-lists.html o If you have a bug report for Apache Axis2/C please go log a Jira issue at http://issues.apache.org/jira/browse/AXIS2C o If you want to participate in actively developing Apache Axis2/C please subscribe to the `axis-c-dev@ws.apache.org' mailing list as described at http://ws.apache.org/axis2/c/mail-lists.html Acknowledgements ---------------- Apache Axis2/C relies heavily on the use of autoconf and libtool to provide a build environment.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值