Hi Apama,

If I understand your question you are looking for a way to parse a given String 
into a PathInfo object to get the root URI of the service?

If yes, there is currently no support for this use case.
If no, you get the service root URI via "ODataContext -> PathInfo -> 
getServiceRoot()" as shown in the examples below: 

ODataContext context;
PathInfo pathInfo = context.getPathInfo();

pathInfo.getServiceRoot()
=> http://services.odata.org/OData/OData.svc/

pathInfo.getRequestUri()
=> 
http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name

pathInfo.getServiceRoot().relativize(pathInfo.getRequestUri()
=> Category(1)/Products?$top=2&$orderby=name

pathInfo.getServiceRoot().relativize(pathInfo.getRequestUri()).getPath()
=> Category(1)

Kind regards,
Michael

On 14.03.2014, at 11:44, Khare, Aparna <aparna.kh...@sap.com> wrote:

> Hello Team,
> 
>   Please can you help us with the issue we are facing :-
> 
> I have a edm file and I'm able to create an EDMprovider from that.
> 
> The edmx will have a URL which is a string field .
> 
> In my application I would want to get the service root from the string url
> 
> Eq:-
> http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name
> _______________________________________/ __________________/  
> _________________/
>                   |                                |                    |
>             service root URI                  resource path        query 
> options
> 
> Can you please help us with this.
> 
> I would have to read the service root ,resource path and key property in case 
> of a PUT (http://services.odata.org/V3/Northwind/Northwind.svc/Categories(1))
> 
> 
> Thanks and Regards,
> Aparna

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to