Thanks for the response Frank.  I did try serializing it as a datagraph
with the root as the bank object, same results - the loaded datagraph
had the proxies.

<sdo:datagraph xmlns:bank="http://www.example.com/bank";
xmlns:sdo="commonj.sdo">
  <bank:bankType>
    <Branch ID="theBranchID"/>
    <Customer ID="theCustomerID">
      <HomeBranch>#//@eRootObject/@Branch.0</HomeBranch>
    </Customer>
  </bank:bankType>
</sdo:datagraph>
This is from generated code with the bank.xsd in Tuscany.

We have been using this non containment strategy on some of our types
since the M2 release (Nov 2006).  Not sure how to resolve this with the
current release.

-----Original Message-----
From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 19, 2008 10:24 AM
To: [email protected]
Subject: RE: Serializing non-containment reference

SDO requires cross references to be "intenal" to the datagraph - that
is, 
they need to point to objects that are also reachable from containment 
references in the closed datagraph starting from the root of the 
serialization. EMF, which underlies the Tuscany SDO implementation also 
supports cross file references, so my guess is that the proxy is showing

up, but (really broken) in SDO, since you didn't serialize the datagraph

from the root.

Frank.

"Murtaza Goga" <[EMAIL PROTECTED]> wrote on 06/19/2008
07:43:46 
AM:

> Frank,
> On a parallel question, how do the non-containment references resolve
> after the object is de-serialized from such a graph?
> 
> I have something like this:
> <bank:bank xmlns:bank="http://www.example.com/bank";>
>   <Branch ID="theBranchID"/>
>   <Customer ID="theCustomerID">
>     <HomeBranch>#//@bank/@Branch.0</HomeBranch>
>   </Customer>
> </bank:bank>
> 
> The 'HomeBranch' property on the 'Customer' ends up as a proxy after
the
> object is de-serialized?
> 
> -----Original Message-----
> From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 16, 2008 9:51 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Serializing non-containment reference
> 
> Hi Santhosh,
> 
> My guess is your schema definition has errors.
> 
> You should have something like this on the <schema> element:
> 
> xmlns:tns="... your models targetNamespace..."
> xmlns:sdoXML="commonj.sdo/xml"
> 
> and then the the cross reference declared like this:
> 
> sdoXML:propertyType="tns:InvolvedPartyImpl"
> 
> Also, I don't believe you need this import:
> 
>  <xsd:import namespace="commonj.sdo/xml"
>       schemaLocation="sdoXML.xsd">
>  </xsd:import>
> 
> since the annotation namespaces are automatically available.
> 
> Frank.
> 
> "Santhosh Adiga" <[EMAIL PROTECTED]> wrote on 06/16/2008 05:11:30 AM:
> 
> > Hi,
> > 
> >   I am trying to serialize and deserialize a SDO containing a
> > non-containment reference. Here is the xsd corresponding to the SDO.
> > 
> > <xsd:import namespace="commonj.sdo/xml"
> >         schemaLocation="sdoXML.xsd">
> >     </xsd:import>
> >     <xsd:complexType mixed="true" name="InvolvedPartyImpl">
> >         <xsd:sequence>
> >             <xsd:element minOccurs="0" name="involvedPartySurrogate"
> >                 type="domain:SurrogateDomain" />
> >             <xsd:element minOccurs="0" name="organizationOrPerson"
> >                 type="domain:OrganizationOrPersonDomain" />
> >             <xsd:element minOccurs="0" name="paymentPlan"
> >                 type="bons0:PaymentPlan" maxOccurs="1">
> >             </xsd:element>
> >             <xsd:element minOccurs="0" name="financialTransactions"
> >                 type="bons0:FinancialTransactions">
> >             </xsd:element>
> >             <xsd:element minOccurs="0" name="refInvolvedParty"
> >                 type="bons0:InvolvedPartyImpl" maxOccurs="1">
> >             </xsd:element>
> >         </xsd:sequence>
> >     </xsd:complexType>
> >     <xsd:complexType name="PaymentPlan">
> >         <xsd:sequence>
> >             <xsd:element minOccurs="0" name="PaymentPlanName"
> >                 type="xsd:string">
> >             </xsd:element>
> >             <xsd:element minOccurs="0" name="PaymentPlanID"
> >                 type="xsd:int">
> >             </xsd:element>
> >             <xsd:element minOccurs="0" name="refInvolvedParty"
> >                 type="xsd:anyURI" 
> sdoXML:propertyType="InvolvedPartyImpl">
> >             </xsd:element>
> >         </xsd:sequence>
> >     </xsd:complexType>
> >     <xsd:complexType name="FinancialTransaction">
> >         <xsd:sequence>
> >             <xsd:element minOccurs="0" name="financialTransaction"
> >                 type="xsd:double">
> >             </xsd:element>
> >             <xsd:element minOccurs="0" name="financialTransactionID"
> >                 type="xsd:long">
> >             </xsd:element>
> >             <xsd:element minOccurs="0" name="refInvolvedParty"
> >                 type="xsd:anyURI" 
> sdoXML:propertyType="InvolvedPartyImpl"
> >                 maxOccurs="1">
> >             </xsd:element>
> >         </xsd:sequence>
> >     </xsd:complexType>
> >     <xsd:complexType name="FinancialTransactions">
> >         <xsd:sequence>
> >             <xsd:element minOccurs="0" name="financialTransaction"
> >                 type="bons0:FinancialTransaction"
> maxOccurs="unbounded">
> >             </xsd:element>
> >         </xsd:sequence>
> >     </xsd:complexType>
> > 
> > 
> > 
> > 
> > 
> > As you can see the payment plan contains a reference to an involved 
> party.
> > When the referenced involved party is present in the same data graph
> > as the payment plan, here is the serialized xml i am getting.
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> > <p:InvolvedPartyImpl xsi:type="p:InvolvedPartyImpl"
> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >     xmlns:p="http://www.abc.com/edm/entities";>
> >     <financialTransactions>
> >         <financialTransaction>
> >             <financialTransactionID>13</financialTransactionID>
> >         </financialTransaction>
> >         <financialTransaction>
> >             <financialTransactionID>12</financialTransactionID>
> >         </financialTransaction>
> >     </financialTransactions>
> >     <involvedPartySurrogate>23</involvedPartySurrogate>
> >     <paymentPlan>
> >         <PaymentPlanID>12</PaymentPlanID>
> >         *<refInvolvedParty>
> >             BusinessObject: [EMAIL PROTECTED]
> >             (:mixed=[entities:involvedPartySurrogate=24],
> >             involvedPartySurrogate=24)
> >         </refInvolvedParty>*
> >     </paymentPlan>
> >     <refInvolvedParty>
> >         <involvedPartySurrogate>24</involvedPartySurrogate>
> >     </refInvolvedParty>
> > </p:InvolvedPartyImpl>
> > 
> > 
> > And I am having problems deserializing the reference involved party
> > obtained.
> > Could you let me know if there is any special trick to be applied
> while
> > serializing or deserializing a
> > non-containment reference and is it specific to any implementation?
> > 
> > 
> > Thanks
> > Santhosh
> 

Reply via email to