You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Vijay Kumar Rani <rv...@gmail.com> on 2014/10/28 11:55:39 UTC

Binary Property properly not display in Entity

I have a property Binary in my entity, If I am accessing single entity the
property, is displaying not properly as it is binary format but getting
property and property value is working good,

How can I stop showing the binary format of property while getting the
entity by Id.

Can I use link over there which will navigate me to corresponding property
value?

Re: Binary Property properly not display in Entity

Posted by Ramesh Reddy <ra...@redhat.com>.
Vijay, 

As I and Micheal indicated before, the problem is not in how you read, the issue is how you defined your metadata for the entity. We gave concrete suggestions as to how that can be achieved. I suggest you start reading tutorial here http://www.odata.org/getting-started/basic-tutorial/ to get better understanding of the OData protocol. 

Ramesh.. 

----- Original Message -----

> let me clear on this, when I use Entity by Id

> { " @odata.context ": "$metadata#ABC/$entity" , " Name ": "Asset" ,
> "UserName": "FirUser", --- Property of type String
> "ID": 23, --- Property of type ID
> "Template":
> "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
> --- Property of type Binary
> ​}

> But I am expecting when I use entity by Id it should display as

> { " @odata.context ": "$metadata#ABC/$entity" , " Name ": "Asset" ,
> "UserName": "FirUser", --- Property of type String
> "ID": 23, --- Property of type ID
> "Template": { " costCenter ": "costCenterValue" , " creationUserID ":
> "creationUserIDValue" , " Custom ": { " dataType ": "dataTypeValue" , "
> targetFieldName ": "targetFieldNameValue" , " description ":
> "descriptionValue" , " name ": "nameValue" , " defaultValue ":
> "defaultValueValue" } , " ownerUserID ": "ownerUserIDValue" }
> ​}

> On Wed, Oct 29, 2014 at 12:24 AM, mibo < mibo@apache.org > wrote:

> > Hi Vijay,
> 

> > as Ramesh suggested I would also recommend option one.
> 
> > With the BaseType (see [1]) you can define the common parts which every
> > grade
> > has and then for concrete grade you can add specific properties.
> 
> > As example you can take a look into [2] and BaseType "<EntityType
> > Name="Person">" which is extended by two specific types "<EntityType
> > Name="Customer" BaseType="ODataDemo.Person">" and <EntityType
> > Name="Employee" BaseType="ODataDemo.Person">".
> 

> > Hope this helps for understanding.
> 

> > Kind regards,
> 
> > Michael
> 

> > [1]:
> > http://docs.oasis-open.org/odata/odata/v4.0/errata01/os/complete/part3-csdl/odata-v4.0-errata01-os-part3-csdl-complete.html#_Attribute_BaseType
> 
> > [2]: http://services.odata.org/V4/OData/OData.svc/$metadata
> 

> > > Am 28.10.2014 um 19:24 schrieb Ramesh Reddy < rareddy@redhat.com >:
> 
> > >
> 
> > > 1) You can define each grade as its own EntityType. Then each can have
> > > their own property set specific to the grade. You can define a base
> > > EntityType and then define each one for different grade.
> 

Re: Binary Property properly not display in Entity

Posted by Vijay Kumar Rani <rv...@gmail.com>.
let me clear on this, when I use Entity by Id

{"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName":
"FirUser", --- Property of type String
"ID": 23, --- Property of type ID
"Template":
"ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
--- Property of type Binary
​}

But I am expecting when I use entity by Id it should display as

{"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName":
"FirUser", --- Property of type String
"ID": 23, --- Property of type ID
"Template": {"costCenter": "costCenterValue","creationUserID":
"creationUserIDValue","Custom": {"dataType": "dataTypeValue","
targetFieldName": "targetFieldNameValue","description": "descriptionValue","
name": "nameValue","defaultValue": "defaultValueValue"},"ownerUserID":
"ownerUserIDValue"}
​}



On Wed, Oct 29, 2014 at 12:24 AM, mibo <mi...@apache.org> wrote:

> Hi Vijay,
>
> as Ramesh suggested I would also recommend option one.
> With the BaseType (see [1]) you can define the common parts which every
> grade has and then for concrete grade you can add specific properties.
> As example you can take a look into [2] and BaseType "<EntityType
> Name="Person">" which is extended by two specific types "<EntityType
> Name="Customer" BaseType="ODataDemo.Person">" and <EntityType
> Name="Employee" BaseType="ODataDemo.Person">".
>
> Hope this helps for understanding.
>
> Kind regards,
> Michael
>
> [1]:
> http://docs.oasis-open.org/odata/odata/v4.0/errata01/os/complete/part3-csdl/odata-v4.0-errata01-os-part3-csdl-complete.html#_Attribute_BaseType
> [2]: http://services.odata.org/V4/OData/OData.svc/$metadata
>
> > Am 28.10.2014 um 19:24 schrieb Ramesh Reddy <ra...@redhat.com>:
> >
> > 1) You can define each grade as its own EntityType. Then each can have
> their own property set specific to the grade. You can define a base
> EntityType and then define each one for different grade.
>
>

