Hi Group,

I am getting the java.net.connect exception when i
give the XSD file (URL) in schemaLocation attribute.
If i manually download the file and put in local drive
then castor parse my schema and works fine. 

But my program needs castor to download the XSD file
from the URL and use it. 

Is there any http.proxyHost settings i have to
mention?--Eventhough i defined it, it does not work,
is castor taking it from somewhere default?

How to solve this problem?

Thanks & Regards,
Deepak

--- Ralf Joachim <[EMAIL PROTECTED]> wrote:

> Hi Deepak,
> 
> you may resolve both of your issues by providing
> your own implementation 
> of org.exolab.castor.net.URIResolver. To start with
> you may have a look 
> at org.exolab.castor.net.util.URIResolverImpl.
> 
> To get your on implementations use you have to set
> them at SchemaReader 
> before calling schemaReader.read().
> 
>          String config =
> getClass().getResource(FILENAME).toString();
>          InputSource inputSource = new
> InputSource(config);
>          SchemaReader schemaReader = new
> SchemaReader(inputSource);
>          schemaReader.setValidation(false);
>          schemaReader.setURIResolver(new
> MyOwnURIResolverImpl());
>          // read the schema from the source
>          Schema schema = schemaReader.read();
> 
> Hope this helps.
> Ralf
> 
> 
> Deepak schrieb:
> > Hello Friends,
> > 
> > I need help as i am using castor-0.9.9-xml.jar to
> > parse the schema of <Type> section WSDL file.I am
> new
> > to castor and need some help in following error:
> > 
> > 1) I am using Castor API to create
> > org.exolab.castor.xml.schema.Schema object. I use
> Type
> > section of the WSDL file as input to SchemaReader
> > constructor. 
> > 
> > org.xml.sax.InputSource inputSource = new
> > InputSource(reader);
> > SchemaReader schemaReader = new
> > SchemaReader(inputSource);
> >       schemaReader.setValidation(false);
> > //read the schema from the source
> > Schema schema = schemaReader.read();
> > 
> > Program runs fine
> > with some wsdl files. But i get the follwoing
> error
> > for the below schema:
> > 
> > " java.io.FileNotFoundException"....castor is
> looking
> > for "Utility.xsd" file in the same directory.
> Ideally
> > it should automatically download the file from the
> > namespace URI mentioned in the import tag.
> > 
> >     <types> 
> >         <schema
> > xmlns="http://www.w3.org/2001/XMLSchema";
> > targetNamespace="http://xmlsoap.org/Ping";
> > elementFormDefault="qualified"> 
> >             <import
> >
>
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> > schemaLocation="utility.xsd"/>
> >             <complexType name="ticketType"> 
> >                 <xsd:simpleContent> 
> >                     <xsd:extension
> base="xsd:string"> 
> >                         <xsd:attribute
> ref="wsu:Id"/> 
> >                     </xsd:extension> 
> >                 </xsd:simpleContent> 
> >             </complexType> 
> >             <element name="ticket"
> > type="tns:ticketType"/> 
> >             <element name="text" type="xsd:string"
> > nillable="true"/> 
> >             <complexType name="ping"> 
> >                 <sequence> 
> >                     <element ref="tns:ticket"
> > minOccurs="0"/> 
> >                     <element ref="tns:text"/> 
> >                 </sequence> 
> >             </complexType> 
> >             <complexType name="pingResponse"> 
> >                 <sequence> 
> >                     <element ref="tns:text"/> 
> >                 </sequence> 
> >             </complexType> 
> >             <element name="Ping" type="tns:ping"/>
> 
> >             <element name="PingResponse"
> > type="tns:pingResponse"/> 
> >         </schema> 
> >     </types> 
> > 
> > 
> > 
> > Thanks in advance,
> > Regards,
> > Deepak
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> > -------------------------------------------------
> > If you wish to unsubscribe from this list, please 
> > send an empty message to the following address:
> > 
> > [EMAIL PROTECTED]
> > -------------------------------------------------
> > 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please 
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to