Generating WS Client from WSDL gives faulty code [message #210117] |
Mon, 10 March 2008 15:15 |
Eclipse User |
|
|
|
Originally posted by: axs.zurich.ibm.com
Hi - I have a problem generating a Web Services client from an existing
web service from its WSDL - the generated code contains errors.
The problem is that the wsdl file uses an MXMeta.xsd which contains
among other things these definitions:
<xsd:simpleType name="BooleanType">
<xsd:restriction base="xsd:boolean">
<xsd:pattern value="0|1" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="MXBooleanType">
<xsd:simpleContent>
<xsd:extension base="BooleanType">
<xsd:attribute name="changed" type="ChangeIndicatorType"
use="optional" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
From that I generate the web services client, which results in this
code in MXBooleanType.java:
public class MXBooleanType implements java.io.Serializable,
org.apache.axis.encoding.SimpleType {
private java.lang.Boolean changed; // attribute
public MXBooleanType() {
}
// Simple Types must have a String constructor
public MXBooleanType(boolean _value) {
super(_value);
}
...
which shows a compile error at the last super(_value) because there is
no such constructor for java.long.Object.
This looks like it missed to create the BooleanType, and making
MXBooleanType and extension of it. In this way, no actual boolean value
is kept anywhere ...
I tried the latest stable Europa release of Eclipse JEE
(eclipse-jee-europa-fall2-win32) and the latest build
(20080304-0640_eclipse-jee-ganymede-M5-win32.win32.x86) - both with the
same results.
I tried to fix that with two approaches:
1. fix the MXMeta.xsd to read:
<xsd:complexType name="MXBooleanType">
<xsd:simpleContent>
<xsd:extension base="xsd:boolean">
<xsd:attribute name="changed" type="ChangeIndicatorType"
use="optional" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
2. add explicit code for a boolean value to the generated MXBooleanType.java
In both cases I will get compiling code, but the variable of type
MXBooleanType will still not be set correctly from the SOAP response
(which does contain values) - so somehow the machinery still doesn't
pick it up correctly.
Thanks for any help and hints!
Axel
|
|
|
|
Powered by
FUDForum. Page generated in 0.02861 seconds