axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jing Tao <>
Subject Relative URL
Date Thu, 02 Nov 2006 19:33:22 GMT
Hi, devs:

I have a question about relative URL in axis.

I have a wsdl file and it has element named namespace and its type is 
anyURI ( After running wsdl2java, this 
element is declared as org.apache.axis.types.URI automatically. Here is 
segment of code in auto generated stub code:

public QueryTypeNamespace(java.lang.String _value) {
         try {
             this._value = new org.apache.axis.types.URI(_value);
         catch (org.apache.axis.types.URI.MalformedURIException mue) {
             throw new java.lang.RuntimeException(mue.toString());

If in this element, the namespace has a schema(e.g. http://mynamespace), 
it works perfect. However, if the namespace is relative URI (without 
schema, e.g.mynamespace), the above code will throw an exception.

I took a look at API of org.apache.axis.types.URI. It has another 
constructor URI(String uri, boolean allowNonAbosluteURI). If I manully 
use this constructor, the code will work with relative URI.

The above code was generated by ant tast - axis-wsdl2java. And here is the 
piece of wsdl file:

<xs:element name="namespace">
                         <xs:extension base="xs:anyURI">
                             <xs:attribute name="prefix"
                                 type="xs:string" use="optional"/>

My question is without changing wsdl file, how can I make the auto 
generated code working with relative URI?

Thanks a lot!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message