Alexander Parr created OLINGO-1065:
--------------------------------------

             Summary: Multiple FunctionImports with the same name and different 
parameters
                 Key: OLINGO-1065
                 URL: https://issues.apache.org/jira/browse/OLINGO-1065
             Project: Olingo
          Issue Type: Bug
          Components: odata2-core
    Affects Versions: V2 2.0.7
         Environment: SAP HCP + SAP JVM
            Reporter: Alexander Parr
            Priority: Blocker


Hi all,
I've defined three function imports via EdmAnnotation with the same name and 
different parameters as there are different situations how the consumer can 
call this API.

In order to express possible combinations of parameters and which can be 
nullable I like this approach very much. 

The generated $metadata document looks like this:
...
<FunctionImport Name="OrderCreditReport" ReturnType="core.CreditReport" 
EntitySet="CreditReports" m:HttpMethod="GET">
<Parameter Name="CreditAgencyBusinessPartner" Type="Edm.String" 
Nullable="false" MaxLength="60"/>
<Parameter Name="Language" Type="Edm.String" Nullable="false" MaxLength="2"/>
<Parameter Name="GradeMethod" Type="Edm.String" Nullable="false" 
MaxLength="10"/>
<Parameter Name="FscmUpdate" Type="Edm.Boolean" Nullable="true"/>
<Parameter Name="LoadPdf" Type="Edm.Boolean" Nullable="true"/>
</FunctionImport>
<FunctionImport Name="OrderCreditReport" ReturnType="core.CreditReport" 
EntitySet="CreditReports" m:HttpMethod="GET">
<Parameter Name="CompanyId" Type="Edm.String" Nullable="false" MaxLength="60"/>
<Parameter Name="RequestLanguageCode" Type="Edm.String" Nullable="false" 
MaxLength="2"/>
<Parameter Name="GradeMethodCode" Type="Edm.String" Nullable="false" 
MaxLength="10"/>
<Parameter Name="FscmUpdate" Type="Edm.Boolean" Nullable="true"/>
<Parameter Name="LoadPdf" Type="Edm.Boolean" Nullable="true"/>
</FunctionImport>
<FunctionImport Name="OrderCreditReport" ReturnType="core.CreditReport" 
EntitySet="CreditReports" m:HttpMethod="GET">
<Parameter Name="CompanyId" Type="Edm.String" Nullable="false" MaxLength="60"/>
<Parameter Name="RequestLanguageCode" Type="Edm.String" Nullable="false" 
MaxLength="2"/>
<Parameter Name="CreditAgencyId" Type="Edm.Int32" Nullable="false"/>
<Parameter Name="CreditProductId" Type="Edm.Int32" Nullable="false"/>
<Parameter Name="FscmUpdate" Type="Edm.Boolean" Nullable="true"/>
<Parameter Name="LoadPdf" Type="Edm.Boolean" Nullable="true"/>
</FunctionImport>
...

Now I expect that the respective java method is invoked based on the parameters 
that are given by the consumer. This is not the case as I cannot call option 
two and three of the function import because I get error message that 
parameters are missing. It looks like that when there is a request only option 
one of the function import is validated. This is a bug from my point of view 
and it would be nice if it could be fixed.

I'm using Olingo Version 2.0.7-sap-02

Best and thanks in advance,
Alex





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to