Title: WSDLException when generating DOCUMENT style WSDL

I am getting a WSDLException when generating a DOCUMENT style WSDL using java2wsdl.

Here's my Java interface:

public interface UserProvider extends java.rmi.Remote {
    public String getUser(String userId)
        throws RemoteException;
}

Here's the ant-task to generate doc-style WSDL:

    <java2wsdl
      classname="test.userservice.UserProvider"
      namespace="http://test/userservice"
      location="http://localhost:7001/services/UserService"
      >
      extraClasses=""
      output="${build.wsdl.path.unix}">
      <classpath>
        <path refid="compile.path"/>
        <pathelement location="${build.dir}"/>
      </classpath>
    </java2wsdl>

Here's the exception:

[java2wsdl] WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.
    :The value of the attribute "prefix="xmlns",localpart="tns1",rawname="xmlns:tns1"" is invalid.
    Prefixed namespace bindings may not be empty.: org.xml.sax.SAXParseException:
    The value of the attribute "prefix="xmlns",localpart="tns1",rawname="xmlns:tns1"" is invalid.
    Prefixed namespace bindings may not be empty.
[java2wsdl]     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
[java2wsdl]     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
[java2wsdl]     at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
[java2wsdl]     at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
[java2wsdl]     at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:269)
[java2wsdl]     at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:338)
[java2wsdl]     at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:249)

If I switch to RPC style WSDL, the exception goes away. Any idea what could be going wrong?

Thanks.
Naresh

Reply via email to