users@glassfish.java.net

Missing namespace in the javas generated by wsimport

From: <glassfish_at_javadesktop.org>
Date: Fri, 18 Jul 2008 13:27:57 PDT

I am using metro's wsimport to generate my java classes from a wsdl. I am getting very strange behaviour in that the namespace in the java classes are not present. The strange behaviour is that some wsdls work correctly (the namespace is present), and for others, they are not working. Editing the wsdls hasn't revealed any reasons why - editing out some elements result in the namespaces being present, where editing other elements do not. There doesn't seem to be any rhyme or reason for it (number of operations, special characters, import statements, elements, etc.)

I am using Metro 1.2 with JDK1.6.0_03, but have tried variations with Metro 1.1 and JDK1.6.0_07.

The generated java classes SHOULD look something like this:

[i]package x.x.x;
import x;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "<classname>", namespace = "http://www.company.com/namespace", propOrder = {
    "value"
})
public class classname
{...[/i]

But I am getting:
[i]@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "<classname>", propOrder = {
    "value"
})
public class classname
{...[/i]

So, the namespace is missing in the XMLType.

Any thoughts/suggestions or help would be appreciated.

ROB
[Message sent by forum member 'bobby_giesen' (bobby_giesen)]

http://forums.java.net/jive/thread.jspa?messageID=287734