You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Alex Maiereanu <al...@3sstudio.com> on 2014/10/06 22:51:43 UTC

Fwd: Olingo V4 Android integration problems

Hello,

I'm Alex, a developer who  tries to integrate the awesome Olingo Client
library into our project.

We are using the android client library

org.apache.olingo:odata-client-android:4.0.0-beta-01


We have a asp web api service configured to host a odata endpoint. I have
used the maven plugin :

  <build>
      <plugins>
        <plugin>
        <groupId>org.apache.olingo</groupId>
        <artifactId>pojogen-maven-plugin</artifactId>
        <version>4.0.0-beta-01</version>
        <executions>
          <execution>
            <configuration>

<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
              <serviceRootURL>http://10.10.10.125:5560/</serviceRootURL>

<basePackage>com.studio3s.vetandroid.veterinarian.Model.Odata</basePackage>
            </configuration>
            <id>v4pojoGen</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>v4pojoGen</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      </plugins>
  </build>

to generate the needed poco objects and service container.

Coming to my problem. I have an odata action. The maven plugin has
generated the default containter and created a method for the action. When
I call the method this request is generated


POST http://localhost:5560/Login() HTTP/1.1
Accept: application/json;odata.metadata=full
Content-Type: application/json;odata.metadata=full
OData-MaxVersion: 4.0
OData-Version: 4.0
Transfer-Encoding: chunked
Host: localhost:5560
Connection: Keep-Alive
User-Agent: Apache-Olingo/4.0.0-beta-01

