Hi,

I have been working on extending the doc/literal implementation in Axis to 
handle the processing of arbitrary XML fragments defined as xsd:any 
namespace="##any" in a more flexible manner. I would be grateful if someone 
from the committer team could have a look at it and commit it to the Axis 
code base. I have made my changes to a version of Axis checked out earlier 
today, and I have run all the functional tests successfully with my patches 
applied.

You can download the files I had to modify from here:
http://www.mcs.anl.gov/~sandholm/axis/axis-literal-patch.zip

Please feel free to email me or call me if you need more details on why the 
various changes had to be made.

(1) Summary of files modified:

org/apache/axis/wsdl/WSDL2Java.java
org/apache/axis/wsdl/toJava/Emitter.java
org/apache/axis/wsdl/toJava/JavaInterfaceWriter.java
org/apache/axis/wsdl/toJava/JavaServiceIfaceWriter.java
org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java
org/apache/axis/wsdl/toJava/JavaStubWriter.java
org/apache/axis/wsdl/toJava/JavaImplWriter.java
org/apache/axis/wsdl/toJava/JavaSkelWriter.java
org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java
org/apache/axis/wsdl/toJava/JavaWriterFactory.java
org/apache/axis/wsdl/toJava/SchemaUtils.java
org/apache/axis/utils/resources.properties
org/apache/axis/encoding/AttributeSerializationContextImpl.java
org/apache/axis/encoding/ser/BeanSerializer.java
org/apache/axis/encoding/ser/BeanDeserializer.java
org/apache/axis/encoding/ser/ElementDeserializer.java
org/apache/axis/encoding/ser/ElementSerializer.java
org/apache/axis/message/RPCHandler.java

(2) Making client and service interface independent of encoding/binding 
mechanism used

Section 6 JAX-RPC: "The JAX-RPC specification requires that the above 
requirements based on the operation
style should be hidden from the JAX-RPC programming model. A JAX-RPC
implementation should take the responsibility for the appropriate 
representation of a
SOAP message based on the operation style."

My interpretation of this is that we would like to be able to use the same 
proxy interface for both the doc/literal and the encoded model. This is not 
possible if the Binding name is present in the interface, so I added a 
switch to WSDL2Java to allow use of the PortType name for the interface 
even in literal mode. I couldn't find anything in JAX-RPC saying that this 
model was not allowed. And in fact we just moved our entire code base from 
encoded to doc literal mode while maintaining the exact same interfaces, 
thus making the move transparent to our users.

org/apache/axis/wsdl/
-----------------------
WSD2Java.java
-added -m option to force usage of portType name for interface

org/apache/axis/wsdl/toJava/
----------------------------
Emitter.java
-added get/set maintainPortYpe variable

JavaInterfaceWriter.java
-added check for emitter getMaintainPortType

JavaServiceIfaceWriter.java
-added check for emitter getMaintainPortType

JavaServiceImplWriter.java
-added check for emitter getMaintainPortType

JavaStubWriter.java
-added check for emitter getMaintainPortType

JavaImplWriter.java
-added check for emitter getMaintainPortType

JavaSkelWriter.java
-added check for emitter getMaintainPortType

JavaTestCaseWriter.java
-added check for emitter getMaintainPortType

JavaWriterFactory.java
-added check for emitter getMaintainPortType

org/apache/axis/utils/
-----------------------
resources.properties
-added optionMaintainPortType00 message

(3) Support of <xsd:any namespace="##any"/>

org/apache/axis/wsdl/toJava/
----------------------------
SchemaUtils.java
-added any support within sequence elements - generates java.lang.Object 
member with name 'any' and empty namespace

org/apache/axis/encoding/ser/
-----------------------------
BeanSerializer.java
-suppress any namespace="##any" element tags

BeanDeserializer.java
-recognize xsd:any elements and try to desarialize them
-must callonStartElement on simple attribute deserializer otherwise QName 
deserializer will throw null pointer exception

ElementDeserializer.java
-if BeanDeserializer failed to deserialize xsd:any property serialize the 
whole xml element as is

ElementSerializer.java
-suppress any namespace="##any" element tags


(4) Recognizing Elements on the wire

org/apache/axis/message/
-----------------------
RPCHandler.java
-added check for typemappings against on the wire element QName


(4) Correctly Serializing simple types in BeanFields as XML schema 
Attributes (caused problems with Date and QName before)

org/apache/axis/encoding/ser/
-----------------------------
BeanSerializer.java
-added use of AttributeSerializationContextImpl

org/apache/axis/encoding/
--------------------------
AttributeSerializationContextImpl.java
-new file added to suppress element tag serialization for attributes and 
delegate qName2String calls to parent context

/Thomas

---
Thomas Sandholm <[EMAIL PROTECTED]>
The Globus Project(tm) <http://www.globus.org>
Ph: 630-252-1682, Fax: 630-252-1997
Argonne National Laboratory

Reply via email to