yhknight / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

Crash while parsing WCF service metadata #269

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Trying to parse the metadata of WCF service created in VS2012.
2. The library crash on this method: 
       org.odata4j.format.xml.EdmxFormatParser.parseEdmConstraintElement(EdmxFormatParser.java)

What version of the product are you using? On what operating system?
Am using a SNAPSHOT build of version 0.8. Using Eclipse 4.2.2 on Mac OS 10.8.4

Please provide any additional information below.
I tried to debug the issue, and it seems there is a problem in reading the 
"Role" attribute of both Principal and Dependent elements, it's always null.

Here is a the element that caused the crash:

<Association Name="FK_EventPartyCategories_Categories">
    <End Type="AttendeesTrackingModel.Category" Role="Category" Multiplicity="1"/>
    <End Type="AttendeesTrackingModel.EventPartyCategory" Role="EventPartyCategory" Multiplicity="*"/>
    <ReferentialConstraint>
        <Principal Role="Category">
            <PropertyRef Name="CategoryID"/>
        </Principal>
        <Dependent Role="EventPartyCategory">
            <PropertyRef Name="CategoryID"/>
        </Dependent>
    </ReferentialConstraint>
</Association>

Original issue reported on code.google.com by shakerr...@gmail.com on 19 Sep 2013 at 6:23