I am trying to create an android app that will connect to various web services via soap objects. So far I’m just playing around with basic web services trying to get a basic understanding. I have found a web service that simply returns a ‘quote of the day’ I am using android sdk version 15 with eclipse and I am trying to get an android app to return a quote from the web service.
However I am getting the following error: The type java.rmi.RemoteException cannot be resolved
I think that this is because invoking the web service can throw a rmi.RemoteException and java.rmi is not included in the android standard libraries, but i am not too sure how to add this to the build path (if that is what I need to do)
Any help with this problem would be greatly appreciated.
Here is my method to invoke the web service:
public static String getQuote () throws ServiceException, RemoteException
{
QuoteofTheDayLocator locator = new QuoteofTheDayLocator();
QuoteofTheDaySoap soap = locator.getQuoteofTheDaySoap();
Quotes quote = soap.getQuote();
String quoteText = quote.getQuoteOfTheDay();
String quoteAuthor = quote.getAuthor();
return quoteText + " By:" + quoteAuthor;
}
The error is caused when calling ‘soap.getQuote’
Thanks in advance,
Robbie
Find code that does not use RMI classes, or modify the code you are trying to use to not use RMI classes. As you note, RMI is not included in Android.