axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: Relative URL
Date Thu, 02 Nov 2006 20:09:17 GMT
you can use a 2 stage constructor(URI base,String relativeURISpec) where the first parameter
would contain the critical attributes of
base path
relative path appended to base
the initial base path requires the following data elements to properly construct a URI object
        userinfo
        host 
        port 
        regAuthority 
        base_path 
otherwise the final URI class has no ability to construct the full path from partial URI path

M-
This e-mail communication and any attachments may contain confidential and privileged information
for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified
that you have received
this communication in error and that any review, disclosure, dissemination, distribution or
copying of it or its 
contents
----- Original Message ----- 
From: "Jing Tao" <tao@nceas.ucsb.edu>
To: <axis-user@ws.apache.org>
Sent: Thursday, November 02, 2006 2:33 PM
Subject: Relative URL


> 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 (http://www.w3.org/2001/XMLSchema). 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:complexType>
>                     <xs:simpleContent>
>                         <xs:extension base="xs:anyURI">
>                             <xs:attribute name="prefix"
>                                 type="xs:string" use="optional"/>
>                         </xs:extension>
>                     </xs:simpleContent>
>                 </xs:complexType>
> </xs:element>
> 
> My question is without changing wsdl file, how can I make the auto 
> generated code working with relative URI?
> 
> Thanks a lot!
> 
> Jing
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>
Mime
View raw message