115
{"Username@odata.type":"String","Username":"proba4","Password@odata.type
":"String","Password":"c1e2fb8e4bc2430bddd2c3b7bb64ab13e837810fddb27ab6fcf4ecb9ed3a512e77976f4da722adb9a8b9d1fee45f0dbfacc10cd36ca201afa65684c3f0fc3b27","Platform@odata.type
":"String","Platform":"Android"}
0

The request fails because of the url  http://localhost:5560/Login(), it
should be without ()  and because of the Transfer-Encoding: chunked . Can
the request be somehow modified




 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

Re: Fwd: Olingo V4 Android integration problems

Posted by Alex Maiereanu <al...@3sstudio.com>.
Hey,

Can anybody help me with this problem? Is it a bug ?

 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Mon, Oct 13, 2014 at 1:08 PM, Alex Maiereanu <alex.maiereanu@3sstudio.com
> wrote:

> Hello again everybody,
>
> So as Ralf is saying, the action call doesnt need a parenthesis.
>
> The generated Login action looks like this
>
>   Operations operations();
>
>   public interface Operations extends
> org.apache.olingo.ext.proxy.api.Operations {
>
>
>     @org.apache.olingo.ext.proxy.api.annotations.Operation(name = "Login",
>                    * type = OperationType.ACTION,*
>                     referenceType =
> com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage.class,
>                    returnType = "VAS.DTOs.AuthorizationMessage")
>
> org.apache.olingo.ext.proxy.api.StructuredInvoker<com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage>
> login(
>         @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
> "Username", type = "Edm.String", nullable = true) java.lang.String
> username,
>         @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
> "Password", type = "Edm.String", nullable = true) java.lang.String
> password,
>         @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
> "Platform", type = "Edm.String", nullable = true) java.lang.String platform
>     );
>
>
>     @org.apache.olingo.ext.proxy.api.annotations.Operation(name =
> "ResetPassword",
>                     type = OperationType.ACTION,
>                     referenceType =
> com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage.class,
>                    returnType = "VAS.DTOs.AuthorizationMessage")
>
> org.apache.olingo.ext.proxy.api.StructuredInvoker<com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage>
> resetPassword(
>         @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
> "Username", type = "Edm.String", nullable = true) java.lang.String
> username,
>         @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
> "Email", type = "Edm.String", nullable = true) java.lang.String email
>     );
>
>       }
>
>   <NE extends EntityType<?>> NE newEntityInstance(Class<NE> ref);
>
>   <T extends EntityType<?>, NEC extends EntityCollection<T, ?, ?>> NEC
> newEntityCollection(Class<NEC> ref);
>
>   <NE extends ComplexType<?>> NE newComplexInstance(Class<NE> ref);
>
>   <T extends ComplexType<?>, NEC extends ComplexCollection<T, ?, ?>> NEC
> newComplexCollection(Class<NEC> ref);
>
>   <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC
> newPrimitiveCollection(Class<T> ref);
>
>   EdmStreamValue newEdmStreamValue(String contentType, InputStream stream);
> }
>
>
> From the type I can see that it is
>
>   * type = OperationType.ACTION,*
>
>  Is this a bug in the odata android client or so we change something from
> the server?
>
>
>  Salutari din Brasov /  Greetings from Brasov
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com
>
> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
> <https://twitter.com/SmartSocialSoft> Google+
> <https://plus.google.com/101299629750815349588/posts>
>
> On Fri, Oct 10, 2014 at 3:06 PM, Handl, Ralf <ra...@sap.com> wrote:
>
>>  Hi Alex,
>>
>>
>>
>> I hid this in lines 179 and 759 of
>> http://docs.oasis-open.org/odata/odata/v4.0/errata01/os/complete/abnf/odata-abnf-construction-rules.txt:
>>
>>
>>
>>
>> actionImportCall = actionImport
>>
>>
>>
>> actionImport = odataIdentifier
>>
>>
>>
>> No parentheses for action calls.
>>
>>
>>
>> Function calls on the other hand always require functionParameters, which
>> require the parentheses in line 197:
>>
>>
>>
>> functionParameters = OPEN [ functionParameter *( COMMA functionParameter
>> ) ] CLOSE
>>
>>
>>
>>
>>
>> Regards
>>
>> --Ralf
>>
>>
>>
>> *From:* Alex Maiereanu [mailto:alex.maiereanu@3sstudio.com]
>> *Sent:* Tuesday, 7. October 2014 09:00
>> *To:* user@olingo.apache.org
>> *Subject:* Re: Fwd: Olingo V4 Android integration problems
>>
>>
>>
>> Hey Francesco,
>>
>>
>>
>> Thanks for the quick reply :) .
>>
>>
>>
>> I looked through the URL convention and also
>> http://docs.oasis-open.org/odata/odata/v4.0/os/abnf/odata-abnf-construction-rules.txt
>> , but I cannot see where it is specified  to actually put a parenthesis
>> after an action / function call.
>>
>>
>>
>> The Odata service is provided by Microsofts asp.net web api  and it
>> should be V4 compliant.  The interesting point is that we also have a .net
>> client, that uses the classes generated by the odata client generator. When
>> we call the same action on the .net client, the action is called without ()
>> and everything is working.
>>
>>
>>    Salutari din Brasov /  Greetings from Brasov
>>
>> [image: Image removed by sender.]
>>
>> Alex-Paul Maiereanu
>>
>> +40 761 684 212
>>
>> www.3sstudio.com
>>
>> [image: Image removed by sender.]Facebook
>> <https://www.facebook.com/smartsocialsoftware> [image: Image removed by
>> sender.]Twitter <https://twitter.com/SmartSocialSoft> [image: Image
>> removed by sender.]Google+
>> <https://plus.google.com/101299629750815349588/posts>
>>
>>
>>
>> On Tue, Oct 7, 2014 at 9:30 AM, Francesco Chicchiriccò <
>> ilgrosso@apache.org> wrote:
>>
>> Hi Alex,
>> see my replies in-line below.
>>
>> Regards.
>>
>>
>>
>> On 06/10/2014 22:51, Alex Maiereanu wrote:
>>
>>    Hello,
>>
>>
>>
>> I'm Alex, a developer who  tries to integrate the awesome Olingo Client
>> library into our project.
>>
>>
>>
>> We are using the android client library
>>
>>
>>
>> org.apache.olingo:odata-client-android:4.0.0-beta-01
>>
>>
>>
>>
>>
>> We have a asp web api service configured to host a odata endpoint. I have
>> used the maven plugin :
>>
>>
>>
>>   <build>
>>
>>       <plugins>
>>
>>         <plugin>
>>
>>         <groupId>org.apache.olingo</groupId>
>>
>>         <artifactId>pojogen-maven-plugin</artifactId>
>>
>>         <version>4.0.0-beta-01</version>
>>
>>         <executions>
>>
>>           <execution>
>>
>>             <configuration>
>>
>>
>> <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
>>
>>               <serviceRootURL>http://10.10.10.125:5560/</serviceRootURL>
>>
>>
>> <basePackage>com.studio3s.vetandroid.veterinarian.Model.Odata</basePackage>
>>
>>             </configuration>
>>
>>             <id>v4pojoGen</id>
>>
>>             <phase>generate-sources</phase>
>>
>>             <goals>
>>
>>               <goal>v4pojoGen</goal>
>>
>>             </goals>
>>
>>           </execution>
>>
>>         </executions>
>>
>>       </plugin>
>>
>>      </plugins>
>>
>>   </build>
>>
>>
>>
>> to generate the needed poco objects and service container.
>>
>>
>>
>> Coming to my problem. I have an odata action. The maven plugin has
>> generated the default containter and created a method for the action. When
>> I call the method this request is generated
>>
>>
>>
>>
>>
>> POST http://localhost:5560/Login() HTTP/1.1
>>
>> Accept: application/json;odata.metadata=full
>>
>> Content-Type: application/json;odata.metadata=full
>>
>> OData-MaxVersion: 4.0
>>
>> OData-Version: 4.0
>>
>> Transfer-Encoding: chunked
>>
>> Host: localhost:5560
>>
>> Connection: Keep-Alive
>>
>> User-Agent: Apache-Olingo/4.0.0-beta-01
>>
>>
>>
>> 115
>>
>> {"Username@odata.type" <Us...@odata.type>
>> :"String","Username":"proba4","Password@odata.type" <Pa...@odata.type>
>> :"String","Password":"c1e2fb8e4bc2430bddd2c3b7bb64ab13e837810fddb27ab6fcf4ecb9ed3a512e77976f4da722adb9a8b9d1fee45f0dbfacc10cd36ca201afa65684c3f0fc3b27",
>> "Platform@odata.type" <Pl...@odata.type>
>> :"String","Platform":"Android"}
>>
>> 0
>>
>>
>>
>> The request fails because of the url  http://localhost:5560/Login(), it
>> should be without ()
>>
>>
>>
>> Are you that this OData service is V4 compliant? If so, it should comply
>> with URL conventions [1] and require parenthesis after function / action
>> name.
>> With OData V3, instead, this is different - but many other things change
>> as well.
>>
>>
>>    and because of the Transfer-Encoding: chunked . Can the request be
>> somehow modified
>>
>>
>> service.getClient().getConfiguration().setUseChuncked(false);
>>
>> [1]
>> http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html
>>
>>  --
>>
>> 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: Fwd: Olingo V4 Android integration problems

