You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ax...@ws.apache.org on 2004/08/11 14:04:20 UTC
[jira] Commented: (AXIS-1501) [EWS, AXIS2] A proposal for xml-to-java name mapping in Axis and EWS (WSDL --> Java)
The following comment has been added to this issue:
Author: Srinath Perera
Created: Wed, 11 Aug 2004 5:03 AM
Body:
Yes the basic idea of the jaxrpcmapping.xml file is to let the developers to map the XML names to the programming language. But here the langauge is java. I belive everybody quite agreed on how the mapping take place XML->java. It make sense to automatically generate the wsdl file.
1) EWS and jaxrpcmapping.xml file
WSDL->java conversion
now the ews need jaxrpc mapping file and wsdl or not any one. This case I accept that it is better to generate the mapping file if it does not exists. If you can fix it you are well come and I will check them in. In other case let me know your thoughts and let us decide how to do it and I will try my best to implement it.
Java -> WSDL conversion
this case the jaxrpcmapping file is generated even now.
2) I accept the fact that the real place to provide the jaxrpcmapping support is the axis code itself. Does it a axis 1.x stuff or axis 2.0 stuff?
3)
>I suggest that all the wsdl/schema name to java name mapping should >be done in one place (javifyNames() in JavaGeneratorFactory)
absolutely. ideally the codes wsdl parsing,jaxrpc-mapping and code generation should be independent and they should interact through the standard interfaces. But that would call for major revised. I like to rasied this on the Axis 2.0 summit and discuss. to me it sound like 2.0 stuff.
4)We could put RemoteException in the interface I belive. (got to check does it mess up something but I quite positive)
5) we can remove the org.apache.axis.* depndncies by generating helpers. (-H if I rember correct) will that do.
6) I am quite sure we will discuss the JAX-RPC 2.0 and JAXB 2.0 in the Axis 2.0 summit. According MHO those would be 2.x stuff as they call oupon the heavy restuctring and trying to do them by fixing some places here and there will bring down the code quality.
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/AXIS-1501?page=comments#action_37170
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1501
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1501
Summary: [EWS, AXIS2] A proposal for xml-to-java name mapping in Axis and EWS (WSDL --> Java)
Type: Improvement
Status: Unassigned
Priority: Major
Project: Axis
Components:
WSDL processing
Versions:
current (nightly)
Assignee:
Reporter: Jongjin Choi
Created: Mon, 9 Aug 2004 10:15 AM
Updated: Wed, 11 Aug 2004 5:03 AM
Description:
Dear Axis developers.
This is a proposal for support standard jax-rpc mapping (especially <java-xml-type-mapping>)
and some related issues. In this proposal, I will address only to top-down case.
(I did not arrange my thought in bottom-up case)
I'm not native english speaker so the sentence may not be fluent. Please be patient.
--------------------------------------------------------------------------------------------------------------------
1. Rationale
The JSR-109 specification requires jax-rpc mapping file for portable web services provider/requester application archive.
It is a developer's role to write the jax-rpc mapping file but it is error-prone and tedious to write a jax-rpc mapping file by hand.
it would be helpful if the JSR-109 implementation provides a facility that generates jax-rpc mapping file automatically
in both top-down (from WSDL) and bottom-up (from Java) cases.
EWS project made a big progess in implementing open-source JSR-109 implementation
and we expect that other JCP standards(JSR-181, JAX-RPC 2.0) will be integrated with Axis
based on our experience on EWS.
With additional support of Axis for java-xml mapping,
generating <java-xml-type-mapping> in EWS seems can be streamlined and
the probable code duplication between Axis and EWS will be minimized.
2. Top-down (from WSDL to Java) case
2-1. support for schema type (and nested types) and its java mapping
org.apache.axis.wsdl.symbolTable package represents the entire wsdl model
and org.apache.axis.wsdl.toJava package do all code generation tasks for symbolTable's entries.
Each entry in symbolTable has its wsdl qname(name) and its corresponding java name
and the writers in toJava package use this information when generating java code.
The mapping of wsdl name to java name is toJava.JavaGeneratorFactory's javifyNames().
The only lack in mapping is for the nested types in TypeEntry that is mapped to member of generated JavaBeans.
This nested type and JavaBean's member name mapping is done in JavaBeanWriter and/or JavaBeanHelperWriter.
I suggest that all the wsdl/schema name to java name mapping should be done in one place
(javifyNames() in JavaGeneratorFactory)
and all other writers should generate java codes without additional xml to java name mapping.
To accomplish this, we need addtional members in TypeEntry class
that represents element and attribute which is defined in the type definition in the schema.
We may also need the member for xml value for complexType
which have simpleContents with extension or recstriction xsd simpleTypes.
These are corresponding to the @XmlElement, @XmlAttribute and @XmlValue in "8.9" in JAXB 2.0 early draft.
These properties are already passed to newly created JavaBeanWriter/JavaBeanHelperWriter in current Axis source.
(getBeanWriter() in JavaTypeWriter)
Also the TypeEntry class should have the flag that its corresponding java class should be genrated or not.
2-2. JavaBeanWriter / JavaBeanHelperWriter / JavaBeanFaultWriter / JavaDefinitionWriter and some other writers
As pointed out in 2-1, if the TypeEntry has all the wsdl/xml-to-java mapping for members of its generated JavaBean,
the other writers can use the information for its code generation without additional xml-to-java name mapping
and duplicate code between writers for naming mapping can be reduced.
2-3. EWS jax-rpc mapping generation
In EWS, the generation of <java-xml-type-mapping> and its child <variable-mapping> can be simple.
We need to lookup all the Types in symbolTable (which is accessible by wsdl-to-Java emiiter object)
and check if it has generated java classes and , if it has, generate <java-xml-type-mapping> for that class.
The other information needed in <java-xml-type-mapping> like the whether it is simple, complex or anonymous type,
I think, can be acquired directly by TypeEntry.
In EWS, we need not to generate jax-rpc mapping if the wsdl-to-java emitter has input jax-rpc mapping file.
If the input jax-rpc mapping provided, we may be able to apply the wsdl/xml-to-java name mapping
using JavaGeneratorFactory and/or toJava.Emitter's wsdl naming hook.
We may need to generate java-rpc mapping if the input jax-rpc mapping is not specified
and the output jax-rpc mapping file is specifed.
3. Other portability issue
3-1. JavaBeanWriter's generated code
The code generated by JavaBeanWriter should be portable as in JSR-109.
The generated code should not include axis class if possible.
Currently it use classes below org.apache.axis.* in its generated code for some case.
3-2. JavaBeanFaultWriter / JavaDefinitionWriter's generated code
The Exception classes generated by JavaBeanFaultWriter and JavaDefinitionWriter
should be portable, i.e. it should not extend AxisFault.
It hurts the portability of the generated code from WSDL.
3-3. Integration of other technology to Axis
I think It will help Apache Beehive's JSR-181, future JAX-RPC 2.0 and JAXB 2.0 implementation to be integrated to Axis.
-----------------------------------------------------------------------------------------------------------
Currently that's all. I hope we can make a consensus for this issue.
I think that it is related to discussion topic in Axis 2.0 submit. (Tight binding between WSDL processing and code generation).
Thanks for your interest
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira