`
laochake
  • 浏览: 113532 次
社区版块
存档分类
最新评论

axis2 services.xml 文件格式

    博客分类:
  • java
阅读更多

The description of services are specified using services.xml. Each service archive file needs to have a services.xml in order to be a valid service and it should be available in the META-INF directory of the archive file. A very simple services.xml is shown below:

<service name="name of the service" scope="name of the scope" class="full qualifide name the service lifecycle class"   targetNamespace="target namespase for the service">
    <Description> The description of the service  </Description>  

    <transports> 
        <transport>HTTP</transport>
    </transports>
    
    <schema schemaNamespace="schema namespace"/> 
     
    <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </messageReceivers>
     
    <parameter name="ServiceClass" locked="xsd:false">org.apache.axis2.sample.echo.EchoImpl</parameter>
    
    <operation name="echoString" mep="operation MEP"> 
        <actionMapping>Mapping to action</actionMapping>
        <module ref=" a module name "/>
        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </operation>
</service>

name: The service name will be the name of the archive file if the .aar file contains only one service, or else the name of the service will be the name given by the name attribute.

scope: (Optional Attribute) The time period during which runtime information of the deployed services will be available. Scope is of several types- "application", "soapsession", "transportsession", "request". The default value (if you don't enter any value) will be "request"

class: (Optional attribute) The full qualified name of the service lifecycle implementation class. ServiceLifeCycle class is useful when you want to do some tasks when the system starts and when it shuts down.

targetNamespace: (Optional Attribute) Target name space of the service. This value will be used when generating the WSDL. If you do not specify this value, the value will be calculated from the package name of the service impl class.

Description: (Optional) If you want to display any description about the service via Axis2 web-admin module, then the description can be specified here.


transports :
(Optional) The transports to which the service is going to be exposed. If the transport element is not present, then the service will be exposed in all the transports available in the system. The transport child element specifies the transport prefix (the name of the transport specified in axis2.xml).


parameters:
A services.xml can have any number of top level parameters and all the specified parameters will be transformed into service properties in the corresponding AxisService. There is a compulsory parameter in services.xml called ServiceClass that specifies the Java class, which performs the above transformation. This class is loaded by the MessageReceiver.


operations :
If the service impl class is Java, then all the public methods in that service will be exposed. If the user wants to override it, he has to add the "operation" tag and override it. In a non-Java scenario or if you do not have a service class, then all the operations the user wants to expose by the service has to be indicated in the services.xml. It is specified as follows:

<operation name="echoString">
    <module ref=" a module name "/>
    <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
</operation>

 The only compulsory attribute here is "name", which represents the operation name that is going to be exposed. Any operation can contain module references as well as any number of parameters. The most interesting thing is that you can register custom message receivers per operation. Then the registered message receiver will be the message receiver for the corresponding operation. If you do not specify the message receiver, then the default message receiver will perform the operation.

 

 

 

分享到:
评论

相关推荐

    Axis2之使用services.xml发布带包的Webservice

    NULL 博文链接:https://zxs19861202.iteye.com/blog/635903

    webservice3 使用services.xml发布webservice

    webservice3 使用services.xml发布webservice

    用services.xml以jar或aar格式发布webservice步骤(图解)

    用services.xml以jar或aar格式发布webservice步骤(图解)

    Apache Axis2 Web Services, 2nd Edition.pdf

    Chapter 3, Axis2 XML Model (AXIOM) - Learn about the heart of a web service framework and learning more about XML processing in Axis2. Chapter 4, Execution Chain - Learn how to extend the core ...

    Building a JSON web service with Java and Axis2

    4.Add the DynamicResponseHandler module reference to the axis2.xml configuration (located in WEB-INF/conf): &lt;module ref="DynamicResponseHandler"/&gt; 5.Add the JSON Message formatters to the axis2....

    axis2和spring结合发布WebService

    axis2和spring结合发布WebService源码

    Apache Axis2 Web Services, 2nd

    Learn all about AXIOM - the complete XML processing framework, which you also can use outside Axis2. Covers advanced topics like security, messaging, REST and asynchronous web services. Written by ...

    axis2 for c++ 1.6

    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 ...

    Axis2创建服务端实例

    1.Axis2创建服务端实例:一种是用axis2插件通过实现class生成的myServer.aar,另一种是通过手写services.xml然后用jar -cvf Axis2Server.aar生成的服务,发布的区别。 2.其实把myServer.aar里面的class删掉照样ok,...

    axis2c-src-1.6.0

    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 ...

    axis2与spring集成

    axis2与spring的集成,在application中配置要发布的Java类,然后配置aar文件,在aar打包文件中的services.xml要嵌入 &lt;parameter name="ServiceObjectSupplier"&gt;org.apache.axis2.extensions.spring.receivers....

    axis2 教程_个人备用文档

    使用services.xml文件发布WebService 4. 二进制文件传输 5. 会话(Session)管理 6. 跨服务会话(Session)管理 7. 将Spring的装配JavaBean发布成WebService 8. 异步调用WebService 9. 编写Axis2模块(Module)...

    Axis2教程 包含描述目录的内容

    使用services.xml文件发布WebService 4. 二进制文件传输 5. 会话(Session)管理 6. 跨服务会话(Session)管理 7. 将Spring的装配JavaBean发布成WebService 8. 异步调用WebService 9. 编写Axis2模块...

    WebService大讲堂之Axis2

    WebService大讲堂之Axis2(3):使用services.xml文件发布WebService ................................................ 14 WebService大讲堂之Axis2(4):二进制文件传输 .............................................

    (原创)用Eclipse + Axis2+Tomcat创建Web Service

    (熬夜做成,希望多多看看,有一处错误,把...2.2 创建services.xml。 2.3 发布服务。 2.4 在浏览器上测试服务。 三、 Web Service 客户端的创建。 3.1 创建WSDL文件。 3.2 利用WSDL创建stub。 3.3 利用stub类测试服务。

    axis2-1.4.1及教程

    3):使用services.xml文件发布WebService 4):二进制文件传输 5):会话(Session)管理 6):跨服务会话(Session)管理 7):将Spring的装配JavaBean发布成 8):异步调用WebService 9):编写Axis2模块(Module) 10):...

    使用axis2创建webservice步骤以及客户端调用service服务代码

    使用axis2创建webservice步骤以及客户端调用service服务代码,如何编写和发布WebService,如何使用services.xml配置文件发布,如何用Java实现调用WebService的客户端程序等等

    axis2-162-war和axis2-162-bin

    Axis2 是 Apache 提供的一款第三方 Web Services 引擎,与其前身 Apache Axis 相比, axis2 更加高效、模块化,也更面向于 XML 的组织。经过精心的设计, axis2 提供了更加便利的模块添加功能。 基于新的体系结构...

    Axis2发布和调用webservice

    描述了axis2如何发布webservice,如果是用MyEclipse来发布,需要安装插件,把你发布后的.aar文件放 入/web/WEB-INF/services/目录中就能被访问和调用,有点繁琐,但axis2功能十分强大,方法的返回类型不仅可 以用...

    AXIS2大讲堂文档

    文档3 使用services.xml发布webservice 文档4 二进制文件读取 文档5 会话管理 文档6 跨越session管理 文档7 spring的bean发布为webservice 文档8 异步调用webservice 文档9 编写axis模块 文档10 使用moniter...

Global site tag (gtag.js) - Google Analytics