Posted by Alex Maiereanu <al...@3sstudio.com>.
Hello again everybody,

So as Ralf is saying, the action call doesnt need a parenthesis.

The generated Login action looks like this

  Operations operations();

  public interface Operations extends
org.apache.olingo.ext.proxy.api.Operations {


    @org.apache.olingo.ext.proxy.api.annotations.Operation(name = "Login",
                   * type = OperationType.ACTION,*
                    referenceType =
com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage.class,
                   returnType = "VAS.DTOs.AuthorizationMessage")

org.apache.olingo.ext.proxy.api.StructuredInvoker<com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage>
login(
        @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
"Username", type = "Edm.String", nullable = true) java.lang.String
username,
        @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
"Password", type = "Edm.String", nullable = true) java.lang.String
password,
        @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
"Platform", type = "Edm.String", nullable = true) java.lang.String platform
    );


    @org.apache.olingo.ext.proxy.api.annotations.Operation(name =
"ResetPassword",
                    type = OperationType.ACTION,
                    referenceType =
com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage.class,
                   returnType = "VAS.DTOs.AuthorizationMessage")

org.apache.olingo.ext.proxy.api.StructuredInvoker<com.studio3s.vetandroid.veterinarian.Model.Odata.vas.dtos.types.AuthorizationMessage>
resetPassword(
        @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
"Username", type = "Edm.String", nullable = true) java.lang.String
username,
        @org.apache.olingo.ext.proxy.api.annotations.Parameter(name =
"Email", type = "Edm.String", nullable = true) java.lang.String email
    );

      }

  <NE extends EntityType<?>> NE newEntityInstance(Class<NE> ref);

  <T extends EntityType<?>, NEC extends EntityCollection<T, ?, ?>> NEC
