Discussion:
[jira] [Commented] (AXIS-2307) wsdl2java does no longer generate Java classes for simple WSDL types
Eliran Mesika (JIRA)
2018-10-02 13:09:00 UTC
Permalink
[ https://issues.apache.org/jira/browse/AXIS-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635456#comment-16635456 ]

Eliran Mesika commented on AXIS-2307:
-------------------------------------

 i manage to overcome the issue in 1.4 version by creating JavaBeanWriter.java and override writeSimpleConstructors function.

Note : i needed to add string constructor only for token type




protected void writeSimpleConstructors() {

// If this is a simple type,need to emit a string
// constructor and a value construtor.
if (!type.isSimpleType())
return;

pw.println(" // " + Messages.getMessage("needStringCtor"));

// Simple types without simpleValueTypes are derived classes.
// Inherit the simple constructor.
if (simpleValueTypes.size() == 0) {
if (extendType != null) {
// Find the java type of the most base type.
TypeEntry baseType = type;
while (true) {
TypeEntry superType = SchemaUtils.getBaseType(baseType,
emitter.getSymbolTable());
if (superType == null)
break;
else
baseType = superType;
}

String baseJavaType = baseType.getName();

pw.println(" public " + className + "(" + baseJavaType
+ " _value) {");
pw.println(" super(_value);");
pw.println(" }");
pw.println();

// This relevant part created in Surecomp to fix axis 1.4 problem creating String constructor for PKO Token type like CurrencyCodeDict
if (baseJavaType.equals("org.apache.axis.types.Token")) {
pw.println(" // this constructor create manually by  me to avoid missing String constructor" );
pw.println(" public " + className
+ "(java.lang.String _value ) {");
pw.println(" super(_value);");
pw.println(" }");
pw.println();
}

}
} else if (isUnion()
|| simpleValueTypes.get(0).equals("java.lang.String")) {
pw.println(" public " + className
+ "(java.lang.String _value) {");
pw.println(" this._value = _value;");
pw.println(" }");
int i = 0;
for (Iterator iterator = simpleValueTypes.iterator(); iterator
.hasNext();) {
String typeName = (String) iterator.next();

if (typeName.equals("java.lang.String")) {
i += 2;
continue;
}

String capName = "_value";
if (isUnion()) {
// names and simpleValueTypes should match as
// union is over simple types
String name = (String) names.get(i + 1);
capName = Utils.capitalizeFirstChar(name);
}

pw.println(" public " + className + "(" + typeName
+ " _value) {");
pw.println(" set" + capName + "(_value);");
pw.println(" }");
pw.println();
i += 2;
}
} else if (simpleValueTypes.size() == 1) {
pw.println(" public " + className + "("
+ simpleValueTypes.get(0) + " _value) {");
pw.println(" this._value = _value;");
pw.println(" }");
pw.println(" public " + className
+ "(java.lang.String _value) {");
writeSimpleTypeGetter((String) simpleValueTypes.get(0), null,
"this._value =");
pw.println(" }");
pw.println();
}
}

 
wsdl2java does no longer generate Java classes for simple WSDL types
--------------------------------------------------------------------
Key: AXIS-2307
URL: https://issues.apache.org/jira/browse/AXIS-2307
Project: Axis
Issue Type: Bug
Affects Versions: 1.2, 1.2.1, 1.3
Environment: Windows XP, BEA Weblogic, Java 1.4
Reporter: Matthias Burbach
Priority: Critical
Attachments: 18Nov05.wsdl, test.wsdl
I observed that in contrast to Axis 1.1 wsdl2java does no longer generate Java classes for simple WSDL types in Axis 1.2 and above anymore.
<xs:simpleType name="anrede">
<xs:restriction base="xs:int">
<xs:minInclusive value="0">
</xs:minInclusive>
<xs:maxInclusive value="2">
</xs:maxInclusive>
</xs:restriction>
</xs:simpleType>
wsdl2java of Axis 1.1 generated a Java class Anrede.java from this bit.
Axis 1.1 XML requests referencing this type look as follows (extraction): <anrede xsi:type="n1:anrede">0</anrede>
wsdl2java of Axis 1.2, however does **not** generated a Java class Anrede.java from this bit.
Axis 1.2 XML requests, on the contrary, referencing this type look as follows (extraction): <anrede xsi:type="xsd:int">0</anrede>
This difference causes the server I sent such requests to to reject requests of the latter kind:-(
Consequently, I seem to face a serious interoperability problem due to the upgrade from Axis 1.1 to Axis 1.2. The problem remains when using Axis 1.2.1 or Axis 1.3.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Loading...