Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Generating WS Client from WSDL gives faulty code
Generating WS Client from WSDL gives faulty code [message #210117] Mon, 10 March 2008 15:15 Go to next message
Eclipse UserFriend
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
Re: Generating WS Client from WSDL gives faulty code [message #1223393 is a reply to message #210117] Mon, 23 December 2013 08:53 Go to previous message
oon man is currently offline oon manFriend
Messages: 1
Registered: December 2013
Junior Member
These steps only success for retrieving data.
1. Change the WSDL file manually for every attribute from MXBooleanType type to MXStringType type.
2. Generate the WS Client
3. Retrieve the attribute value
Previous Topic:Deployment issue from glassfish 4.0 using eclipse plug-in
Next Topic:Could not publish to the server
Goto Forum:
  


Current Time: Thu Apr 25 08:18:02 GMT 2024

Powered by FUDForum. Page generated in 0.02861 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top