[
https://issues.apache.org/jira/browse/OLINGO-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948627#comment-14948627
]
Ramesh Reddy commented on OLINGO-140:
-------------------------------------
[~Michele EnergySys] [~M Pan] Yes, Edm.Binary can be used as the parameter
type. The question I have is, what type of HTTP method are you using for this?
"GET"? Typically FuntionImports are designed as "GET" operations, that means
all the parameters as sent in URL. In those situations you would need to
include the contents of the file using base64 encoding, which is NOT
appropriate for the large payloads. FunctionImports can be designed as "PUT",
"POST", "DELETE" per [1], so I suggest using that. Not only that, you should
really use "Edm.Stream" for file based data, but there two complications with
that
1) Edm.Stream can be only used with Bound functions. (This is a limitation on
OData specification part)
2) Typically Streams can be arbitrarily large, these need be really designed
with "multipart" mechanics, I know spec does not call out specifically, not
sure it is a violation if designed as such
[1]
http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398352
> Function Import support for binary data
> ---------------------------------------
>
> Key: OLINGO-140
> URL: https://issues.apache.org/jira/browse/OLINGO-140
> Project: Olingo
> Issue Type: Question
> Affects Versions: V2 1.0.0
> Reporter: M Carissimi
> Assignee: Stephan Klevenz
>
> Hello,
> I have created a FucntionImport for one of my EnityTypes which has a single
> parameter of type Edm.Binary. This is how the FunctionImport is shown on the
> metedata:
> <FunctionImport Name="Import_Readings"
> ReturnType="esys_producer.ES_IMPORT_READINGS" EntitySet="ES_IMPORT_READINGS"
> m:HttpMethod="POST">
> <Parameter Name="Import File" Type="Edm.Binary"/>
> </FunctionImport>
> I now need to create an OData consumer which is able to invoke the
> FunctionImport. I have created an html form where a file can be uploaded
> which then invokes a Java servlet. The servlet uses odata4j to connect to the
> OData service and invokes the function. Unfortunately the odata4j library
> does not allow to set the property type as a byte array, which is what would
> be required for a Binary parameter.
> I now have a few questions:
> - is it OK to have Binary parameters in a FunctionImport?
> - when inoking a FunctionImport, do all the parameter values get set on the
> URL? If so, will the limit on size of a URL stop us from sending a large
> binary parameter to a FunctionImport?
> - how can I create a client similar to the one described above using the
> Olingo library?
> Regards
> Miki
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)