Hi,

I am getting the following error when trying to unmarshall an array-list from an org.w3c.dom.Node
into castor:

Error: The namespace associated with the prefix 'xsi' could not be resolved.

I pass the following xml into an axis soap client:

<SOAP-ENV:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:java='java' xmlns:xsd='http://www.w3.org/2001/XMLSchema' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Body>
  <array-list>
<greeting-planet xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:type='java:genbeans.GreetingPlanet'>
        <planet>Hello</planet>
        <greeting>World</greeting>
     </greeting-planet>
     <greeting-planet>
        <planet>Bonjour</planet>
        <greeting>le monde</greeting>
     </greeting-planet>
  </array-list>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is then returned from Axis using the following code ( axis returns a soap envelope):

  SOAPBody sb = envelope.getBody();
  org.w3c.dom.Node result = sb.getFirstChild();

  if ( result != null)
  {
     Unmarshaller unmar = new Unmarshaller();
     Object o = null;
     try
     {
        unmar.setValidation(true);
        o = unmar.unmarshal(c,result);
     }
     catch ( Exception e )
     {
        System.out.println("Error: "+e.toString());
     }

     return o;
  }

  return null;

I used some code I found on the web to output the xml stored in result - I got the following:

<?xml version="1.0" encoding="UTF-8"?>
<array-list>
<greeting-planet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="java:genbeans.GreetingPlanet">
       <planet>Hello</planet>
       <greeting>World</greeting>
   </greeting-planet>
   <greeting-planet>
       <planet>Bonjour</planet>
       <greeting>le monde</greeting>
   </greeting-planet>
</array-list>

As you can see - the xsi namespace seems to be specified.

I am using Castor 1.0M2

Any help would be much appreciatted.

Cheers,

Steve


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

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

Reply via email to