newEntityCollection(Class<NEC> ref);

  <NE extends ComplexType<?>> NE newComplexInstance(Class<NE> ref);

  <T extends ComplexType<?>, NEC extends ComplexCollection<T, ?, ?>> NEC
newComplexCollection(Class<NEC> ref);

  <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC
newPrimitiveCollection(Class<T> ref);

  EdmStreamValue newEdmStreamValue(String contentType, InputStream stream);
}


>From the type I can see that it is

  * type = OperationType.ACTION,*

 Is this a bug in the odata android client or so we change something from
the server?


 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Fri, Oct 10, 2014 at 3:06 PM, Handl, Ralf <ra...@sap.com> wrote:

>  Hi Alex,
>
>
>
> I hid this in lines 179 and 759 of
> http://docs.oasis-open.org/odata/odata/v4.0/errata01/os/complete/abnf/odata-abnf-construction-rules.txt:
>
>
>
>
> actionImportCall = actionImport
>
>
>
> actionImport = odataIdentifier
>
>
>
> No parentheses for action calls.
>
>
>
> Function calls on the other hand always require functionParameters, which
> require the parentheses in line 197:
>
>
>
> functionParameters = OPEN [ functionParameter *( COMMA functionParameter )
> ] CLOSE
>
>
>
>
>
> Regards
>
> --Ralf
>
>
>
> *From:* Alex Maiereanu [mailto:alex.maiereanu@3sstudio.com]
> *Sent:* Tuesday, 7. October 2014 09:00
> *To:* user@olingo.apache.org
> *Subject:* Re: Fwd: Olingo V4 Android integration problems
>
>
>
> Hey Francesco,
>
>
>
> Thanks for the quick reply :) .
>
>
>
> I looked through the URL convention and also
> http://docs.oasis-open.org/odata/odata/v4.0/os/abnf/odata-abnf-construction-rules.txt
> , but I cannot see where it is specified  to actually put a parenthesis
> after an action / function call.
>
>
>
> The Odata service is provided by Microsofts asp.net web api  and it
> should be V4 compliant.  The interesting point is that we also have a .net
> client, that uses the classes generated by the odata client generator. When
> we call the same action on the .net client, the action is called without ()
> and everything is working.
>
>
>    Salutari din Brasov /  Greetings from Brasov
>
> [image: Image removed by sender.]
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com
>
> [image: Image removed by sender.]Facebook
> <https://www.facebook.com/smartsocialsoftware> [image: Image removed by
> sender.]Twitter <https://twitter.com/SmartSocialSoft> [image: Image
> removed by sender.]Google+
> <https://plus.google.com/101299629750815349588/posts>
>
>
>
> On Tue, Oct 7, 2014 at 9:30 AM, Francesco Chicchiriccò <
> ilgrosso@apache.org> wrote:
>
> Hi Alex,
> see my replies in-line below.
>
> Regards.
>
>
>
> On 06/10/2014 22:51, Alex Maiereanu wrote:
>
>    Hello,
>
>
>
> I'm Alex, a developer who  tries to integrate the awesome Olingo Client
> library into our project.
>
>
>
> We are using the android client library
>
>
>
> org.apache.olingo:odata-client-android:4.0.0-beta-01
>
>
>
>
>
> We have a asp web api service configured to host a odata endpoint. I have
> used the maven plugin :
>
>
>
>   <build>
>
>       <plugins>
>
>         <plugin>
>
>         <groupId>org.apache.olingo</groupId>
>
>         <artifactId>pojogen-maven-plugin</artifactId>
>
>         <version>4.0.0-beta-01</version>
>
>         <executions>
>
>           <execution>
>
>             <configuration>
>
>
> <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
>
>               <serviceRootURL>http://10.10.10.125:5560/</serviceRootURL>
>
>
> <basePackage>com.studio3s.vetandroid.veterinarian.Model.Odata</basePackage>
>
>             </configuration>
>
>             <id>v4pojoGen</id>
>
>             <phase>generate-sources</phase>
>
>             <goals>
>
>               <goal>v4pojoGen</goal>
>
>             </goals>
>
>           </execution>
>
>         </executions>
>
>       </plugin>
>
>      </plugins>
>
>   </build>
>
>
>
> to generate the needed poco objects and service container.
>
>
>
> Coming to my problem. I have an odata action. The maven plugin has
> generated the default containter and created a method for the action. When
> I call the method this request is generated
>
>
>
>
>
> POST http://localhost:5560/Login() HTTP/1.1
>
> Accept: application/json;odata.metadata=full
>
> Content-Type: application/json;odata.metadata=full
>
> OData-MaxVersion: 4.0
>
> OData-Version: 4.0
>
> Transfer-Encoding: chunked
>
> Host: localhost:5560
>
> Connection: Keep-Alive
>
> User-Agent: Apache-Olingo/4.0.0-beta-01
>
>
>
> 115
>
> {"Username@odata.type" <Us...@odata.type>:"String","Username":"proba4",
> "Password@odata.type" <Pa...@odata.type>
> :"String","Password":"c1e2fb8e4bc2430bddd2c3b7bb64ab13e837810fddb27ab6fcf4ecb9ed3a512e77976f4da722adb9a8b9d1fee45f0dbfacc10cd36ca201afa65684c3f0fc3b27",
> "Platform@odata.type" <Pl...@odata.type>:"String","Platform":"Android"}
>
> 0
>
>
>
> The request fails because of the url  http://localhost:5560/Login(), it
> should be without ()
>
>
>
> Are you that this OData service is V4 compliant? If so, it should comply
> with URL conventions [1] and require parenthesis after function / action
> name.
> With OData V3, instead, this is different - but many other things change
> as well.
>
>
>    and because of the Transfer-Encoding: chunked . Can the request be
> somehow modified
>
>
> service.getClient().getConfiguration().setUseChuncked(false);
>
> [1]
> http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html
>
>  --
>
> 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: Fwd: Olingo V4 Android integration problems

