views:

795

answers:

3

I have been working on a BlackBerry application that consumes web services from ColdFusion 7. The Java ME SDK and the Java Wireless Toolkit both require that the generated WSDL be of the document/literal type.

Fortunately, I have input on the web service development so I tried setting 'style="document"' in the cfcomponent tag. This generated a document/literal style WSDL but now wscompile generates the following errors in several places:

Found unknown simple type: javax.xml.soap.SOAPElement Found unknown simple type: java.util.Calendar

Any ideas why this is happening?

The WSDL does get parsed correctly by the JWSDP tool but the stubs use namespaces that are not available in the J2ME platform. I would have thought ColdFusion WSDL would work more easily with other products in the Java family.

A: 

If the service doesn't change much (so the WSDL won't change much) you can save the WSDL as a text file and modify it however you like. My suggestion -- again, assuming the service is more or less finalized -- would be to take the style declaration out of the cfcomponent tag and generate the WSDL, then save it as a plain text file and modify it as necessary to be consumed by the BlackBerry application.

Adam Tuttle
I did attempt to do that. After changing the style and use types manually, it still had all sorts of errors and I was unsure how much more would have required changing to get it to work so I abandoned that plan. I wasn't sure that was a viable long-term solution anyway.
A: 

It turns out that the issue was related to the data types of method parameters and return types that was causing the issue. The WSDL was valid and the version of wscompile for J2SE was able to parse it correctly. But due to the reduced API capabilities on the mobile platform, certain data types cannot be parsed with the J2ME version of wscompile.

I did need to keep the 'style="document"' declaration in the cfcomponent tag on the ColdFusion web service since the stub generator for J2ME will only parse document/literal type WSDL files.

http://developers.sun.com/mobility/midp/articles/webservices/ provides a reference for the data types supported in JAX-RPC for Java ME.

A: 

Hi, could you please describe in more detail how exactly you solved your problem. I am asking because I am experiencing the same (or at least similar) problem. I have apache cxf and distributed osgi on the server side (there are also other apps that consume the web services). On the client side I have a Java Mobile App and I am using the J2ME Web Services APIs (WSA), JSR 172.

What do I need to do exactly in order to be able to generate my stubs without the error : "unknown simple type: javax.xml.soap.SOAPElement".

Thanks

MrJ