Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is java.io.ObjectStreamException used in WTK stub generator for enums?
    text
    copied!<p>I am using a web service implemented in WCF which has enums defined in the interface. I am trying to call this from a Java BlackBerry client. I am using Eclipse to develop the Java application for BlackBerry. I am using the <a href="http://java.sun.com/products/sjwtoolkit/download.html" rel="nofollow noreferrer">Sun Java Wireless Toolkit</a> (WTK) 2.5.2 to generate stub code since the web service is rather large (already in use by a Windows Mobile client).</p> <p>When I try generating stub code using the WTK, I get errors in Eclipse about the enums. In the following function, it complains that java.io.ObjectStreamException cannot be resolved to a type.</p> <pre><code>private Object readResolve() throws java.io.ObjectStreamException { return fromValue(getValue()); } </code></pre> <p>When running the Stub Generator, there is a switch for either CLDC 1.0 or CLDC 1.1. Generating with both options result in the same issue.</p> <p>I found a <a href="http://forums.sun.com/thread.jspa?threadID=764788&amp;tstart=690" rel="nofollow noreferrer">forum post</a> about this at Sun with no response. The person in this post states that, "Now java.io.ObjectStreamException is not in CLDC but is in CDC instead. Is there a good tool out there for creating Stubs for Web Services for J2ME specifically CLDC 1.0/1.1 ?" I verified that it doesn't exist in CLDC 1.1 by looking at the [documentation <a href="http://java.sun.com/javame/reference/apis/jsr139/" rel="nofollow noreferrer">3</a>).</p> <p>There are two quick fixes available in Eclipse to fix this situation: 1) Create class 'ObjectStreamException' in package 'java.io' or 2) Fix project setup (which is wanting me to add a reference).</p> <p>Update:</p> <p>Here is what the JSR-172 specification says... </p> <p>5.2.5 Enumeration The JAX-RPC Subset does not provide support for XML enumerations. </p> <p>5.2.6 Simple Types Derived By Restriction The JAX-RPC Subset does not provide support for deriving simple types by restriction. </p> <p>The WSDL for the WCF enumeration generates a <code>&lt;xs:simpleType&gt;</code> with <code>&lt;xs:restriction&gt;</code> containing <code>&lt;xs:enumeration&gt;</code>. So do I just say this field is an int instead and define constants?</p> <p>Is this just a bug in the WTK? In case it was, I filed a bug report with Sun and will see if they respond. Why wouldn't the toolkit flag this as an error?</p> <p>So now I need to change the interface so that it is JSR-172 compliant. Are there tools to read WSDL and point out compliancy issues?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload