[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rampart-dev
Subject:    [jira] [Commented] (AXIS-716) Multiple code generation problems ( wrong types generated, names with 
From:       "Patrick Morton (JIRA)" <axis-dev () ws ! apache ! org>
Date:       2014-07-28 11:12:43
Message-ID: JIRA.14482.1046732394000.55221.1406545963136 () arcas
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/AXIS-716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14076118#comment-14076118 \
] 

Patrick Morton commented on AXIS-716:
-------------------------------------

Combination is shown for complicated front as common jokes are industrial to learn \
and retain this neurogenesis.  adderall prescription online \
http://www.surveyanalytics.com//userimages/sub-2/2007589/3153260/29851520/7787445-29851520-stopadd27.html \
 Presley was oddly affected by her racism and would much commonly recover.

> Multiple code generation problems ( wrong types generated, names with first cap, \
>                 attribute referneces)
> ------------------------------------------------------------------------------------------------------
>  
> Key: AXIS-716
> URL: https://issues.apache.org/jira/browse/AXIS-716
> Project: Axis
> Issue Type: Bug
> Components: WSDL processing
> Environment: Operating System: Windows NT/2K
> Platform: PC
> Reporter: msapozhn
> Attachments: ASF.LICENSE.NOT.GRANTED--TestCaseWSDL2Java.zip
> 
> 
> I have multiple problems trying to generate client subs from wsdl file. I am
> attaching all related files.
> 1.
> For the global element definition (in AxsGlobals.xsd)
> <element name="DBMAP">
> <simpleType>
> <restriction base="string">
> <maxLength value="8"/>
> </restriction>
> </simpleType>
> </element>
> DBMAP.java gets generated, but in the classes that reference this type
> (UserResponseType.java and UserRequestType.java)
> the field appears like
> private com.axsone.axis.glob.DBMAPType1 DBMAP;
> But making the type global 
> <element name="DBMAP" type="tns:DBMAP"/>
> 
> <simpleType name="DBMAP">
> <restriction base="string">
> <maxLength value="8"/>
> </restriction>
> </simpleType>
> fixes the problem.
> But similar definitions for SYS_USER and GROUP_ID inside complex type does not
> cause the problem:
> <element name="SYS_USER"  minOccurs="0">
> <simpleType>
> <restriction base="string">
> <maxLength value="3"/>
> </restriction>
> </simpleType>
> </element>
> <element name="GROUP_ID" minOccurs="0">
> <simpleType>
> <restriction base="string">
> <maxLength value="8"/>
> </restriction>
> </simpleType>
> </element>
> 2.
> Problems with referencing attributes.
> 2a. For the types that reference global attribute (in AppGlobals.xsd), e.g.
> <attribute name="FAC">
> <simpleType>
> <restriction base="string">
> <enumeration value="P"/>
> <enumeration value="S"/>
> <enumeration value="H"/>
> </restriction>
> </simpleType>
> </attribute>
> 
> <complexType name="NumericFieldType">
> <simpleContent>
> <extension base="decimal">
> <attribute ref="tns:FAC"/>
> </extension>
> </simpleContent>
> </complexType>
> results in the code generated: 
> public class NumericFieldType  implements java.io.Serializable,
> org.apache.axis.encoding.SimpleType {
> private java.math.BigDecimal value;
> public NumericFieldType() {
> }
> ?
> }
> Note: there is no field for the attribute here.
> The same true for other types with similar syntax (TextFieldType,
> PanelFieldType, etc.). 
> 2b. For the similar type with restriction
> <complexType name="FunctionFieldType">
> <complexContent>
> <restriction base="anyType">
> <attribute ref="tns:FAC"/> 
> </restriction>
> </complexContent>
> </complexType>
> FunctionFieldType class is just empty:
> public class FunctionFieldType  implements java.io.Serializable {
> public FunctionFieldType() {
> }
> ?
> }
> If I change type definition to:
> <complexType name="FunctionFieldType">
> <complexContent>
> <restriction base="anyType">
> <attribute name="FAC">
> <simpleType>
> <restriction base="string">
> <enumeration value="P"/>
> <enumeration value="S"/>
> <enumeration value="H"/>
> </restriction>
> </simpleType>
> </attribute>        
> </restriction>
> </complexContent>
> </complexType>
> again produces empty code.
> If I further change definition to extension (which is probably not correct ? I
> am not sure):
> <complexType name="FunctionFieldType">
> <simpleContent>
> <extension base="anyType">
> <attribute name="FAC">
> <simpleType>
> <restriction base="string">
> <enumeration value="P"/>
> <enumeration value="S"/>
> <enumeration value="H"/>
> </restriction>
> </simpleType>
> </attribute>        
> </extension>
> </simpleContent>
> </complexType>
> I am getting
> public class FunctionFieldType  implements java.io.Serializable,
> org.apache.axis.encoding.SimpleType {
> private java.lang.Object value;
> private com.axsone.axis.glob.app.FACType2 FAC;  // attribute
> public FunctionFieldType() {
> }
> public FunctionFieldType(java.lang.Object value) {
> this.value = value;
> }
> // Simple Types must have a String constructor
> public FunctionFieldType(java.lang.String value) {
> this.value = new java.lang.Object(value);
> }
> ?
> }
> which does not compile:
> 	Error(23,36): constructor Object(java.lang.String) not found in class
> java.lang.Object
> 2c. Similar snippet of code (this time here used extension, not restriction):
> 
> <complexType name="TabShowType">
> <simpleContent>
> <extension base="string">
> <attribute name="Show">
> <simpleType>
> <restriction base="string">
> <enumeration value="Y"/>
> <enumeration value="N"/>
> </restriction>
> </simpleType>
> </attribute>
> </extension>
> </simpleContent>
> </complexType>
> results in the right code for the attribute in the class, but with every run
> WSDL2Java creates new types: ShowType1, ShowType2, ShowType3, etc. (There is
> another definition for the Show attribute in ErrorMessageType, which produces
> Show type, this is why here ShowTypeN gets generated) 
> 3.
> Problem with element names that have first capital letter.
> It looks like AXIS creates field names in the generated by WSDL2Java code
> following Java standards with first lowercase letter (e.g. SessionID will be
> transformed to sessionID). 
> The XML name for this field is set to
> field.setXmlName(new javax.xml.namespace.QName("", "SessionId"));
> (note: here namespace is set to ""),
> but when this code in BeanDeserializer.java gets executed
> if (typeDesc != null) {      
> // Lookup the name appropriately (assuming an unqualified
> // name for SOAP encoding, using the namespace otherwise)
> String fieldName = typeDesc.getFieldNameForElement(elemQName,
> isEncoded);
> propDesc = (BeanPropertyDescriptor)propertyMap.get(fieldName);
> fieldDesc = typeDesc.getFieldByName(fieldName);
> }
> if (propDesc == null) {
> // look for a field by this name.
> propDesc = (BeanPropertyDescriptor) propertyMap.get(localName);
> }
> fieldName is null, because in the getFieldNameForElement method even though
> elemQName's and field's local parts are equal, their namespaces are not
> (elemQName has qualified namespace, field's namespace="").
> First "if" statement normally does not work for me, but second "if" statement
> usually catches this for all my other element names (which all capital), but
> cannot do it for the localName="SessionID", because property map has
> "sessionID", not "SessionID". This causes SAXException.
> This only happens on fields with first capital letter. AXIS does not modify
> field if it all caps.
> Something is wrong here: name conversion, propertyMap, handling logic or whatever.
> I didn't have this problem with 1.0. 
> I am attaching sample request and response. Response is produced by our server
> and satisfies both AXIS and .NET clients.
> I am using latest nightly build as of Feb. 27 and JDK 1.3.
> Sorry for combining all of this in one bug, but it all seems to be related and
> all could be reproduced with the same set of WSDL/XSDs.
> Thanks,
> Mike



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic