这个类有地方要注意,一种简单的方法就是这个类的编写要符合Java Bean规范(主要也就是get、set方法),然后通过类似 <beanMapping languageSpecificType="java:com.iconsh.miis.vo.config.group.GroupVO" qname="ns1:GroupVO" mlns:ns1="http://iconsh.com/miis/config/group"/>这样的标记进行注册。当然也有另外的方法,但这种方法将全很麻烦,但效率可能会更好,这种方法要编写serializer class 实现org.apache.axis.encoding.Serialize,编写serializer factory class实现org.apache.axis.encoding.SerialzerFactory,编写deserializer class和deserializer factory class,并通过TypeMapping元素进行注册。
解决方案 »
- Extjs中的comboBox从远程获取的数据无法显示的问题?
- java类的继承有实例的区别 主要的问关于两者占内存的区别
- hibernate 的一些初级问题
- 关于Cron表达式的问题
- 求助!!!sql server 2005,jsp ,jdbc数据库之间的连接
- javamail 发送邮件报错,急~~~~
- 想在Java方面有一个大的提高,不知道各位有什么想法,都来说说
- 大家有没碰过这样的问题:同一个bean 在java启动板里可以正常运行,但在服务器中就报错,说找不到oracle.jdbc.driver.OracleDriver??
- Spring整合Hibernate,取不到hibernateTemplate的值,求助!
- java.io.IOException: Attempted read on closed stream.
- SilverStream AppServer那位大虾有哈
- JDBC问题
Apache SOAP uses type mappings to determine how Java datatypes should be marshalled to/unmarshalled from XML so that they can be transmitted on/received from the wire. The type mappings are stored in a type mapping registry, with the default registry being org.apache.soap.encoding.SOAPMappingRegistry.Each type mapping carries several pieces of information: a URI describing the encoding style (i.e. http://schemas.xmlsoap.org/soap/encoding/,) a qualified name (QName) for the XML element (i.e. http://www.w3.org/2001/XMLSchema:int,) the Java class to be encoded from/decoded to, the name of the Java class to act as the serializer, and the name of the Java class to act as the deserializer. The Java classes acting as serializers/deserializers must implement org.apache.soap.util.xml.Serializer and org.apache.soap.util.xml.Deserializer, respectively.To make life a little easier, a set of type mappings has been predefined and registered into the SOAPMappingRegistry for the SOAP encoding style. These include mappings for the following Java types:most Java primitive types, such as int, float, boolean, byte, etc. and their corresponding wrapper classes (i.e. java.lang.Integer, java.lang.Boolean, etc.)
Java arrays
java.lang.String
java.util.Date
java.util.GregorianCalendar
java.util.Vector
java.util.Hashtable
java.util.Map (under Java editions in which this is supported)
java.math.BigDecimal
javax.mail.internet.MimeBodyPart
java.io.InputStream
javax.activation.DataSource
javax.activation.DataHandler
org.apache.soap.util.xml.QName
org.apache.soap.rpc.Parameter
java.lang.Object (a deserializer for null objects only)
The SOAPMappingRegistry also provides a type mapping to encode org.apache.soap.rpc.Parameters in the literal XML encoding style, and a set of mappings to encode types supported by the IBM XMI Framework in the XMI encoding style.If you want to pass your own objects as parameters to SOAP RPC services, then you will need to register new type mappings (and possibly create your own serializers/deserializers.) Remember that you will need to register the new type mappings on both the server and the client sides.Registering Type Mappings on the Server
There are two main ways to register type mapping information into an Apache SOAP server:Registering them via the deployment descriptor.
Overriding the default mapping registry with a registry that has your new type mappings pre-registered.
The first way is probably the easiest to implement and manage, but it does require that you replicate the mapping information in each deployment descriptor that needs it. For more information on registering type mapping information via a deployment descriptor, look here.The second mechanism requires a little more work, but allows you to limit the amount of additional information that you need to put into each deployment descriptor. In addition, the same mapping registry may be used on the client side, and thus may cut down on the amount of additional code that must be written for the client. The new registry must be a subclass of the SOAPMappingRegistry. For information about overriding the default mapping registry, look here.Registering Type Mappings on the Client
As is the case with the server, on the client there are also two main ways to register type mapping information:Create an instance of the SOAPMappingRegistry and use the mapTypes(...) method to add new mappings.
Create an instance of a subclass of the SOAPMappingRegistry that already has your mappings pre-registered.
The first way is probably the easiest to do, but if you have to use the same type mappings in multiple different clients or if you are also implementing the server-side as well, then the second method may save you a little bit of coding.The Bean Serializer/Deserializer
In many cases, even if there is not a default type mapping for the object that you are trying to transmit, you still may not need to create a new serializer/deserializer. Apache SOAP comes with a Java Bean Serializer/Deserializer that may suit your needs. The org.apache.soap.encoding.soapenc.BeanSerializer can be used to serialize and deserialize JavaBeans using the SOAP encoding style. The public properties of the bean will become named accessors (elements) in the XML form. To use the BeanSerializer, simply pass "org.apache.soap.encoding.soapenc.BeanSerializer" as the last two parameters when you are registering the type mapping for your object.Note: The object that you are serializing with the BeanSerializer MUST be a JavaBean for this serializer to work:It MUST have a no-args constructor
It MUST expose all interesting state through properties
It MUST not matter what order the accessors for the properties (i.e. the setX/getX methods) are in
etc.
This is NOT a general/all-purpose serializer. It WILL NOT work if the object which you are serializing/deserializing does not conform to the JavaBeans definition. It is NOT a bug if you cannot serialize/deserialize your non-Bean, Java class with this, any more than it is a bug that you can't serialize a java.awt.Panel with the java.util.Date serializer. Creating New Serializers and Deserializers
If you need to create a new serializer/deserializer, then looking at the source code for the predefined ones will probably provide you with the best guidance. Remember that they will need to implement org.apache.soap.util.xml.Serializer and org.apache.soap.util.xml.Deserializer respectively. You can implement them both in the same class, or use two different classes, it really makes no difference.Last updated 5/21/2001 by Bill Nagy <[email protected]>.