Hi Werner,
Thanks for your declaration. Actually i supplied just the part of the XML
which i have problem with (cannot use the same class twice). but i have for
the response (marshalling) something like:
<class name="com.mycomp.pkg.ClassResponse">
<map-to xml="firstSOAPResponse"/>
<field name="status">
<bind-xml name="Status" node="element" type="string"/>
</field>
</class>
If there is noway to use the same class twice, what other approaches can i
use to (un)marshal my web services request/response?
Many thanks for your great help,
Werner Guttmann-6 wrote:
>
> Hi,
>
> as already said, XML data binding basically supports two operations:
>
> * unmarshalling: XML --> object instances
> * marshalling: object instances --> XML
>
> When you supply a mapping file for Castor XML, you are actually
> supplying enough information so that *both* operations have enough
> information that is *not* ambiguous.
>
> In your case, the mapping information you provide would be sufficient
> for the unmarshalling side of things, but would be AMBIGUOUS for
> marshalling (see my question below).
>
> As such, this is currently not supported out of the box.
>
> Regards
> Werner Guttmann
>
> On 14.07.2011 11:47, mdaoud wrote:
>>
>> Hi Werner,
>>
>> Thank you so much for your help. I am sorry as i am quite newbie to
>> Castor i
>> am bit lost.
>> Basically, Class is just pojo class which has some properties
>> (name,address,age,..) and i have some webservices operation like
>> updateAge
>> which passes the age, and i have updateName which passes the name. So i
>> want
>> to map those 2 requests to Class (as it will be bit trivial building
>> class
>> for every single request!!) Did i miss something??
>>
>> Thanks,
>>
>>
>> Werner Guttmann-6 wrote:
>>>
>>> HI,
>>>
>>> this is currently not possible with Castor XML. Whilst on the
>>> unmarshalling side this could be achievable, it would cause complete
>>> chaos on the marshalling side of things. What XML element would you
>>> Castor expect to use when you marshalled an instance of
>>> com.mycomp.pkg.Class".
>>>
>>> I hope this helps.
>>>
>>> Kind Regards
>>> Werner Guttmann
>>>
>>> On 14.07.2011 11:10, mdaoud wrote:
>>>>
>>>> Hi guys,
>>>>
>>>> I am quite new to use Castor and i would really appreciate if you can
>>>> guide
>>>> me to solve my problem.
>>>> Basically, I am integrating Castor with Spring-ws. I would like to map
>>>> multiple xml (SOAP requests) to the same class. when i try to define
>>>> something like the code below, i get an error saying the class already
>>>> in
>>>> use! any way to solve this?
>>>>
>>>> <class name="com.mycomp.pkg.Class">
>>>> <map-to xml="firstSOAPRequest"/>
>>>> <field name="name" type="string">
>>>> <bind-xml name="Name" node="element"/>
>>>> </field>
>>>> <field name="address" type="string">
>>>> <bind-xml name="Address" node="element"/>
>>>> </field>
>>>> </class>
>>>>
>>>> <class name="com.mycomp.pkg.Class">
>>>> <map-to xml="secondSOAPRequest"/>
>>>> <field name="name" type="string">
>>>> <bind-xml name="Name" node="element"/>
>>>> </field>
>>>> </class>
>>>>
>>>> Thanks in advance,
>>>
>>> ---------------------------------------------------------------------
>>> 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/Unmarshalling-multiple-xml-to-one-class-tp32059761p32060631.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