Posted by "Handl, Ralf" <ra...@sap.com>.
Hi Alex,

I hid this in lines 179 and 759 of http://docs.oasis-open.org/odata/odata/v4.0/errata01/os/complete/abnf/odata-abnf-construction-rules.txt:

actionImportCall = actionImport

actionImport = odataIdentifier

No parentheses for action calls.

Function calls on the other hand always require functionParameters, which require the parentheses in line 197:

functionParameters = OPEN [ functionParameter *( COMMA functionParameter ) ] CLOSE


Regards
--Ralf

From: Alex Maiereanu [mailto:alex.maiereanu@3sstudio.com]
Sent: Tuesday, 7. October 2014 09:00
To: user@olingo.apache.org
Subject: Re: Fwd: Olingo V4 Android integration problems

Hey Francesco,

Thanks for the quick reply :) .

I looked through the URL convention and also  http://docs.oasis-open.org/odata/odata/v4.0/os/abnf/odata-abnf-construction-rules.txt , but I cannot see where it is specified  to actually put a parenthesis after an action / function call.

The Odata service is provided by Microsofts asp.net<http://asp.net> web api  and it should be V4 compliant.  The interesting point is that we also have a .net client, that uses the classes generated by the odata client generator. When we call the same action on the .net client, the action is called without () and everything is working.

 Salutari din Brasov /  Greetings from Brasov
[Image removed by sender.]

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com<http://www.3sstudio.com/>

[Image removed by sender.]Facebook<https://www.facebook.com/smartsocialsoftware> [Image removed by sender.] Twitter<https://twitter.com/SmartSocialSoft> [Image removed by sender.] Google+<https://plus.google.com/101299629750815349588/posts>

On Tue, Oct 7, 2014 at 9:30 AM, Francesco Chicchiriccò <il...@apache.org>> wrote:
Hi Alex,
see my replies in-line below.

Regards.


On 06/10/2014 22:51, Alex Maiereanu wrote:
Hello,

I'm Alex, a developer who  tries to integrate the awesome Olingo Client library into our project.

