Dear Ralf,

Thanks for prompt reply. 

As i am new to castor, i want to know, would i need to
implement URIResolver for EACH WSDL FILE separately?
can i find sample code to implement the URIResolver?

As my requirement is:

I am creating User Interface in HTML for the client by
the WSDL file(All operations,Input Parameters). I am
using castor to resolve each complex type in the
<schema> tag. My program should take any wsdl file and
parse it and create UI. I pass the <schema> tag of the
<type> section of the wsdl file.

I also dont know how to handle multiple <schema>
element in the wsdl file when they refer each
other(using castor).In all cases castor should parse
the schema and i should be able to have Schema object
so i can use it to handle the complex type.


Thanks in advance,
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