You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Mark Sztainbok <ma...@okta.com> on 2014/08/29 23:01:23 UTC

Issue with OdataJClient

I'm using the Maven plugin to generate proxies for the Windows Azure Active Directory Graph API (metadata at https://graph.windows.net/common/$metadata<https://graph.windows.net/common/%24metadata>) using ODataJClient.

When the proxies are generated and built, I'm getting the following errors:
ERROR] /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/types/User.java:[837,32] cannot find symbol
symbol : class directoryObjects
location: interface com.microsoft.windowsazure.activedirectory.types.User
[ERROR] /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/DirectoryDataService.java:[56,32] cannot find symbol
symbol : class directoryObjects
location: interface com.microsoft.windowsazure.activedirectory.DirectoryDataService

Looking at the generated code, the proxies are generated with the class directoryObjects:

@FunctionImport(name = "assignLicense" ,
                entitySet = directoryObjects.class     ,
                returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")

@FunctionImport(name = "assignLicense" ,
                entitySet = directoryObjects.class     ,
                returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")


The problem is that the class is not directoryObjects.class but DirectoryObjects.class. Changing the entitySet to be DirectoryObjects.class allows compilation to pass but would fail again if the proxy code is regenerated.

Is there a workaround for this? How I can fix the issue?


Also is there a way to use an EDMX file to generated the proxy classes? I tried setting the serviceRootUrl to be a file URI but it still tried to download the metadata like it was an HTTP URI.

Additionally, is there a way to specify a parameter for the serviceRootUrl? The Windows Azure Active Directory Graph API passes a version as a parameter which alters the behaviour of the API based on the version e.g. https://graph.windows.net/common/$metadata?api-version=1.21-preview<https://graph.windows.net/common/%24metadata?api-version=1.21-preview> (in fact this is the Microsoft standard way for version for Azure API's).


Thanks,

Mark



Re: Issue with OdataJClient

Posted by Fabio Martelli <fa...@gmail.com>.
Il 29/08/2014 23:01, Mark Sztainbok ha scritto:
> I'm using the Maven plugin to generate proxies for the Windows Azure 
> Active Directory Graph API (metadata at 
> https://graph.windows.net/common/$metadata 
> <https://graph.windows.net/common/%24metadata>) using ODataJClient.
>
> When the proxies are generated and built, I'm getting the following 
> errors:
> ERROR] 
> /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/types/User.java:[837,32] 
> cannot find symbol
> symbol : class directoryObjects
> location: interface com.microsoft.windowsazure.activedirectory.types.User
> [ERROR] 
> /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/DirectoryDataService.java:[56,32] 
> cannot find symbol
> symbol : class directoryObjects
> location: interface 
> com.microsoft.windowsazure.activedirectory.DirectoryDataService
>
> Looking at the generated code, the proxies are generated with the 
> class directoryObjects:
>
> |@FunctionImport(name = "assignLicense" ,
>                  entitySet = directoryObjects.class     ,
>                  returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")
>
> @FunctionImport(name = "assignLicense" ,
>                  entitySet = directoryObjects.class     ,
>                  returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")
> |
>
> The problem is that the class is not directoryObjects.class but 
> DirectoryObjects.class. Changing the entitySet to be 
> DirectoryObjects.class allows compilation to pass but would fail again 
> if the proxy code is regenerated.
>
> Is there a workaround for this? How I can fix the issue?
>
>
> Also is there a way to use an EDMX file to generated the proxy 
> classes? I tried setting the serviceRootUrl to be a file URI but it 
> still tried to download the metadata like it was an HTTP URI.
>
> Additionally, is there a way to specify a parameter for the 
> serviceRootUrl? The Windows Azure Active Directory Graph API passes a 
> version as a parameter which alters the behaviour of the API based on 
> the version e.g. 
> https://graph.windows.net/common/$metadata?api-version=1.21-preview 
> <https://graph.windows.net/common/%24metadata?api-version=1.21-preview> (in 
> fact this is the Microsoft standard way for version for Azure API’s).
>
>
> Thanks,
>
> Mark
>
Hi Mark, I've just generated the proxy code from [1] without any error.
Please, take a look at [2] and try again.

Best regards,
F.

[1] https://graph.windows.net/common/$metadata
[2] 
https://github.com/apache/olingo-odata4/tree/master/ext/pojogen-maven-plugin/src/it/v3Sample


-- 
Fabio Martelli

Tirasa - Open Source Excellence
http://www.tirasa.net/

Apache Syncope PMC
http://people.apache.org/~fmartelli/


Re: Issue with OdataJClient

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 01/09/2014 18:19, Mark Sztainbok wrote:
> The service I’m using is using OData 3.0 and Olingo only supports 2.0 
> and 4.0 so I’m not sure it will work. Additionally the service in the 
> example below is an OData 4.0 service.

Olingo 4 client library is designed to work both with OData 3.0 and 
OData 4.0 - the sample that Fabio provided in his reply to your e-mail 
[1] is for an OData 3.0 service.

Basically, all you need is to replace something like as

ODataClient client = 
ODataClientFactory.getEdmEnabledV4("https://outlook.office365.com/ews/odata");

with

ODataClient client = 
ODataClientFactory.getEdmEnabledV3("https://graph.windows.net/common");


HTH
Regards.

[1] 
https://github.com/apache/olingo-odata4/tree/master/ext/pojogen-maven-plugin/src/it/v3Sample

>
> From: Francesco Chicchiriccò <ilgrosso@apache.org 
> <ma...@apache.org>>
> Date: Sunday, August 31, 2014 at 11:36 PM
> To: <user@olingo.apache.org <ma...@olingo.apache.org>>
> Subject: Re: Issue with OdataJClient
>
> Hi Mark,
> before getting into any analysis. could you please migrate your code 
> to Olingo 4?
>
> You can take a look at this sample - specific to OAuth2, but just to 
> give you an idea
>
> https://github.com/Tirasa/olingoClientOAuth2Sample
>
> Regards.
>
> On 29/08/2014 23:01, Mark Sztainbok wrote:
>> I'm using the Maven plugin to generate proxies for the Windows Azure 
>> Active Directory Graph API (metadata at 
>> https://graph.windows.net/common/$metadata 
>> <https://graph.windows.net/common/%24metadata>) using ODataJClient.
>>
>> When the proxies are generated and built, I'm getting the following 
>> errors:
>> ERROR] 
>> /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/types/User.java:[837,32] 
>> cannot find symbol
>> symbol : class directoryObjects
>> location: interface com.microsoft.windowsazure.activedirectory.types.User
>> [ERROR] 
>> /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/DirectoryDataService.java:[56,32] 
>> cannot find symbol
>> symbol : class directoryObjects
>> location: interface 
>> com.microsoft.windowsazure.activedirectory.DirectoryDataService
>>
>> Looking at the generated code, the proxies are generated with the 
>> class directoryObjects:
>>
>> |@FunctionImport(name = "assignLicense" ,
>>                  entitySet = directoryObjects.class     ,
>>                  returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")
>>
>> @FunctionImport(name = "assignLicense" ,
>>                  entitySet = directoryObjects.class     ,
>>                  returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")
>> |
>>
>> The problem is that the class is not directoryObjects.class but 
>> DirectoryObjects.class. Changing the entitySet to be 
>> DirectoryObjects.class allows compilation to pass but would fail 
>> again if the proxy code is regenerated.
>>
>> Is there a workaround for this? How I can fix the issue?
>>
>>
>> Also is there a way to use an EDMX file to generated the proxy 
>> classes? I tried setting the serviceRootUrl to be a file URI but it 
>> still tried to download the metadata like it was an HTTP URI.
>>
>> Additionally, is there a way to specify a parameter for the 
>> serviceRootUrl? The Windows Azure Active Directory Graph API passes a 
>> version as a parameter which alters the behaviour of the API based on 
>> the version e.g. 
>> https://graph.windows.net/common/$metadata?api-version=1.21-preview 
>> <https://graph.windows.net/common/%24metadata?api-version=1.21-preview>Â (in 
>> fact this is the Microsoft standard way for version for Azure API’s).
>>
>>
>> Thanks,
>>
>> Mark
>>
-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Re: Issue with OdataJClient

Posted by Mark Sztainbok <ma...@okta.com>.
The service I’m using is using OData 3.0 and Olingo only supports 2.0 and 4.0 so I’m not sure it will work. Additionally the service in the example below is an OData 4.0 service.

From: Francesco Chicchiriccò <il...@apache.org>>
Date: Sunday, August 31, 2014 at 11:36 PM
To: <us...@olingo.apache.org>>
Subject: Re: Issue with OdataJClient

Hi Mark,
before getting into any analysis. could you please migrate your code to Olingo 4?

You can take a look at this sample - specific to OAuth2, but just to give you an idea

https://github.com/Tirasa/olingoClientOAuth2Sample

Regards.

On 29/08/2014 23:01, Mark Sztainbok wrote:
I'm using the Maven plugin to generate proxies for the Windows Azure Active Directory Graph API (metadata at https://graph.windows.net/common/$metadata<https://graph.windows.net/common/%24metadata>) using ODataJClient.

When the proxies are generated and built, I'm getting the following errors:
ERROR] /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/types/User.java:[837,32] cannot find symbol
symbol : class directoryObjects
location: interface com.microsoft.windowsazure.activedirectory.types.User
[ERROR] /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/DirectoryDataService.java:[56,32] cannot find symbol
symbol : class directoryObjects
location: interface com.microsoft.windowsazure.activedirectory.DirectoryDataService

Looking at the generated code, the proxies are generated with the class directoryObjects:

@FunctionImport(name = "assignLicense" ,
                entitySet = directoryObjects.class     ,
                returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")

@FunctionImport(name = "assignLicense" ,
                entitySet = directoryObjects.class     ,
                returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")


The problem is that the class is not directoryObjects.class but DirectoryObjects.class. Changing the entitySet to be DirectoryObjects.class allows compilation to pass but would fail again if the proxy code is regenerated.

Is there a workaround for this? How I can fix the issue?


Also is there a way to use an EDMX file to generated the proxy classes? I tried setting the serviceRootUrl to be a file URI but it still tried to download the metadata like it was an HTTP URI.

Additionally, is there a way to specify a parameter for the serviceRootUrl? The Windows Azure Active Directory Graph API passes a version as a parameter which alters the behaviour of the API based on the version e.g. https://graph.windows.net/common/$metadata?api-version=1.21-preview<https://graph.windows.net/common/%24metadata?api-version=1.21-preview> (in fact this is the Microsoft standard way for version for Azure API’s).


Thanks,

Mark

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/

Re: Issue with OdataJClient

Posted by Francesco Chicchiriccò <il...@apache.org>.
Hi Mark,
before getting into any analysis. could you please migrate your code to 
Olingo 4?

You can take a look at this sample - specific to OAuth2, but just to 
give you an idea

https://github.com/Tirasa/olingoClientOAuth2Sample

Regards.

On 29/08/2014 23:01, Mark Sztainbok wrote:
> I'm using the Maven plugin to generate proxies for the Windows Azure 
> Active Directory Graph API (metadata at 
> https://graph.windows.net/common/$metadata 
> <https://graph.windows.net/common/%24metadata>) using ODataJClient.
>
> When the proxies are generated and built, I'm getting the following 
> errors:
> ERROR] 
> /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/types/User.java:[837,32] 
> cannot find symbol
> symbol : class directoryObjects
> location: interface com.microsoft.windowsazure.activedirectory.types.User
> [ERROR] 
> /Users/mark.sztainbok/okta/okta-core/generated/target/generated-sources/ojc-plugin/com/microsoft/windowsazure/activedirectory/DirectoryDataService.java:[56,32] 
> cannot find symbol
> symbol : class directoryObjects
> location: interface 
> com.microsoft.windowsazure.activedirectory.DirectoryDataService
>
> Looking at the generated code, the proxies are generated with the 
> class directoryObjects:
>
> |@FunctionImport(name = "assignLicense" ,
>                  entitySet = directoryObjects.class     ,
>                  returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")
>
> @FunctionImport(name = "assignLicense" ,
>                  entitySet = directoryObjects.class     ,
>                  returnType = "Microsoft.WindowsAzure.ActiveDirectory.User")
> |
>
> The problem is that the class is not directoryObjects.class but 
> DirectoryObjects.class. Changing the entitySet to be 
> DirectoryObjects.class allows compilation to pass but would fail again 
> if the proxy code is regenerated.
>
> Is there a workaround for this? How I can fix the issue?
>
>
> Also is there a way to use an EDMX file to generated the proxy 
> classes? I tried setting the serviceRootUrl to be a file URI but it 
> still tried to download the metadata like it was an HTTP URI.
>
> Additionally, is there a way to specify a parameter for the 
> serviceRootUrl? The Windows Azure Active Directory Graph API passes a 
> version as a parameter which alters the behaviour of the API based on 
> the version e.g. 
> https://graph.windows.net/common/$metadata?api-version=1.21-preview 
> <https://graph.windows.net/common/%24metadata?api-version=1.21-preview> (in 
> fact this is the Microsoft standard way for version for Azure API’s).
>
>
> Thanks,
>
> Mark
>
-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/