We are using the android client library

org.apache.olingo:odata-client-android:4.0.0-beta-01


We have a asp web api service configured to host a odata endpoint. I have used the maven plugin :

  <build>
      <plugins>
        <plugin>
        <groupId>org.apache.olingo</groupId>
        <artifactId>pojogen-maven-plugin</artifactId>
        <version>4.0.0-beta-01</version>
        <executions>
          <execution>
            <configuration>
              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
              <serviceRootURL>http://10.10.10.125:5560/</serviceRootURL>
              <basePackage>com.studio3s.vetandroid.veterinarian.Model.Odata</basePackage>
            </configuration>
            <id>v4pojoGen</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>v4pojoGen</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
     </plugins>
  </build>

to generate the needed poco objects and service container.

Coming to my problem. I have an odata action. The maven plugin has generated the default containter and created a method for the action. When I call the method this request is generated


POST http://localhost:5560/Login()<http://localhost:5560/Login%28%29> HTTP/1.1
Accept: application/json;odata.metadata=full
Content-Type: application/json;odata.metadata=full
OData-MaxVersion: 4.0
OData-Version: 4.0
Transfer-Encoding: chunked
Host: localhost:5560
Connection: Keep-Alive
User-Agent: Apache-Olingo/4.0.0-beta-01

115
{"Username@odata.type"<ma...@odata.type>:"String","Platform":"Android"}
0

The request fails because of the url  http://localhost:5560/Login()<http://localhost:5560/Login%28%29>, it should be without ()

Are you that this OData service is V4 compliant? If so, it should comply with URL conventions [1] and require parenthesis after function / action name.
With OData V3, instead, this is different - but many other things change as well.


and because of the Transfer-Encoding: chunked . Can the request be somehow modified

service.getClient().getConfiguration().setUseChuncked(false);

[1] http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html


--

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: Fwd: Olingo V4 Android integration problems

Posted by Alex Maiereanu <al...@3sstudio.com>.
Hey Francesco,

Thanks for the quick reply :) .

I looked through the URL convention and also
http://docs.oasis-open.org/odata/odata/v4.0/os/abnf/odata-abnf-construction-rules.txt
, but I cannot see where it is specified  to actually put a parenthesis
after an action / function call.

The Odata service is provided by Microsofts asp.net web api  and it should
be V4 compliant.  The interesting point is that we also have a .net client,
that uses the classes generated by the odata client generator. When we call
the same action on the .net client, the action is called without () and
everything is working.

 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Tue, Oct 7, 2014 at 9:30 AM, Francesco Chicchiriccò <il...@apache.org>
wrote:

>  Hi Alex,
> see my replies in-line below.
>
> Regards.
>
>
> On 06/10/2014 22:51, Alex Maiereanu wrote:
>
>   Hello,
>
>  I'm Alex, a developer who  tries to integrate the awesome Olingo Client
> library into our project.
>
>  We are using the android client library
>
>  org.apache.olingo:odata-client-android:4.0.0-beta-01
>
>
>  We have a asp web api service configured to host a odata endpoint. I
> have used the maven plugin :
>
>    <build>
>       <plugins>
>         <plugin>
>         <groupId>org.apache.olingo</groupId>
>         <artifactId>pojogen-maven-plugin</artifactId>
>         <version>4.0.0-beta-01</version>
>         <executions>
>           <execution>
>             <configuration>
>
> <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
>               <serviceRootURL>http://10.10.10.125:5560/</serviceRootURL>
>
> <basePackage>com.studio3s.vetandroid.veterinarian.Model.Odata</basePackage>
>             </configuration>
>             <id>v4pojoGen</id>
>             <phase>generate-sources</phase>
>             <goals>
>               <goal>v4pojoGen</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>       </plugins>
>   </build>
>
>  to generate the needed poco objects and service container.
>
>  Coming to my problem. I have an odata action. The maven plugin has
> generated the default containter and created a method for the action. When
> I call the method this request is generated
>
>
>  POST http://localhost:5560/Login() HTTP/1.1
> Accept: application/json;odata.metadata=full
> Content-Type: application/json;odata.metadata=full
> OData-MaxVersion: 4.0
> OData-Version: 4.0
> Transfer-Encoding: chunked
> Host: localhost:5560
> Connection: Keep-Alive
> User-Agent: Apache-Olingo/4.0.0-beta-01
>
>  115
> {"Username@odata.type" <Us...@odata.type>:"String","Username":"proba4",
> "Password@odata.type" <Pa...@odata.type>
> :"String","Password":"c1e2fb8e4bc2430bddd2c3b7bb64ab13e837810fddb27ab6fcf4ecb9ed3a512e77976f4da722adb9a8b9d1fee45f0dbfacc10cd36ca201afa65684c3f0fc3b27",
> "Platform@odata.type" <Pl...@odata.type>:"String","Platform":"Android"}
> 0
>
>  The request fails because of the url  http://localhost:5560/Login(), it
> should be without ()
>
>
> Are you that this OData service is V4 compliant? If so, it should comply
> with URL conventions [1] and require parenthesis after function / action
> name.
> With OData V3, instead, this is different - but many other things change
> as well.
>
>   and because of the Transfer-Encoding: chunked . Can the request be
> somehow modified
>
>
> service.getClient().getConfiguration().setUseChuncked(false);
>
> [1]
> http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Involved at The Apache Software Foundation:
> member, Syncope PMC chair, Cocoon PMC, Olingo PMChttp://people.apache.org/~ilgrosso/
>
>

