Hi,

So I tried add namespaces and prefixes in various permutations ... the
example below being complete and compiles without warnings (sometimes if I
accidentally have a typo, then Castor fails at startup - this just assures
me that the mapping file is being loaded as a Spring marshaller bean just
fine when no warnings come out)

I didn't see anything on reasoning for using namespaces/prefixes for Spring
usage so I just had to guess but all permutations fail. Here is my most
complete mapping:

Mapping

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
        "http://castor.org/mapping.dtd";>
        
<mapping xmlns:smart="http://localhost/SmartPayments";>

        <description>Description of the mapping</description>
        
        <class 
name="com.qas.newmedia.internet.emi.search.model.CardTypeResponse">
                <map-to xml="GetCardTypeResponse" 
ns-uri="http://localhost/SmartPayments";
ns-prefix="smart" />
                
                <field name="cardType" type="string">
                        <bind-xml name="smart:GetCardTypeResult" />
                </field>
        </class>
        
</mapping>

Error

But again, the Exception always remains:

        at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
        at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        ... 87 more
Caused by: org.exolab.castor.xml.MarshalException: unable to find
FieldDescriptor for 'GetCardTypeResult' in ClassDescriptor of
GetCardTypeResponse{File: [not available]; line: 1; column: 119}
        at
org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:761)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:727)
        at
org.springframework.oxm.castor.CastorMarshaller.unmarshalReader(CastorMarshaller.java:384)
        ... 96 more
Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor for
'GetCardTypeResult' in ClassDescriptor of GetCardTypeResponse
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:2000)
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1418)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:715)
        ... 97 more



Werner Guttmann-6 wrote:
> 
> Okay. Then you will have to introduce namespace URLs and prefices to 
> your mapping file.
> 
> Cheers
> Wernr
> 
> On 11.02.2010 21:32, PorridgeBear wrote:
>>
>> Hey,
>>
>> I am using Spring Web Services. I downloaded the full Spring WS with
>> dependencies and am using the Castor version supplied. I create a Castor
>> bean and pass it a castor-mapping.xml.
>>
>> Thanks :)
>>
>>
>> Werner Guttmann-6 wrote:
>>>
>>> Hi,
>>>
>>> what frameworks are you using to integrate Castor XML for processing
>>> SOAP messages ? Or is this really as simple as doing things manually ?
>>>
>>> If you doing this completely manually, please do not forget to make the
>>> namespaces known to Castor you seem to be using.
>>>
>>> Cheers
>>> Werner
>>>
>>> On 11.02.2010 15:57, PorridgeBear wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am consuming a very simple web service that returns a card type, e.g.
>>>> VISA, given a card number. I have no problem calling the web service
>>>> and
>>>> acquiring the response. I cannot get Castor to map the response onto a
>>>> plain
>>>> POJO. Details below:
>>>>
>>>> XML Returned
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?><GetCardTypeResponse
>>>> xmlns="http://localhost/SmartPayments/";><GetCardTypeResult>VISA</GetCardTypeResult></GetCardTypeResponse>
>>>>
>>>> Mapping Class
>>>>
>>>>    <class name="CardTypeResponse">
>>>>            <map-to xml="GetCardTypeResponse" />
>>>>            
>>>>            <field name="cardType" type="string">
>>>>                    <bind-xml name="GetCardTypeResult" />
>>>>            </field>
>>>>    </class>
>>>>
>>>> Class
>>>>
>>>> public class CardTypeResponse {
>>>>
>>>>    private String cardType;
>>>>
>>>>    public String getCardType() {
>>>>            return cardType;
>>>>    }
>>>>
>>>>    public void setCardType(String cardType) {
>>>>            this.cardType = cardType;
>>>>    }
>>>> }
>>>>
>>>> Unmarshal Call
>>>>
>>>> CardTypeResponse ct = (CardTypeResponse)
>>>> this.unmarshaller.unmarshal(s);
>>>>
>>>> Exception
>>>>
>>>> Caused by: org.exolab.castor.xml.MarshalException: unable to find
>>>> FieldDescriptor for 'GetCardTypeResult' in ClassDescriptor of
>>>> GetCardTypeResponse{File: [not available]; line: 1; column: 119}
>>>>    at
>>>> org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:761)
>>>>    at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:727)
>>>>    at
>>>> org.springframework.oxm.castor.CastorMarshaller.unmarshalReader(CastorMarshaller.java:384)
>>>>    ... 96 more
>>>> Caused by: org.xml.sax.SAXException: unable to find FieldDescriptor for
>>>> 'GetCardTypeResult' in ClassDescriptor of GetCardTypeResponse
>>>>    at
>>>> org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:2000)
>>>>    at
>>>> org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1418)
>>>>    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
>>>> Source)
>>>>    at
>>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
>>>> Source)
>>>>    at
>>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>>>> Source)
>>>>    at
>>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>>>> Source)
>>>>    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>>>    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>>>    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>>>>    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>>>>    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
>>>> Source)
>>>>    at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:715)
>>>>    ... 97 more
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>      http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/unable-to-find-FieldDescriptor-tp27546456p27560538.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to