You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Gaël Pouzerate <gp...@frisurf.no> on 2002/05/17 15:20:14 UTC

Java2WSDL/?WSDL problem with java.util?

Hi folk,

I'm trying to generate a WSDL file from my service. Either with ?WSDL or with Java2WSDL, it fails (see traces below)! 
And it fails because im my service java code, I'm using a variable of type java.util.Calendar.
I've been trying to play with some options of the Java2WSDL, but in vain...

Pleae help me if you can!

--Gaël


bash-2.05$ java org.apache.axis.wsdl.Java2WSDL -o CustomerManagmentAPI.wsdl  -l"http://localhost:7654/axis/services/CustomerManagmentAPI"  -n "urn:CustomerManagmentAPI"  
com.djuice.custmgmt.CustomerManagmentAPI
WSDLException: faultCode=OTHER_ERROR: Can't find prefix for 'http://util.java'. Namespace prefixes must be set on the Definition object using the addNamespace(...) 
method.: 
        at com.ibm.wsdl.util.xml.DOMUtils.getPrefix(DOMUtils.java:352)
        at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedValue(DOMUtils.java:336)
        at com.ibm.wsdl.util.xml.DOMUtils.printQualifiedAttribute(DOMUtils.java:320)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printParts(WSDLWriterImpl.java:706)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printMessages(WSDLWriterImpl.java:676)
        at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(WSDLWriterImpl.java:111)
        at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(WSDLWriterImpl.java:923)
        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(WSDLWriterImpl.java:902)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Unknown Source)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Unknown Source)
        at org.apache.axis.wsdl.Java2WSDL.main(Unknown Source)



RE: WSDL2JAVA problem

Posted by Han Wang <ha...@lucent.com>.
One more problem:

I'm getting a null pointer exception and no description of the problem:

    [apply] java.lang.NullPointerException
    [apply]     at org.apache.axis.wsdl.toJava.Utils.holder(Utils.java:494)
    [apply]     at
org.apache.axis.wsdl.toJava.JavaWriterFactory.constructSignat
ure(JavaWriterFactory.java:512)
    [apply]     at
org.apache.axis.wsdl.toJava.JavaWriterFactory.constructSignat
ures(JavaWriterFactory.java:478)
    [apply]     at
org.apache.axis.wsdl.toJava.JavaWriterFactory.writerPass(Java
WriterFactory.java:106)
    [apply]     at
org.apache.axis.wsdl.toJava.Emitter.emit(Emitter.java:189)
    [apply]     at
org.apache.axis.wsdl.toJava.Emitter.emit(Emitter.java:155)
    [apply]     at
org.apache.axis.wsdl.WSDL2Java$WSDLRunnable.run(WSDL2Java.jav
a:725)
    [apply]     at java.lang.Thread.run(Thread.java:536)
    [apply] Result: 1

when I try to run WSDL2JAVA.
I can't post the wsdl, so does anyone have any clues?

Thanks,
Han


RE: WSDL2JAVA problem

Posted by Han Wang <ha...@lucent.com>.
I discovered another problem with the code generation:

(AXIS Beta 2)

In WSDL:
			<xsd:simpleType name="TpOctet">
				<xsd:restriction base="xsd:hexBinary"/>
			</xsd:simpleType>

Generated Java:

public class TpOctet implements java.io.Serializable,
org.apache.axis.encoding.SimpleType {
    private byte[] value;
...
// Simple Types must have a String constructor
    public TpOctet(java.lang.String value) {
        this.value = new byte[](value);
    }

when compiled:

    [javac]
C:\Development\ISGSDK\xgw\build\genWSDLsrc\org\csapi\www\TpOctet.java:30:
'{' expected
    [javac]         this.value = new byte[](value);

Which is invalid because the implementation type is an array of a basic
type.

the solution is to replace the offending line to:

this.value = value.getBytes();

I don't have a good feeling modifying generated code :)

How buggy IS the code generator anyway? Is there a list somewhere that
specifies the limitations of WSDL2JAVA? (Such as this problem, plus with
anyURI?)

Thanks,
Han


WSDL2JAVA problem

Posted by Han Wang <ha...@lucent.com>.
I'm having trouble generating a WSDL document with xsd:anyURI

[java] java.io.IOException: Type http://www.w3.org/2001/XMLSchema:anyURI
is referenced but not defined.

A quick search on the mailing list resulted in a message Jan 23 on anyURI
not being supported yet.

I'm working off a standard submission wsdl that uses anyURI, so I don't have
the option of changing it to xsd:string for the final product. Can someone
give me a hint on when this would be put in?

Thanks,
Han Wang
hanwang@lucent.com