You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jeff Lawson (JIRA)" <ax...@ws.apache.org> on 2004/12/21 20:10:26 UTC

[jira] Commented: (AXIS-1737) CLONE -WSDL2Java forces use of namespace prefix in type attribute value

     [ http://nagoya.apache.org/jira/browse/AXIS-1737?page=comments#action_56939 ]
     
Jeff Lawson commented on AXIS-1737:
-----------------------------------


To get the WSDL correct for no-namespace content, ensure that there are no default namespace!

BUT when you do this, you find that WSDL2Java doesn't work correctly and ultimately cannot be debugged. Here's what I found:

Classes corresponding to the default namespace (i.e. in the default package) appear as .java files the root of the target folder rather than in the folder itself (no big deal, I've moved files before now).

Classes have erroneous package declarations of:
    package ;

The generated stub code references classes in the default package incorectly, e.g. 
    cls = ._comment.class;

when it should be:
    cls = _comment.class;

Similarly for aggregation: we see things like:
    private ._comment comment;

when it should be:
    private _comment comment;

plus similar errors that are just as easy to correct


However, J2SE 1.4 and later won't allow importation from the default package. Rather than move all the non-default package classes to the default package, I elected to create a new package called <package for stub etc.>.def and move the default package classes there. Then I can import <package for stub etc.>def elsewhere.
>From the point of view of XML, it's irrelevant which packages are used.

In deploy.wsdd:
    xmlns:ns=""
    qname="ns:>comment"
    type="java:._comment"

changed to:
    qname=">comment"
    type="java:<package for stub etc.>.def._comment"

The service deployed okay and all appeared to be well until I looked at responses in TCPMonitor and saw that a default namespace was making my non-namespace payload look like it belonged to the default namespace!

I had been importing my no-namespace XML Schema document into the WSDL file and using another namespace for wrapper elements (request/response/exception) but unfortunately, Axis likes to specify a default namespace so if part of the schema has a namespace that is used any place other than leaf nodes you've have it (unless it's possible to suppress default namespace declarations).

Upon changing WSDL to use no namespace for wrapper elements (e.g. my element ServiceExceptionReport), WSDL2Java then started to report things like:

faultCode=INVALID_WSDL: Unable to determine namespace of 'ServiceExceptionReport'

So, I back-tracked, restoring the namespace for the wrapper elements and decided that my client code was going to work okay...however, I don't hold out much hope for interoperability and I certainly don't want others to have problems with the WSDL like I had. Finally, I threw in the towel and dropped the no-namespace requirement.


> CLONE -WSDL2Java forces use of namespace prefix in type attribute value
> -----------------------------------------------------------------------
>
>          Key: AXIS-1737
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1737
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: beta-1
>  Environment: Operating System: Linux
> Platform: PC
>     Reporter: Jeff Lawson
>     Assignee: Axis Developers Mailing List

>
> It seems that WSDL2Java forces one to use a namespace prefix in at least the
> type attribute value of the message element.  It may be all type attribute
> values specified as Qnames.  According to the Namespaces In XML recommendation,
> namespace prefix for qualified names is optional.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira