I have an analytical view and an .xsodata to expose it to web. The question is how is the access url formed? HANA documentation is insufficient here, and the same for the moderated SCN.
Here is my func_x_cview.xsodata:
service namespace "CTag" {
"MyPackage::FUNC_X_CALC_VIEW" as "CView" keys generate local "ID"
parameters via entity "InputParams" ;
}
http://awshana:8000/package/path/to/xsodata/file/$metadata shows:
<EntityType Name="InputParamsType">
<Key>
<PropertyRef Name="ATTRIBUTE"/>
<PropertyRef Name="ATTRIBUTE_VALUE"/>
<PropertyRef Name="category"/>
<PropertyRef Name="from_date"/>
<PropertyRef Name="process"/>
<PropertyRef Name="to_date"/>
</Key>
<Property Name="ATTRIBUTE" Type="Edm.String" Nullable="false" MaxLength="50"/>
<Property Name="ATTRIBUTE_VALUE" Type="Edm.String" Nullable="false" MaxLength="100"/>
<Property Name="category" Type="Edm.String" Nullable="false" MaxLength="50"/>
<Property Name="from_date" Type="Edm.DateTime" Nullable="false"/>
<Property Name="process" Type="Edm.String" Nullable="false" MaxLength="50"/>
<Property Name="to_date" Type="Edm.DateTime" Nullable="false"/>
<NavigationProperty Name="Results" Relationship="CTag.InputParams_CViewType"
FromRole="InputParamsPrincipal"
ToRole="CViewDependent"/>
</EntityType>
What should be the access url? Does the xsodata need any tweaking?
Thanks
--EDIT--
When trying url like suggested by ongis-nade to http://awshana:8000/Pkg/Proj_X/services/tagA.xsodata/InputParams%28%27category%27=%27abcd%27%29/Results?$select=exception_name then I get an error like the following:
<error>
<code/>
<message xml:lang="en-US">
No property ''category'' exists in type 'CTag.InputParamsType'.
</message>
</error>
This is confusing as we can see a property named category in the entity named InputParamsType in the $metadata query.
Removing the single quotes around category (also tried double-quoting) gives
http://awshana:8000/Pkg/Proj_X/services/tagA.xsodata/InputParams%28category=%27abcd%27%29/Results?$select=exception_name
<error>
<code/>
<message xml:lang="en-US">
The number of keys specified in the URI at position 27 does not match number of key properties for the resource 'CTag.InputParamsType'.
</message>
</error>
So a single quote is needed.
A step closer but still the same question. Do I need to qualify each parameter name somehow?
Thanks.
I believe the URL will be formed as:
http://awshana:8000/Pkg/Proj_X/services/tagA.xsodata/InputParams(category='abcd')/Results?
The "InputParams" name is of course reflected in your service definition
I also found a good example here: http://scn.sap.com/community/developer-center/hana/blog/2013/01/22/rest-your-models-on-sap-hana-xs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With