I have started to implement the invokers at binding-gdata module. Maybe, the
simplest operation is retrieve a feed from an specific URI. So, I have
chosen the getFeed() method as the first one to be implemented.

Trying to think as simple as possible, and using the gdata java client, the
method follow these steps:

1) Set the user credentials;
2) Get the feed at an URI as a com.google.gdata.data.Feed object;
3) Pass the feed object to the body of the message object
(org.apache.tuscany.sca.invocation.Message);

The following piece of code demonstrate it:
*
     //FIXME - Get credentials automatically
     myService.setUserCredentials("[EMAIL PROTECTED]", "gsoc2008");

     Feed feed = (Feed) myService.getFeed(new URL(uri), Feed.class);

     msg.setBody(feed);*

However, I am having some issues with marshalling/unmarshalling the Feed
object while passing it to the message body. I got these output:

Exception in thread "main" java.lang.IllegalArgumentException:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of
IllegalAnnotationExceptions
com.google.gdata.data.BaseFeed does not have a no-arg default constructor.
    this problem is related to the following location:
        at com.google.gdata.data.BaseFeed
        at com.google.gdata.data.Feed
com.google.gdata.client.Service$GDataRequestFactory is an interface, and
JAXB can't handle interfaces.
    this problem is related to the following location:
        at com.google.gdata.client.Service$GDataRequestFactory
        at public com.google.gdata.client.Service$GDataRequestFactory
com.google.gdata.client.Service.getRequestFactory()
        at com.google.gdata.client.Service
        at public com.google.gdata.client.Service
com.google.gdata.data.BaseEntry.getService()
        at com.google.gdata.data.BaseEntry
        at public java.util.List com.google.gdata.data.BaseFeed.getEntries()
        at com.google.gdata.data.BaseFeed
        at com.google.gdata.data.Feed
com.google.gdata.client.Service$GDataRequestFactory does not have a no-arg
default constructor.
    this problem is related to the following location:
        at com.google.gdata.client.Service$GDataRequestFactory
        at public com.google.gdata.client.Service$GDataRequestFactory
com.google.gdata.client.Service.getRequestFactory()
        at com.google.gdata.client.Service
        at public com.google.gdata.client.Service
com.google.gdata.data.BaseEntry.getService()
        at com.google.gdata.data.BaseEntry
        at public java.util.List com.google.gdata.data.BaseFeed.getEntries()
        at com.google.gdata.data.BaseFeed
        at com.google.gdata.data.Feed
        . . .

BaseFeed is a super type of Feed, and although it does not have a no-arg
default constructor, the Feed has one.

Thoughts?

-- 
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas (Unicamp)

Reply via email to