Re: Binary Property properly not display in Entity

Posted by mibo <mi...@apache.org>.
Hi Vijay,

as Ramesh suggested I would also recommend option one.
With the BaseType (see [1]) you can define the common parts which every grade has and then for concrete grade you can add specific properties.
As example you can take a look into [2] and BaseType "<EntityType Name="Person">" which is extended by two specific types "<EntityType Name="Customer" BaseType="ODataDemo.Person">" and <EntityType Name="Employee" BaseType="ODataDemo.Person">".

Hope this helps for understanding.

Kind regards,
Michael

[1]: http://docs.oasis-open.org/odata/odata/v4.0/errata01/os/complete/part3-csdl/odata-v4.0-errata01-os-part3-csdl-complete.html#_Attribute_BaseType
[2]: http://services.odata.org/V4/OData/OData.svc/$metadata

> Am 28.10.2014 um 19:24 schrieb Ramesh Reddy <ra...@redhat.com>:
> 
> 1) You can define each grade as its own EntityType. Then each can have their own property set specific to the grade. You can define a base EntityType and then define each one for different grade.


Re: Binary Property properly not display in Entity

Posted by Ramesh Reddy <ra...@redhat.com>.
There are couple different possibilities. 
1) You can define each grade as its own EntityType. Then each can have their own property set specific to the grade. You can define a base EntityType and then define each one for different grade. 
2) In the V4, there is "OpenType" you can define on the EntityType, that allows adding the dynamic properties to the entity instance, however, from spec it looks like in only applies in insert and update situations. 
3) You can define multiple complex types for each grade, then have them defined in the your School EntityType. For ex: 

<EntityType Name="School"> 
<Key> 
<PropertyRef Name="ID" /> 
</Key> 
<Property Name="Name" Type="Edm.String" /> 
<Property Name="firstGrade" Type="first-grade" Nullable="false" /> 
<Property Name="secondGrade" Type="second-grade" Nullable="false" /> 
</EntityType> 

<ComplexType Name="first-grade"> 

<Property Name="ID" Type="Edm.Int32" Nullable="false" /> 
<Property Name="teacher" Type="EDM.String" /> 
</ComplexType> 

<ComplexType Name="second-grade"> 

<Property Name="ID" Type="Edm.Int32" Nullable="false" /> 
<Property Name="location" Type="Edm.String" /> 
</ComplexType> 

but have the entity instance have only either of "firstGrade" or "secondGrade" value. 

I recommend (1), however when you issue a query you need to get EntitySet for given grade, not generically by School type. If that is not acceptable then use (3). 

Ramesh.. 
----- Original Message -----

> i have to display template of particular object in JSON format then what is
> the best fit to declare my meta data.

> Here is an example:

> I have a school as an entity set, which has different grades, I designed each
> grade as an entity.
> Because each grade has its own properties, now if some one asks give me a
> template how first/second grade student data should look like? Then I
> declare a property and set my template values , I believe for template
> values better to use JSON.

> {
> "Name" :"xxxxxxxxxx",
> "Grade": "First",
> .
> .
> .
> Some more details
> }

> On Tuesday, October 28, 2014, Ramesh Reddy < rareddy@redhat.com > wrote:

> > Ah! the issue is you have defined your property and metadata for it
> > incorrectly then. You defined as "binary", but you are expecting the result
> > as "complex type" or "entity type". Correct the definition of it, then
> > supply the data accordingly in your service then it will show as expected
> > in
> > your client.
> 

> > When a property is defined as "binary" that means it is binary object, like
> > image or sound file or token of some kind or custom object where
> > deciphering
> > is only possible by the client which understands the format. In order to
> > send the binary object over HTTP it needs to be encoded in base64 format,
> > the clients can decode back from base64, then decipher it based on either a
> > known type or custom methods.
> 

