[ 
https://issues.apache.org/jira/browse/OLINGO-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14965054#comment-14965054
 ] 

David Webb commented on OLINGO-758:
-----------------------------------

[~rareddy] - I ran into the same thing.  If you look at the javadoc for 
DefaultProcessor, it says you can override it with your own Implementation.

https://olingo.apache.org/javadoc/odata4/org/apache/olingo/server/api/processor/DefaultProcessor.html

Just copy the source of DefaultProcessor into a new class, make the change you 
are suggesting, then register your Default Processor with your handler.

{code}
ODataHttpHandler handler = odata.createHandler(edm);
handler.register(new CustomDefaultProcessor());  //This should be registered 
before anything else.
handler.register(new MyCollectionProcessor());
{code}

This did the trick for me, and regardless of the spec, there are some consumers 
of OData that require the URL to be absolute and not relative.  Rhymes with 
Bike-ro-soft. :)

Hope this helps you, as your solutions proposed above helped me.

> Wrong @odata.context returned by DefaultProcessor when requesting the service 
> document
> --------------------------------------------------------------------------------------
>
>                 Key: OLINGO-758
>                 URL: https://issues.apache.org/jira/browse/OLINGO-758
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.0.0-beta-03
>            Reporter: Riccardo Mariani
>
> Requesting the service document http://host/service, the DefaultProcessor 
> return this odata context in the response: 
> @odata.context: "$metadata"
> I think it should be 
> @odata.context: "http://host/service/$metadata";
> In the DefaultProcessor the response is set as:
> response.setContent(serializer.serviceDocument(serviceMetadata, 
> null).getContent());
> I think the response should be set as:
> response.setContent(serializer.serviceDocument(serviceMetadata, 
> request.getRawBaseUri()).getContent()); 



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

Reply via email to