This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Twitter module is missing xml schema for its response | ||
---|---|---|---|
Product: | webservices | Reporter: | Peter Liu <petertliu> |
Component: | Manager | Assignee: | Peter Liu <petertliu> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | sustaining |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Peter Liu
2008-04-16 02:18:40 UTC
Fix checked into trunk: http://hg.netbeans.org/main/rev/54c42ac01c19 http://hg.netbeans.org/main/rev/3fc9f3a0f3b4 additional changes: http://hg.netbeans.org/main/rev/3150765922f8 this code: public static void main(String[] args) { try { String page = null; String format = "xml"; RestResponse result = TwitterWhatAreYouDoingService.getFavorites(page, format); twitter.whatareyoudoingservice.twitterresponse.Statuses resultObj = result.getDataAsJaxbObject(twitter.whatareyoudoingservice.twitterresponse.Statuses.class); //TODO - Uncomment the print Statement below to print result. System.out.println("The SaasService returned: "+result.getDataAsString()); } catch (Exception ex) { ex.printStackTrace(); } } ends with following exception in runtime: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"nil-classes"). Expected elements are <{}authorized>,<{}direct-messages>,<{}direct_message>,<{}status>,<{}statuses>,<{}user> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:556) ... it looks like the schema is incorrect... The schema is correct except that twitter returns <nil-classes> when there is no data. This is really bad design on twitter's part. They could easily return an empty <statuses/>. I am not sure if there is anything we can do about this. I'll try to work on a solution. However, this shouldn't stop us from porting this to the patch release. After talking to Ayub, the only way to solve this issue is to change the way we generate the code. However, we don't think this is worth it. Instead, we decided to log a bug against Twitter to have them fix this problem. Lukas, I would still like have the schema ported to the patch1 release. We can close this one and file another one specific to the nil-classes issue. What do you think? I am discussing this issue with developers on the twitter forum and so far it does seem like this is a bug, so I am closing this issue as fixed and I'll file another issue to track the twitter bug. ok then I've transplanted the changesets into release61_fixes repository http://hg.netbeans.org/release61_fixes/rev/a1797d730df1 http://hg.netbeans.org/release61_fixes/rev/957698d805f8 http://hg.netbeans.org/release61_fixes/rev/11905f011707 changeset: 77497:a1797d730df1 user: PeterTLiu@netbeans.org date: Tue Apr 22 17:01:44 2008 -0700 summary: Fix for IZ 132953 - add response schema for twitter. changeset: 77498:957698d805f8 user: PeterTLiu@netbeans.org date: Tue Apr 22 17:08:10 2008 -0700 summary: minor fixes for the twitter wadl. changeset: 77499:11905f011707 tag: tip user: PeterTLiu@netbeans.org date: Tue Apr 22 17:37:39 2008 -0700 summary: Change type for created_at from dateTime to string. |