Ah ok...then this may be a bug in the DOM to SAX convertor
(DOMEventProducer) used by Castor. As a work around you may want to grab
the UnmarshalHandler directly (see Unmarshaller#createHandler()) and
start the xsi prefix mapping.

You can then use the DOMEventProducer  to send the remaining events to
the UnmarshalHandler.

I'll take a look at that class later and try to fix the bugs.

Thanks,

--Keith

"Christian Landbo, Presys A/S" wrote:
> 
> I am not already using the UnmarshalHandler. I just call the static
> method on the Unmarshaller with a class and a Node. The fragment or Node
> comes from the Apache SOAP implementation where I use Castor in my
> Serializer and Deserializer.
> 
> Any pointers or examples to using the UnmarshalHandler when all I have
> is the Node (which is a fragment of a SOAP body) would by greatly
> appreciated.
> 
> Thanks
> 
> /Chr
> 
> -----Original Message-----
> From: Keith Visco [mailto:[EMAIL PROTECTED]
> Sent: 11. marts 2004 19:29
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] The namespace associated with the prefix 'xsi'
> could
> 
> How are you calling the unmarshaller?
> 
> Since you are unmarshalling a document fragment, you'll need to pass any
> namespaces that are in scope to the UnmarshalHandler, otherwise Castor
> has no way of knowing what these should be, and it can't guess...as
> "xsi" could be mapped to anything, it's not a special prefix like the
> "xml".
> 
> I'm assuming here that because you are unmarshalling a fragment you're
> already using the UnmarshalHandler?  Just use the startPrefixMapping()
> method to pass in all the in-scope namespace prefix mappings.
> 
> --Keith
> 
> "Christian Landbo (Presys A/S)" wrote:
> >
> > After a thorough search in the archives I have found that
> > http://www.mail-archive.com/[EMAIL PROTECTED]/msg12603.html
> actually
> > asks exactly the same question.
> > BUT no solution seems to be offered.
> >
> > Do I really have to put a restriction on my service and say that xml
> with
> > xsi:type cannot be received?
> > Can't I tell Castor to ignore unknown namespaces?
> >
> > /Chr
> >
> > ----- Original Message -----
> > From: "Christian Landbo (Presys A/S)" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, March 11, 2004 3:11 PM
> > Subject: [castor-dev] The namespace associated with the prefix 'xsi'
> could
> > not be resolved
> >
> > >
> > > Hi again
> > >
> > > I have a Apache SOAP web service that uses Castor for marshalling
> and
> > > unmarshalling.
> > > When a client (e.g. SOAPScope client ) not using Castor to generate
> the
> > XML
> > > for the parameters is used it appends xsi:type to the elements with
> the
> > xsi
> > > namespace declaration in the soap envelope.
> > > When the body is passed to Castor's unmarshaller it does not know
> the xsi
> > > namespace.
> > >
> > > And now my question: is there anyway to tell the unmarshaller about
> the
> > > missing namespace?
> > >
> > > I have enclosed the envelope
> > >
> > > <soap:Envelope
> > >     xmlns:mrns0="someNs"
> > >     xmlns:mrns1="someNs:service"
> > >     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
> > >     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> > >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> > >    <soap:Body
> > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
> > >       <mrns1:login>
> > > -- it is only this part that ends up in my method that calls the
> > > unmarshaller
> > >          <mrns0:login>
> > >             <mrns0:att1 xsi:type="mrns0:cvrtype"></mrns0:att1>
> > >             <mrns0:att2 xsi:type="mrns0:pnumbertype"></mrns0:att2>
> > >          </mrns0:login>
> > > -----
> > >       </mrns1:login>
> > >    </soap:Body>
> > > </soap:Envelope>
> > >
> > > /Chr
> > >
> > > -----------------------------------------------------------
> > > If you wish to unsubscribe from this mailing, send mail to
> > > [EMAIL PROTECTED] with a subject of:
> > >         unsubscribe castor-dev
> > >
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >         unsubscribe castor-dev
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to