0

How can I catch Connection exception when I am calling WEbService methods from separate process(Remote Service) and how can I transfer information about this exception to UI to show appropriate Dialog message.

I am trying and I am getting:

01-01 01:57:20.028: E/JavaBinder(1215): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
user1074896
  • 1,025
  • 2
  • 15
  • 27

3 Answers3

0

http://developer.android.com/reference/android/os/Message.html .. While having an exception in your Service you can put its string in the Message object and send it back to the calling application in different process.

Relsell
  • 771
  • 6
  • 18
0

I assume that you are using SOAP protocol for making a WebService call, (AXIS?). In the response you get this exception is wrapped into an AxisFault which is then transmitted to the client. SoapFault message contains the description of the exception (message).

You should recognize AxisFault as the exception (exception class) and you can get from it a faultstring to log or show an appropriate message to the client.

aviad
  • 8,229
  • 9
  • 50
  • 98
0

In your remote service you should catch all the exceptions. Then you can create a field and assign to this field unique values for each exception (in catch section) and transfer the value of this field to your client process (for instance, as it was proposed by @relsell). In your client process you can check this field and if there is an exception you can just throw it.

But in this case you'll have wrong stack trace.

Yury
  • 20,618
  • 7
  • 58
  • 86