Jersey Client API Problem

后端 未结 3 1619
南旧
南旧 2021-01-13 23:19

I am writing an Android client which calls a web service. The service is written using JAX-RS / Jersey API. I\'m also trying to use Jersey-Client API on the android side.

相关标签:
3条回答
  • 2021-01-13 23:39

    Judging by the stack trace, it's probably something happing at either

    • ERAService line 80 in the updateRestaurantFranchise method
    • RestaurantActivity line 201 in the onItemSelected method
    0 讨论(0)
  • 2021-01-13 23:47

    Android has Dalvik Virtual Machine, not original JVM. I think this the reason why Jersey Client API does not work in Android OS. but I'am nog sure!

    0 讨论(0)
  • 2021-01-13 23:56

    I am also a Jersey newbie, but I think that the reason your post code does not work is that formData must be in one of the types accepted. I'm not totally sure on the difference between the type and the accept commands in this contexts, but I am pretty sure that formData must be of one of the types that your invocation builder supports. E.g. if you serialised formData as a JSON object and set type/accept to JSON then this code would work. As it is it is probably calling some bodymethodwriter to serialise it into an acceptable type but formData doesnt have one so the method call returns null. In fact, it looks like its calling ValueOf to try to obtain the data out of formData for serialisation, but that returns null.

    0 讨论(0)
提交回复
热议问题