You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Tobias Stolzenberger (JIRA)" <ji...@apache.org> on 2016/04/21 19:13:25 UTC

[jira] [Updated] (OLINGO-938) Batch Request fails if it contains Function Call with absolute request URI

     [ https://issues.apache.org/jira/browse/OLINGO-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Stolzenberger updated OLINGO-938:
----------------------------------------
    Summary: Batch Request fails if it contains Function Call with absolute request URI  (was: Batch Request fails contains Function with absolute request URI)

> Batch Request fails if it contains Function Call with absolute request URI
> --------------------------------------------------------------------------
>
>                 Key: OLINGO-938
>                 URL: https://issues.apache.org/jira/browse/OLINGO-938
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.6
>            Reporter: Tobias Stolzenberger
>            Assignee: Michael Bolz
>
> Hi,
> I'm using Olingo version 2.0.6 with JPA adapter. I'm sending a batch message to the server that contains a function which uses an absolute URI in the status line. This message is related to ticket https://issues.apache.org/jira/browse/OLINGO-926. Using absolute URIs within the HTTP status lines of batch request bodies seem to work properly for all kind of operations except functions.
> My metadata looks like this:
> {code:borderStyle=solid}
> <FunctionImport Name="EmptyGetOperation" ReturnType="Edm.String" m:HttpMethod="GET"/>
> {code}
> If I call this function wiht a single reques and not via batch it works correctly:
> {code:borderStyle=solid}
> GET https://host/path/EmptyGetOperation
> {code}
> Executing the same function as part of a batch request fails with error message: Error while executeBatchorg.apache.olingo.odata2.api.batch.BatchException: Invalid URI: line '5'.
> This is the batch request payload I'm using:
> {code:borderStyle=solid}
> --batch_1
> Content-Type: application/http
> Content-Transfer-Encoding: binary
> GET https://host/path/EmptyGetOperation HTTP/1.1
> Host: hepindustrymobility1-industrymobility2.neo.ondemand.com
> Accept: application/xml
> --batch_1--
> {code}
> The complete stack trace is pasted below.
> If I'm using a relative URI in the batch request body then it succeeds: 
> {code:borderStyle=solid}
> --batch_1
> Content-Type: application/http
> Content-Transfer-Encoding: binary
> GET EmptyGetOperation HTTP/1.1
> Host: hepindustrymobility1-industrymobility2.neo.ondemand.com
> Accept: application/xml
> --batch_1--
> {code}
> But I doubt that this is HTTP 1.1 spec compliant. Also using the "origin-form" as request line I get the same error: 
> {code:borderStyle=solid}
> --batch_1
> Content-Type: application/http
> Content-Transfer-Encoding: binary
> GET /path/EmptyGetOperation HTTP/1.1
> Host: hepindustrymobility1-industrymobility2.neo.ondemand.com
> Accept: application/xml
> --batch_1--
> {code}
> Exception stacktrace:
> {code:borderStyle=solid}
> Error while executeBatchorg.apache.olingo.odata2.api.batch.BatchException: Invalid URI: line '5'.
> 	at org.apache.olingo.odata2.core.batch.v2.BatchTransformatorCommon$HttpRequestStatusLine.parseUri(BatchTransformatorCommon.java:216)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchTransformatorCommon$HttpRequestStatusLine.parse(BatchTransformatorCommon.java:165)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchTransformatorCommon$HttpRequestStatusLine.<init>(BatchTransformatorCommon.java:156)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchRequestTransformator.createRequest(BatchRequestTransformator.java:85)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchRequestTransformator.processQueryOperation(BatchRequestTransformator.java:78)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchRequestTransformator.transform(BatchRequestTransformator.java:52)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchParser.parseBatch(BatchParser.java:86)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchParser.parse(BatchParser.java:64)
> 	at org.apache.olingo.odata2.core.batch.v2.BatchParser.parseBatchRequest(BatchParser.java:58)
> 	at org.apache.olingo.odata2.core.ep.ProviderFacadeImpl.parseBatchRequest(ProviderFacadeImpl.java:237)
> 	at org.apache.olingo.odata2.api.ep.EntityProvider.parseBatchRequest(EntityProvider.java:887)
> 	at com.sap.icmobile.demo.odata.jpa.base.DefaultODataJpaProcessor.executeBatch(DefaultODataJpaProcessor.java:304)
> 	at org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)
> 	at org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)
> 	at org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)
> 	at org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:86)
> 	at sun.reflect.GeneratedMethodAccessor630.invoke(Unknown Source))
> {code}
> Regards,
> Tobias



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