Axis 备忘录

See Also: <<Essential Web Services: SOAP, WSDL, UDDI>>

What is Axis?

Axis is essentially a SOAP engine -- a framework for constructing SOAP processors such as clients, servers, gateways, etc. But Axis isn't just a SOAP engine -- it also includes:

  • a simple stand-alone server,

  • a server which plugs into servlet engines such as Tomcat,

  • extensive support for the Web Service Description Language (WSDL),

  • emitter tooling that generates Java classes from WSDL.

  • some sample programs, and

  • a tool for monitoring TCP/IP packets.

Preliminary security extensions, which can integrate with Servlet 2.2 security/roles

An EJB provider for accessing EJB's as Web Services

Standalone version of the server (with HTTP support)

org.apache.axis.client.Call->javax.xml.rpc.Call (1.1) -> SOAP 1.1 ? 
 

WSDL support

Axis supports the Web Service Description Language, version 1.1, which allows you to easily build stubs to access remote services, and also to automatically export machine-readable descriptions of your deployed services from Axis.

 

SOAP support

SOAP 1.1/1.2 compliant engine

Preliminary support for the SOAP with Attachments specification

SOAP Encoding Datatypes: Alongside the XSD datatypes are the SOAP 'Section 5' datatypes that are all nillable, and so only ever map to the wrapper classes. These types exist because they all support the "ID" and "HREF" attributes, and so will be used when in an RPC-encoded context to support multi-ref serialization.

 

Exceptions

This is an area which causes plenty of confusion, and indeed, the author of this section is not entirely sure how everything works, especially from an interop perspective. This means treat this section as incomplete and potentially inaccurate. See also section 5.5.5 and chapter 14 in the JAX-RPC specification

RemoteExceptions map to SOAP Faults

If the server method throws a java.rmi.RemoteException then this will be mapped into a SOAP Fault. The faultcode of this will contain the classname of the fault. The recipient is expected to deserialize the body of the fault against the classname.

Exceptions are represented as wsdl:fault elements

If a method is marked as throwing an Exception that is not an instance or a subclass of java.rmi.RemoteException, then things are subtly different. The exception is no longer a SOAP Fault, but described as a wsdl:fault in the WSDL of the method. According to the JAX-RPC specification, your subclass of Exception must have accessor methods to access all the fields in the object to be marshalled and a constructor that takes as parameters all the same fields (i.e, arguments of the same name and type). This is a kind of immutable variant of a normal JavaBean. The fields in the object must be of the datatypes that can be reliably mapped into WSDL.

If your exception meets this specification, then the WSDL describing the method will describe the exception too, enabling callers to create stub implementations of the exception, regardless of platform.

 

Query String Handlers

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

 

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值