> > In your case you are sending a "json" object some kind (is it string, a
> > java
> > object, .net object? what?) and expecting a client like browser to
> > understand what object type it is and decode it, which is not possible. Not
> > only that, you can not set mime type on individual properties, it is on
> > whole response.
> 

> > HTH
> 

> > Ramesh..
> 

> > > { " costCenter ": " costCenterValue " , " creationUserID ": "
> > > creationUserIDValue " , " Custom ": { " dataType ": " dataTypeValue " , "
> > > targetFieldName ": " targetFieldNameValue " , " description ": "
> > > descriptionValue " , " name ": " nameValue " , " defaultValue ": "
> > > defaultValueValue " } , " ownerUserID ": " ownerUserIDValue " }
> > 
> 
> > > I am able to see this response if I am using $ value of property(Olingo
> > > 4.0.0. beta 2) , I am expecting the same if I am using entity by Id as
> > > property mime type is application/json
> > 
> 

> > > On Tue, Oct 28, 2014 at 9:27 PM, Ramesh Reddy < rareddy@redhat.com >
> > > wrote:
> > 
> 

> > > > From below example what would be your expectation of JSON data
> > > > representation?
> > > 
> > 
> 

> > > > > When I set property mime type
> > > > > setType(nameBinary).setMimeType("application/json"); then my server
> > > > > should
> > > > > send JSON.
> > > > 
> > > 
> > 
> 

> > > > > On Tue, Oct 28, 2014 at 9:03 PM, Ramesh Reddy < rareddy@redhat.com >
> > > > > wrote:
> > > > 
> > > 
> > 
> 

> > > > > > Let me reverse the question and ask you what do you expect to see
> > > > > > in
> > > > > > the
> > > > > > rest
> > > > > > client for binary data?
> > > > > 
> > > > 
> > > 
> > 
> 

> > > > > > > I want to get the property value without $value, I think it is
> > > > > > > possible
> > > > > > > in
> > > > > > > ODATA 4. If the property type is media recourse we can access the
> > > > > > > property
> > > > > > > value without $ value.
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 
> > > > > > > I think in the similar lines for the binary also.
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 
> > > > > > > Here is the URL which I am sending through my postman(Rest
> > > > > > > client)
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 

> > > > > > > http://localhost:8080/TEST/odata.svc/ABC('Asset ') the response
> > > > > > > look
> > > > > > > like
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 

> > > > > > > { " @odata.context ": " $metadata#ABC/$entity " , " Name ": "
> > > > > > > Asset
> > > > > > > "
> > > > > > > ,
> > > > > > > "UserName": "FirUser", --- Property of type String
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 
> > > > > > > "ID": 23, --- Property of type ID
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 
> > > > > > > "Template":
> > > > > > > "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
> > > > > > > --- Property of type Binary
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 
> > > > > > > ​}
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 
> > > > > > > Except Binary every value displaying properly in rest client.
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 

> > > > > > > Vijay
> > > > > > 
> > > > > 
> > > > 
> > > 
> > 
> 

Binary Property properly not display in Entity

Posted by Vijay Kumar Rani <rv...@gmail.com>.
i have to display template of particular object in JSON format then what is
the best fit to declare my meta data.

Here is an example:

I have a school as an entity set, which has different grades, I designed
each grade as an entity.
Because each grade has its own properties, now if some one asks give me a
template how first/second grade student data should look like? Then I
declare a property and set my template values , I believe for template
values better to use JSON.

{
"Name" :"xxxxxxxxxx",
"Grade": "First",
.
.
.
Some more details
}


On Tuesday, October 28, 2014, Ramesh Reddy <rareddy@redhat.com
<javascript:_e(%7B%7D,'cvml','rareddy@redhat.com');>> wrote:

> Ah! the issue is you have defined your property and metadata for it
> incorrectly then. You defined as "binary", but you are expecting the result
> as "complex type" or "entity type". Correct the definition of it, then
> supply the data accordingly in your service then it will show as expected
> in your client.
>
> When a property is defined as "binary" that means it is binary object,
> like image or sound file or token of some kind or custom object where
> deciphering is only possible by the client which understands the format. In
> order to send the binary object over HTTP it needs to be encoded in base64
> format, the clients can decode back from base64, then decipher it based on
> either a known type or custom methods.
>
> In your case you are sending a "json" object some kind (is it string, a
> java object, .net object? what?) and expecting a client like browser to
> understand what object type it is and decode it, which is not possible. Not
> only that, you can not set mime type on individual properties, it is on
> whole response.
>
> HTH
>
> Ramesh..
>
> ------------------------------
>
>
> {"costCenter": "costCenterValue","creationUserID": "creationUserIDValue","
> Custom": {"dataType": "dataTypeValue","targetFieldName": "
> targetFieldNameValue","description": "descriptionValue","name": "nameValue
> ","defaultValue": "defaultValueValue"},"ownerUserID": "ownerUserIDValue"}
> I am able to see this response if I am using $ value of property(Olingo
> 4.0.0. beta 2) , I am expecting the same if I am using entity by Id as
> property mime type is application/json
>
> On Tue, Oct 28, 2014 at 9:27 PM, Ramesh Reddy <ra...@redhat.com> wrote:
>
>> From below example what would be your expectation of JSON data
>> representation?
>>
>> ------------------------------
>>
>> When I set property mime
>> type setType(nameBinary).setMimeType("application/json"); then my server
>> should send JSON.
>>
>> On Tue, Oct 28, 2014 at 9:03 PM, Ramesh Reddy <ra...@redhat.com> wrote:
>>
>>> Let me reverse the question and ask you what do you expect to see in the
>>> rest client for binary data?
>>>
>>> ------------------------------
>>>
>>> I want to get the property value without $value, I think it is possible
>>> in ODATA 4. If the property type is media recourse we can access the
>>> property value without $ value.
>>> I think in the similar lines for the binary also.
>>> Here is the URL which I am sending through my postman(Rest client)
>>>
>>> http://localhost:8080/TEST/odata.svc/ABC('Asset') the response look like
>>>
>>> {"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName":
>>> "FirUser", --- Property of type String
>>> "ID": 23, --- Property of type ID
>>> "Template":
>>> "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
>>> --- Property of type Binary
>>> ​}
>>> Except Binary every value displaying properly in rest client.
>>>
>>> Vijay
>>>
>>>
>>>
>>
>>
>
>

Re: Binary Property properly not display in Entity

Posted by Ramesh Reddy <ra...@redhat.com>.
Ah! the issue is you have defined your property and metadata for it incorrectly then. You defined as "binary", but you are expecting the result as "complex type" or "entity type". Correct the definition of it, then supply the data accordingly in your service then it will show as expected in your client. 

When a property is defined as "binary" that means it is binary object, like image or sound file or token of some kind or custom object where deciphering is only possible by the client which understands the format. In order to send the binary object over HTTP it needs to be encoded in base64 format, the clients can decode back from base64, then decipher it based on either a known type or custom methods. 

In your case you are sending a "json" object some kind (is it string, a java object, .net object? what?) and expecting a client like browser to understand what object type it is and decode it, which is not possible. Not only that, you can not set mime type on individual properties, it is on whole response. 

HTH 

Ramesh.. 

----- Original Message -----

> { " costCenter ": " costCenterValue " , " creationUserID ": "
> creationUserIDValue " , " Custom ": { " dataType ": " dataTypeValue " , "
> targetFieldName ": " targetFieldNameValue " , " description ": "
> descriptionValue " , " name ": " nameValue " , " defaultValue ": "
> defaultValueValue " } , " ownerUserID ": " ownerUserIDValue " }
> I am able to see this response if I am using $ value of property(Olingo
> 4.0.0. beta 2) , I am expecting the same if I am using entity by Id as
> property mime type is application/json

> On Tue, Oct 28, 2014 at 9:27 PM, Ramesh Reddy < rareddy@redhat.com > wrote:

> > From below example what would be your expectation of JSON data
> > representation?
> 

> > > When I set property mime type
> > > setType(nameBinary).setMimeType("application/json"); then my server
> > > should
> > > send JSON.
> > 
> 

> > > On Tue, Oct 28, 2014 at 9:03 PM, Ramesh Reddy < rareddy@redhat.com >
> > > wrote:
> > 
> 

> > > > Let me reverse the question and ask you what do you expect to see in
> > > > the
> > > > rest
> > > > client for binary data?
> > > 
> > 
> 

> > > > > I want to get the property value without $value, I think it is
> > > > > possible
> > > > > in
> > > > > ODATA 4. If the property type is media recourse we can access the
> > > > > property
> > > > > value without $ value.
> > > > 
> > > 
> > 
> 
> > > > > I think in the similar lines for the binary also.
> > > > 
> > > 
> > 
> 
> > > > > Here is the URL which I am sending through my postman(Rest client)
> > > > 
> > > 
> > 
> 

> > > > > http://localhost:8080/TEST/odata.svc/ABC('Asset ') the response look
> > > > > like
> > > > 
> > > 
> > 
> 

> > > > > { " @odata.context ": " $metadata#ABC/$entity " , " Name ": " Asset "
> > > > > ,
> > > > > "UserName": "FirUser", --- Property of type String
> > > > 
> > > 
> > 
> 
> > > > > "ID": 23, --- Property of type ID
> > > > 
> > > 
> > 
> 
> > > > > "Template":
> > > > > "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
> > > > > --- Property of type Binary
> > > > 
> > > 
> > 
> 
> > > > > ​}
> > > > 
> > > 
> > 
> 
> > > > > Except Binary every value displaying properly in rest client.
> > > > 
> > > 
> > 
> 

> > > > > Vijay
> > > > 
> > > 
> > 
> 

Re: Binary Property properly not display in Entity

Posted by Vijay Kumar Rani <rv...@gmail.com>.
{"costCenter": "costCenterValue","creationUserID": "creationUserIDValue","
Custom": {"dataType": "dataTypeValue","targetFieldName": "
targetFieldNameValue","description": "descriptionValue","name": "nameValue",
"defaultValue": "defaultValueValue"},"ownerUserID": "ownerUserIDValue"}
I am able to see this response if I am using $ value of property(Olingo
4.0.0. beta 2) , I am expecting the same if I am using entity by Id as
property mime type is application/json

On Tue, Oct 28, 2014 at 9:27 PM, Ramesh Reddy <ra...@redhat.com> wrote:

> From below example what would be your expectation of JSON data
> representation?
>
> ------------------------------
>
> When I set property mime
> type setType(nameBinary).setMimeType("application/json"); then my server
> should send JSON.
>
> On Tue, Oct 28, 2014 at 9:03 PM, Ramesh Reddy <ra...@redhat.com> wrote:
>
>> Let me reverse the question and ask you what do you expect to see in the
>> rest client for binary data?
>>
>> ------------------------------
>>
>> I want to get the property value without $value, I think it is possible
>> in ODATA 4. If the property type is media recourse we can access the
>> property value without $ value.
>> I think in the similar lines for the binary also.
>> Here is the URL which I am sending through my postman(Rest client)
>>
>> http://localhost:8080/TEST/odata.svc/ABC('Asset') the response look like
>>
>> {"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName":
>> "FirUser", --- Property of type String
>> "ID": 23, --- Property of type ID
>> "Template":
>> "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
>> --- Property of type Binary
>> ​}
>> Except Binary every value displaying properly in rest client.
>>
>> Vijay
>>
>>
>>
>
>

Re: Binary Property properly not display in Entity

Posted by Ramesh Reddy <ra...@redhat.com>.
>From below example what would be your expectation of JSON data representation? 

----- Original Message -----

> When I set property mime type
> setType(nameBinary).setMimeType("application/json"); then my server should
> send JSON.

> On Tue, Oct 28, 2014 at 9:03 PM, Ramesh Reddy < rareddy@redhat.com > wrote:

> > Let me reverse the question and ask you what do you expect to see in the
> > rest
> > client for binary data?
> 

> > > I want to get the property value without $value, I think it is possible
> > > in
> > > ODATA 4. If the property type is media recourse we can access the
> > > property
> > > value without $ value.
> > 
> 
> > > I think in the similar lines for the binary also.
> > 
> 
> > > Here is the URL which I am sending through my postman(Rest client)
> > 
> 

> > > http://localhost:8080/TEST/odata.svc/ABC('Asset ') the response look like
> > 
> 

> > > { " @odata.context ": " $metadata#ABC/$entity " , " Name ": " Asset " ,
> > > "UserName": "FirUser", --- Property of type String
> > 
> 
> > > "ID": 23, --- Property of type ID
> > 
> 
> > > "Template":
> > > "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
> > > --- Property of type Binary
> > 
> 
> > > ​}
> > 
> 
> > > Except Binary every value displaying properly in rest client.
> > 
> 

> > > Vijay
> > 
> 

Re: Binary Property properly not display in Entity

Posted by Vijay Kumar Rani <rv...@gmail.com>.
When I set property mime
type setType(nameBinary).setMimeType("application/json"); then my server
should send JSON.

On Tue, Oct 28, 2014 at 9:03 PM, Ramesh Reddy <ra...@redhat.com> wrote:

> Let me reverse the question and ask you what do you expect to see in the
> rest client for binary data?
>
> ------------------------------
>
> I want to get the property value without $value, I think it is possible in
> ODATA 4. If the property type is media recourse we can access the property
> value without $ value.
> I think in the similar lines for the binary also.
> Here is the URL which I am sending through my postman(Rest client)
>
> http://localhost:8080/TEST/odata.svc/ABC('Asset') the response look like
>
> {"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName":
> "FirUser", --- Property of type String
> "ID": 23, --- Property of type ID
> "Template":
> "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
> --- Property of type Binary
> ​}
> Except Binary every value displaying properly in rest client.
>
> Vijay
>
>
>

Re: Binary Property properly not display in Entity

Posted by Ramesh Reddy <ra...@redhat.com>.
Let me reverse the question and ask you what do you expect to see in the rest client for binary data? 

----- Original Message -----

> I want to get the property value without $value, I think it is possible in
> ODATA 4. If the property type is media recourse we can access the property
> value without $ value.
> I think in the similar lines for the binary also.
> Here is the URL which I am sending through my postman(Rest client)

> http://localhost:8080/TEST/odata.svc/ABC('Asset ') the response look like

> { " @odata.context ": " $metadata#ABC/$entity " , " Name ": " Asset " ,
> "UserName": "FirUser", --- Property of type String
> "ID": 23, --- Property of type ID
> "Template":
> "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
> --- Property of type Binary
> ​}
> Except Binary every value displaying properly in rest client.

> Vijay

RE: Binary Property properly not display in Entity

Posted by "Amend, Christian" <ch...@sap.com>.
Hi Vijay,

If you would like to get the binary data of any resource you will need the $value option. This is in V2 the same as in V4.

If you would like to access the value of a property you will need a URI like: /EntitySet(key)/Property/$value
If you would like to access a MediaResource you will need a URI like: /EntitySet(key)/$value

Please note that currently the 4.0.0-beta-01 does not support media resources. We hope to deliver this with future releases.

Best Regards,
Christian

From: Vijay Kumar Rani [mailto:rvkumar@gmail.com]
Sent: Dienstag, 28. Oktober 2014 16:18
To: user@olingo.apache.org
Subject: Re: Binary Property properly not display in Entity

I want to get the property value without $value, I think it is possible in ODATA 4. If the property type is media recourse we can access the property value without $ value.
I think in the similar lines for the binary also.
Here is the URL which I am sending through my postman(Rest client)

http://localhost:8080/TEST/odata.svc/ABC('Asset') the response look like

{"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName": "FirUser", --- Property of type String
"ID": 23, --- Property of type ID
"Template": "ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa" --- Property of type Binary
​}
Except Binary every value displaying properly in rest client.

Vijay

Re: Binary Property properly not display in Entity

Posted by Vijay Kumar Rani <rv...@gmail.com>.
I want to get the property value without $value, I think it is possible in
ODATA 4. If the property type is media recourse we can access the property
value without $ value.
I think in the similar lines for the binary also.
Here is the URL which I am sending through my postman(Rest client)

http://localhost:8080/TEST/odata.svc/ABC('Asset') the response look like

{"@odata.context": "$metadata#ABC/$entity","Name": "Asset", "UserName":
"FirUser", --- Property of type String
"ID": 23, --- Property of type ID
"Template":
"ZXlKdGIyUmdsdaadadadadadasdndkfjsfhjksafhkjsfhkjshffjsfbbnmbsjfhsajkhajhskfhsjkfksa"
--- Property of type Binary
​}
Except Binary every value displaying properly in rest client.

Vijay

RE: Binary Property properly not display in Entity

Posted by "Amend, Christian" <ch...@sap.com>.
Hi,

what do you mean by it is not displaying properly in the entity? As a property inside the entity it should always be a base64 encoded String. Only by calling $value you will get back the raw value of the property.

To select only specific properties within an entity you can use the $select option. But there is no way to tell a service to not give back properties which are of the type binary.

Best Regards,
Christian

From: Vijay Kumar Rani [mailto:rvkumar@gmail.com]
Sent: Dienstag, 28. Oktober 2014 11:56
To: user@olingo.apache.org
Subject: Binary Property properly not display in Entity

I have a property Binary in my entity, If I am accessing single entity the property, is displaying not properly as it is binary format but getting property and property value is working good,

How can I stop showing the binary format of property while getting the entity by Id.

Can I use link over there which will navigate me to corresponding property value?