Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364673

Summary: REST service call with JSON responding type got error
Product: z_Archived Reporter: Xin Wu <cdlwuxin>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P1 CC: chenzhh, jvincens, margolis, svihovec, wxwu, zhuzhi
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
GeoName Third Party
none
add code to call with json none

Description Xin Wu CLA 2011-11-24 01:54:50 EST
Build Identifier: v201111232325

REST service call with JSON responding type got error. By the GeoName service call application

Reproducible: Always

Steps to Reproduce:
1. Download the attached project and import to your workspace
2. Create a Web Client Project to import required RUI/Dojo runtime projects
3. Open EGLSource/Client/GeoNameHandler.egl by VE
4. Switch to preview, call service by XML. It works well
5. Call by JSON can not get response
Comment 1 Xin Wu CLA 2011-11-24 01:55:24 EST
Created attachment 207459 [details]
GeoName Third Party
Comment 2 Tony Chen CLA 2011-11-24 02:45:45 EST
set to p1, major
Comment 3 Tony Chen CLA 2011-11-24 05:31:53 EST
The attached application is incorrectly written. It was using the same GeoNames record for both XML & JSON format. That record is defined for XML results only, and it leads to error when parse a JSON response to that XML record. 

I modified the application, it worked correctly with JSON now. I'll close this bug as invalid.
Comment 4 Tony Chen CLA 2011-11-24 05:34:52 EST
Created attachment 207469 [details]
add code to call with json
Comment 5 Joseph Vincens CLA 2011-11-24 10:30:00 EST
This has already been updated in CVS - kan-cvs-save.ottawa.ibm.com//cvsroot/rbd/org.eclipse.edt.tests.services/thirdparty.rest/GeoNames
You don't need to sets of records you just need to add the JSONName annotation to the 1 field.
Comment 6 Tony Chen CLA 2011-11-24 10:48:05 EST
Joe, is this new in EDT? And is it documented somewhere? 

(In reply to comment #5)
> This has already been updated in CVS -
> kan-cvs-save.ottawa.ibm.com//cvsroot/rbd/org.eclipse.edt.tests.services/thirdparty.rest/GeoNames
> You don't need to sets of records you just need to add the JSONName annotation
> to the 1 field.
Comment 7 Joseph Vincens CLA 2011-11-25 09:44:05 EST
(In reply to comment #6)
> Joe, is this new in EDT? And is it documented somewhere? 
> 
> (In reply to comment #5)
> > This has already been updated in CVS -
> > kan-cvs-save.ottawa.ibm.com//cvsroot/rbd/org.eclipse.edt.tests.services/thirdparty.rest/GeoNames
> > You don't need to sets of records you just need to add the JSONName annotation
> > to the 1 field.

RBD also has JSONName. I added Saul on the CC to answer the doc question.
Comment 8 Ben Margolis CLA 2011-11-25 13:34:30 EST
> RBD also has JSONName. I added Saul on the CC to answer the doc question.

In the EDT help is the EGL Language Reference, and the last section  (Supplemental Details) has the following topics:

o  "Correspondence between a JSON string and an EGL variable," which references the JSONName annotation.

o  Also see "Correspondence between an XML string and an EGL variable"

The Language Reference section on packages includes entries for the eglx.json and eglx.xml packages.

You can always search for a topic that matches a string of interest, such as "JSON."