Re: Fwd: Olingo V4 Android integration problems

Posted by Francesco Chicchiriccò <il...@apache.org>.
Hi Alex,
see my replies in-line below.

Regards.

On 06/10/2014 22:51, Alex Maiereanu wrote:
> Hello,
>
> I'm Alex, a developer who  tries to integrate the awesome Olingo 
> Client library into our project.
>
> We are using the android client library
>
> org.apache.olingo:odata-client-android:4.0.0-beta-01
>
>
> We have a asp web api service configured to host a odata endpoint. I 
> have used the maven plugin :
>
>   <build>
>       <plugins>
>         <plugin>
> <groupId>org.apache.olingo</groupId>
> <artifactId>pojogen-maven-plugin</artifactId>
>         <version>4.0.0-beta-01</version>
>         <executions>
>           <execution>
>             <configuration>
> <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
>               <serviceRootURL>http://10.10.10.125:5560/</serviceRootURL>
> <basePackage>com.studio3s.vetandroid.veterinarian.Model.Odata</basePackage>
>             </configuration>
>             <id>v4pojoGen</id>
> <phase>generate-sources</phase>
>             <goals>
>               <goal>v4pojoGen</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>  </plugins>
>   </build>
>
> to generate the needed poco objects and service container.
>
> Coming to my problem. I have an odata action. The maven plugin has 
> generated the default containter and created a method for the action. 
> When I call the method this request is generated
>
>
> POST http://localhost:5560/Login() <http://localhost:5560/Login%28%29> 
> HTTP/1.1
> Accept: application/json;odata.metadata=full
> Content-Type: application/json;odata.metadata=full
> OData-MaxVersion: 4.0
> OData-Version: 4.0
> Transfer-Encoding: chunked
> Host: localhost:5560
> Connection: Keep-Alive
> User-Agent: Apache-Olingo/4.0.0-beta-01
>
> 115
> {"Username@odata.type":"String","Username":"proba4","Password@odata.type":"String","Password":"c1e2fb8e4bc2430bddd2c3b7bb64ab13e837810fddb27ab6fcf4ecb9ed3a512e77976f4da722adb9a8b9d1fee45f0dbfacc10cd36ca201afa65684c3f0fc3b27","Platform@odata.type":"String","Platform":"Android"}
> 0
>
> The request fails because of the url http://localhost:5560/Login() 
> <http://localhost:5560/Login%28%29>, it should be without ()

Are you that this OData service is V4 compliant? If so, it should comply 
with URL conventions [1] and require parenthesis after function / action 
name.
With OData V3, instead, this is different - but many other things change 
as well.

> and because of the Transfer-Encoding: chunked . Can the request be 
> somehow modified

service.getClient().getConfiguration().setUseChuncked(false);

[1] 
http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html

-- 
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/