`
chelsea
  • 浏览: 117903 次
  • 来自: ...
社区版块
存档分类
最新评论

Axis : 远去前的备忘

 
阅读更多

1, 使用

 

1.1 axis本身可以servlet的形式集成到任何支持servlet的Web容器(web.xml)

<servlet>

<display-name>Apache-Axis Servlet</display-name>

<servlet-name>AxisServlet</servlet-name>

<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>

</servlet>

1.2 当然需要让Web容器找到 org.apache.axis.transport.http.AxisServlet

将axis所需库和资源配置到classpath里面, 或者将axis的lib目录拷贝到WEB-INFO下

1.3 然后让axis接管WebService的url(web.xml)

<servlet-mapping>

<servlet-name>AxisServlet</servlet-name>

<url-pattern>*.jws</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>AxisServlet</servlet-name>

<url-pattern>/services/*</url-pattern>

</servlet-mapping>

1.4 剩下的只需要告诉axis每个WebService对应着哪个Java类即可(server-config.wsdd(与web.xml同目录))

<service name="OrganizationWebService" type="" provider="java:RPC" style="rpc" use="encoded">

<parameter name="scope" value="Request" />

<parameter name="className" value="nucleus.organization.webservice.OrganizationWebService" />

<parameter name="allowedMethods" value="isValid, personOfID, personsOfRole, queryCategories, queryPersons" />

<namespace>http://webservice.organization.nucleus</namespace>

<typeMapping encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns1:CategoryInfo"

languageSpecificType="java:nucleus.organization.webservice.CategoryInfo"

serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"

deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"

name="CategoryInfo" xmlns:ns1="http://webservice.organization.nucleus" />

</service>

 

2, 配置与扩展

 

2.1 Handlers

2.1.1 Query String Handlers

By default, Axis provides for three Axis servlet query string handlers (?list, ?method, and ?wsdl).

2.1.2 Some Default Handlers

JAXRPCHandler

Wrapper around JAX-RPC compliant handlers that exposes an Axis handler interface to the engine.

 
HTTPSender

A Handler which sends the request message to a remote server via HTTP, and collects the response message.

 
LocalSender

A Handler which sends the request message to a "local" AxisServer, which will process it and return a response message. This is extremely useful for testing, and is by default mapped to the "local:" transport. So, for instance, you can test the AdminClient by doing something like this:

% java org.apache.axis.client.AdminClient -llocal:// list

2.1.3 Service, Targeted Chain, and Provider

A service is a special kind of Targeted Chain in which the pivot Handler is known as a "provider".

 

2.2 Configuration

2.2.1 Engine Configuration

The EngineConfiguration interface is the means of configuring the Handler factories and global options of an engine instance. An instance of a concrete implementation of EngineConfiguration must be passed to the engine when it is created and the engine must be notified if the EngineConfiguration contents are modified. The engine keeps a reference to the EngineConfiguration and then uses it to obtain Handler factories and global options.

The EngineConfiguration interface belongs to the Message Flow subsystem which means that the Message Flow subsystem does not depend on the Administration subsystem.

The EngineConfiguration is provided by an implementation of the interface org.apache.axis.EngineConfigurationFactory, which currently provides methods that return client and server configurations.

Our focus will be how to define the implementation class for EngineConfigurationFactory.

  • Justification/Rationale
    While the default behaviour is sufficient for general use of Axis, integrating Axis into an existing application server may require an alternate deployment model. A customized implementation of the EngineConfigurationFactory would map from the hosts deployment model to Axis's internal deployment model.

  • Mechanism
    The relevant sequence of instructions used to obtain configuration information and initialize Axis is as follows:

      EngineConfigurationFactory factory = EngineConfigurationFactoryFinder(someContext);
      EngineCongfiguration config = factory.getClientEngineConfig();
      AxisClient = new AxisClient(config);

    The details may vary (server versus client, whether other factories are involved, etc). Regardless, the point is that integration code is responsible for calling EngineConfigurationFactoryFinder(someContext) and ensuring that the results are handed to Axis. someContext is key to how the factory finder locates the appropariate implementation of EngineConfigurationFactory to be used, if any.

    EngineConfigurationFactoryFinder works as follows:

    • Obtain a list of classes that implement org.apache.axis.EngineConfigurationFactory, in the following order:

      • The value of the system property axis.EngineConfigFactory.

      • The value of the system property org.apache.axis.EngineConfigurationFactory.

      • Locate all resources named META-INF/services/org.apache.axis.EngineConfigurationFactory. Each line of such a resource identifies the name of a class implementing the interface ('#' comments, through end-of-line).

      • org.apache.axis.configuration.EngineConfigurationFactoryServlet

      • org.apache.axis.configuration.EngineConfigurationFactoryDefault


       
    • Classes implementing EngineConfigurationFactory are required to provide the method

        public static EngineConfigurationFactory newFactory(Object)

      This method is called, passing someContext as the parameter.

    • The newFactory method is required to check the someContext parameter to determine if it is meaningfull to the class (at a minimum, verify that it is of an expected type, or class) and may, in addition, examine the overall runtime environment. If the environment can provide information required by an EngineConfigurationFactory, then the newFactory() may return in instance of that factory. Otherwise, newFactory() must return null.

    • EngineConfigurationFactoryFinder returns the first non-null factory it obtains.

  • Default behavior
    The default behaviour is provided by the last two elements of the list of implementing classes, as described above:

    • org.apache.axis.configuration.EngineConfigurationFactoryServlet
      newFactory(obj) is called. If obj instanceof javax.servlet.ServletContext is true, then an instance of this class is returned.

      The default Servlet factory is expected to function as a server (as a client it will incorrectly attempt to load the WSDD file client-config.wsdd from the current working directory!).

      The default Servlet factory will open the Web Application resource /WEB-INF/server-config.wsdd (The name of this file may be changed using the system property axis.ServerConfigFile):

      • If it exists as an accessible file (i.e. not in a JAR/WAR file), then it opens it as a file. This allows changes to be saved, if changes are allowed & made using the Admin tools.

      • If it does not exist as a file, then an attempt is made to access it as a resource stream (getResourceAsStream), which works for JAR/WAR file contents.

      • If the resource is simply not available, an attempt is made to create it as a file.

      • If all above attempts fail, a final attempt is made to access org.apache.axis.server.server-config.wsdd as a data stream.

       

    • org.apache.axis.configuration.EngineConfigurationFactoryDefault
      newFactory(obj) is called. If obj is null then an instance of this class is returned. A non-null obj is presumed to require a non-default factory.

      The default factory will load the WSDD files client-config.wsdd or server-config.wsdd, as appropriate, from the current working directory. The names of these files may be changed using the system properties axis.ClientConfigFile and axis.ServerConfigFile, respectively.

Example, In some start up method(): properties.put("axis.EngineConfigFactory", "com.our.ws.CustomFactory");

public class CustomFactory implements EngineConfigurationFactory {

public EngineConfiguration getClientEngineConfig();

public EngineConfiguration getServerEngineConfig();

public static EngineConfigurationFactory newFactory(Object param);
}

2.2.2 WSDD

The server is configured (by default) by values in the server-config.wsdd file, though a dedicated Axis user can write their own configuration handler, and so store configuration data in an LDAP server, database, remote web service, etc. Consult the source on details as to how to do that. You can also add options to the web.xml file and have them picked up automatically. We don't encourage that as it is nice to keep configuration stuff in one place.

The internal data model used by Axis is based on an Axis specific data model: Web Services Deployment Descriptor (WSDD). Axis initially obtains the WSDD information for a service from an instance of org.apache.axis.EngineConfiguration.

WSDD Configuration: Configuration based on wsdd, but not server-config.wsdd file, it can be dynamic/further configured by Admin.deploy()

2.2.3 WSDL2Java

This tool takes a description of a web service written in WSDL and emits Java artefacts used to access the web service.

There are three layers inside the tool:

  • framework: SymbolTable, Emitter, WriterFactory

  • WSDL2Java plugin to the framework: WSDL2Java (the main), JavaWriterFactory, and all the WSDL-relative writers: JavaPortTypeWriter, JavaBindingWriter, etc.

  • The actual WSDL2Java emitters, one for each file generated: JavaInterfaceWriter, JavaStubWriter, etc.

  • So: public class WSDL2Java extends org.apache.axis.wsdl.WSDL2Java{
    public WSDL2Java() {
    super();
    getParser().setFactory(new CustomizedJavaGeneratorFactory(getParser()));
    }

-T, --typeMappingVersion:

indicate 1.1 or 1.2. The default is 1.1 (SOAP 1.1 JAX-RPC compliant. 1.2 indicates SOAP 1.1 encoded.) http://issues.apache.org/jira/browse/AXIS-2467

-W, --noWrapped

This turns off the special treatment of what is called "wrapped" document/literal style operations. By default, WSDL2Java will recognize the following conditions:

  • If an input message has is a single part.

  • The part is an element.

  • The element has the same name as the operation

  • The element's complex type has no attributes

 

分享到:
评论

相关推荐

    axis完整jar包共10个 费了很大劲收集的呀

    6. 使用Axis:开发者可以使用Axis生成服务端的Web服务,通过Java类和接口定义服务,然后 Axis会自动生成WSDL文件,描述服务的接口和绑定。客户端可以通过WSDL文件来消费服务,Axis会自动将SOAP消息转化为Java方法...

    axis2客户端调用webService接口,精简jar包

    在IT行业中,Web服务是应用程序之间进行通信的一种标准方法,而Axis2是Apache软件基金会开发的一个Web服务框架,专门用于创建和消费Web服务。本文将深入探讨如何使用Axis2客户端调用WebService接口,并且会特别关注...

    axis1.4带lib包java开发webservice客户端和服务端

    标题 "axis1.4带lib包java开发webservice客户端和服务端" 涉及到的是一个基于Java的Web服务开发工具包,Axis1.4,它包含必要的库文件(lib)来支持创建和消费Web服务。这个压缩包是为MyEclipse集成开发环境设计的,...

    apache axis-1.7.9

    Apache Axis2是Apache软件基金会开发的一个开放源代码Web服务框架,用于构建和部署高效、可扩展的Web服务。它基于Axis1.x进行重大改进,提供了更强大的功能和更好的性能。在"apache axis-1.7.9"这个版本中,我们获取...

    axis1.1所需全部jar

    标题“axis1.1所需全部jar”指的是 Axis 1.1 版本的Web服务开发框架所需的全部Java Archive (JAR) 文件集合。Axis是一个开源的、基于Java的Web服务工具包,它允许开发者创建、部署和使用Web服务。这个压缩包包含了一...

    zynq-axis:Zynq AXI DMA接口的硬件,Linux驱动程序和库

    Zynq AXIS:完整的DMA系统 此存储库包含使用Xilinx的Zynq FPGA建立基于DMA的项目所需的所有组件。 首先,有一个称为AXIS的硬件模块,可连接到高性能AXI接口端口。 其次,有一个Linux UIO驱动程序,可将低级AXIS控制...

    axis-jaxrpc-1.2-rc3.jar

    官方版本,亲测可用

    react-axis:为React构建的Axis组件

    目前支持: 通用Axis组件支持对数,功率和线性刻度支持比例之间的动画可以以不同的方式定位更具体的TimeAxis组件支持任意时区支持比例之间的动画自定义格式功能我们将把它合并到。 一旦发生这种情况,我们将其升级...

    verilog-axis:用于FPGA实现的Verilog AXI流组件

    axis_adapter模块桥接不同宽度的AXI流总线。 该模块是可参数化的,但是有某些限制。 首先,总线字的宽度必须相同(例如,一个8位通道和8个8位通道,但不能一个16位通道和一个32位通道)。 其次,总线宽度必须以整数...

    axis1.4和axis2相关jar文件

    在Java世界中,Apache Axis是用于构建Web服务和客户端应用程序的工具包,它允许开发者将Java类暴露为Web服务,并且能够消费其他Web服务。Axis分为两个主要版本:Axis1和Axis2,这两个版本在功能、性能和设计上都有所...

    eclipse java axis2

    Eclipse Java Axis2 是一个基于Java的Web服务开发框架,由Apache软件基金会开发。它主要用于构建和部署SOAP(简单对象访问协议)Web服务。在Java环境中,Eclipse作为流行的集成开发环境(IDE),提供了强大的支持来...

    axis:用JavaScript编写的有趣而无用的玩具语言

    Axis是用JavaScript编写的有趣且无用的玩具语言。 Axis是一种多范式,脚本化的,可选的面向对象的命令式编程语言。 Axis源使用标准的Node.js CLI二进制文件执行,最终通过Google的V8引擎进行JIT编译。 通过Node.js...

    Axis_API和axis2_API

    在IT行业中,Web服务是应用程序之间进行通信的一种标准方法,而Axis和Axis2是两种流行的Java SOAP(简单对象访问协议)框架,用于构建和消费Web服务。本文将深入探讨这两个API,以及它们在Web服务开发中的作用。 ...

    Axis实践之Axis入门

    【Axis实践之Axis入门】 Axis是一个流行的开源SOAP(Simple Object Access Protocol)库,它允许开发者在Java平台上构建和部署Web服务。本篇文章将带你逐步了解如何在Tomcat服务器上安装和配置Axis,以便开始你的...

    AxisLib1.4.rar(包括wsdl4j)

    标题中的“AxisLib1.4.rar(包括wsdl4j)”指的是一个压缩包文件,其中包含了Axis库的1.4版本以及wsdl4j库。这两个组件在IT领域,特别是Web服务开发中扮演着重要角色。 Axis是Apache软件基金会开发的一个开放源代码...

    axis2-1.7.7-bin.zip下载

    Apache Axis2是基于Java的Web服务引擎,它允许开发者创建、部署和管理Web服务。Axis2是Apache SOAP(Simple Object Access Protocol)项目的第二代产品,提供了高性能、灵活且可扩展的框架,支持多种协议,包括SOAP...

    ApacheAxis系统架构及Axis设计基本原理.pdf

    Apache Axis 系统架构及Axis 设计基本原理 Apache Axis 是一个基于 Java 的 SOAP 服务器和客户端框架,提供了一个灵活的架构来实现 Web 服务。 Axis 系统架构由多个协同工作的子系统组成,每个子系统负责不同的任务...

    d3-axis:易于阅读的磅秤参考标记

    如果使用NPM,则npm install d3-axis 。 否则,请下载。 您也可以作为或一部分直接从加载。 (要有用,您还需要使用和 ,但是它们是软性依赖项。)支持AMD,CommonJS和普通环境。 在香草中,将导出d3全局变量: &lt...

    axis 1.x与axis2.x开发

    Axis是Apache组织开发的一款开源Web服务框架,主要用于构建和部署SOAP(Simple Object Access Protocol)服务。Axis分为两个主要版本:Axis1.x和Axis2.x,它们都是Java平台上的Web服务实现,但在设计和功能上有所...

    axis和axis2的一些发布差异(WSDL2Java) 收藏

    ### Axis与Axis2在WSDL2Java工具中的发布差异 #### 概述 本文将详细介绍Axis与Axis2在使用WSDL2Java工具进行服务发布的差异性。这两种工具都是Apache项目的一部分,它们为开发者提供了强大的Web服务支持。其中,...

Global site tag (gtag.js) - Google Analytics