Are you starting with a mapping file, or is the starting point an XML
schema, iima ? 

 

Werner

 

________________________________

Von: Praveen Jani [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 04. Mai 2007 19:33
An: [email protected]
Betreff: [castor-user] Question about xsi:type and namespaces

 

Friends

 

Got another question .. .

 

When I marshall my object it produces:

 

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

<CmdRequestBody
xmlns="http://www.abc.com/schema/2003/01/frontend/command";>

<CmdRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
name="GetStatus" xsi:type="GetCommandStatusCmdType">

<ns1:percentComplete
xmlns:ns1="http://www.abc.com/schema/2003/01/frontend/command/progressin
dicator">90</ns1:percentComplete>

</CmdRequest>

</CmdRequestBody>

 

And when I UNMARSHALL, it complains "unable to find FieldDescriptor for
'percentComplete' in ClassDescriptor of BaseCmdRequestType{File: [not
available]; line: 4; column: 105}"

 

How can I make Castor to generate XML like (because this get
unmarshalled neatly)

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

<CmdRequestBody
xmlns:pid="http://www.abc.com/schema/2003/01/frontend/command/progressin
dicator" xmlns="http://www.abc.com/schema/2003/01/frontend/command";>

<CmdRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
name="GetStatus" xsi:type="pid:GetCommandStatusCmdType">

<pid:percentComplete>90</pid:percentComplete>

</CmdRequest>

</CmdRequestBody>

 

 

Nutshell, 

1. the foreign namespace (pid) should be on top

2. xsi:type should have the namespace prefix (pid).

3. I dont want to call

 

marshaller.setNamespaceMapping("pid","http://www.abc.com/schema/2003/01/
frontend/command/progressindicator");

 

I simply want to call unmarshall/marshall methods generated with the
Castor generated classes

 

I would much appreciate your help.

 

-Praveen

Reply via email to