DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18081>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18081

org.w3c.dom.* classes not handled properly in Java2WSDL

           Summary: org.w3c.dom.* classes not handled properly in Java2WSDL
           Product: Axis
           Version: 1.1rc2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WSDL processing
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Running the following code through Java2WSDL generates the error: 

"- The class org.w3c.dom.Document does not contain a default constructor, which 
is a requirement for a bean class.  The class cannot be converted into an xml 
schema type. An xml schema anyType will be used to define this class in the 
wsdl file.WSDLException: faultCode=OTHER_ERROR: Can't find prefix 
for 'http://dom.w3c.org'. Namespace prefixes must be set on the Definition 
object using the addNamespace(...) method.:"

===================================

package test.hello;

import org.w3c.dom.Document;

public class Test {

  public Document getDocument() {
    return null;
  }

}

===================================

While this could be worked around using custom namespace mappings, etc, I 
personally think that org.w3c.dom.Document and org.w3c.dom.Element objects 
should automatically be mapped to xsd:anyType.

This error can be temporarily worked around by adding the following code to 
org.apache.axis.wsdl.fromJava.Emitter:

Line #     Code
===========================================================================
679        def.addNamespace("w3c", "http://dom.w3c.org";);
680        namespaces.putPrefix("http://dom.w3c.org";, "w3c");
===========================================================================

As I do not think this is the proper long term solution, I'd rather not make 
this change.  I suggest that for Axis 1.2, we look at doing the work necessary 
to properly map Document and Element objects to xsd:anyType.

Reply via email to