You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "YI (William) ZHU" <zh...@yahoo.com> on 2007/12/14 21:15:33 UTC

sample failure: restfull_http_binding

Hi,

I found that there two issues in the CXF 2.0.2 sample
"restfull_http_binding":

1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not working,
I found that the javascript has problem.

2) if I change the "CustomerServiceImpl.java" file to let the web service to
return two customers, not the  original 1 customer. Then following links
work fine:
   http://localhost:8080/xml/customers
   http://localhost:8080/xml/customers/123
   http://localhost:8080/json/customers/123 

but this link "http://localhost:8080/json/customers" return:

{"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"William
Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}

I thought that's not correct, they should return two "acme.customer" items.

Can someone check the implementation of JSON on CXF is OK?


Thanks,
YI ZHU

-- 
View this message in context: http://www.nabble.com/sample-failure%3A-restfull_http_binding-tp14339771p14339771.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: sample failure: restfull_http_binding

Posted by "YI (William) ZHU" <zh...@yahoo.com>.
Hi,

I have done some testing to the page "test.html".

Two fixes: 
1) works with IE 6 and FireFox 2 now;
2) customers table is refreshed, not appended.

Please validate.

Cheers,
YI ZHU


http://www.nabble.com/file/p14437670/test.html test.html 


dkulp wrote:
> 
> 
> 
> I think these are logged as:
> 
> https://issues.apache.org/jira/browse/CXF-873
> https://issues.apache.org/jira/browse/CXF-889
> 
> Patches are most welcome.  
> 
> Dan
> 
> 
> On Friday 14 December 2007, YI (William) ZHU wrote:
>> Hi,
>>
>> I found that there two issues in the CXF 2.0.2 sample
>> "restfull_http_binding":
>>
>> 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not
>> working, I found that the javascript has problem.
>>
>> 2) if I change the "CustomerServiceImpl.java" file to let the web
>> service to return two customers, not the  original 1 customer. Then
>> following links work fine:
>>    http://localhost:8080/xml/customers
>>    http://localhost:8080/xml/customers/123
>>    http://localhost:8080/json/customers/123
>>
>> but this link "http://localhost:8080/json/customers" return:
>>
>> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"Will
>>iam Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
>>
>> I thought that's not correct, they should return two "acme.customer"
>> items.
>>
>> Can someone check the implementation of JSON on CXF is OK?
>>
>>
>> Thanks,
>> YI ZHU
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/sample-failure%3A-restfull_http_binding-tp14339771p14437670.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: sample failure: restfull_http_binding

Posted by Jeff Yu <je...@iona.com>.
I'd like to provide a patch for this issue..

Thanks
Jeff

Liu, Jervis wrote:
> Another Javascript problem. I hate Javascript. 
>
> https://issues.apache.org/jira/browse/CXF-1308
>
> Thanks,
> Jervis
>
>   
>> -----Original Message-----
>> From: YI (William) ZHU [mailto:zhu_yi_2001@yahoo.com]
>> Sent: 2007年12月18日 3:03
>> To: cxf-user@incubator.apache.org
>> Subject: RE: sample failure: restfull_http_binding
>>
>>
>> Hi Jervis,
>>
>> Thanks for your reply.
>>
>> I have tested the sample with FireFox 2, it works but not in a correct way:
>>
>> Everytime when I click the "Get Customers!" button, the same customers
>> were
>> appended to the page.
>> I think they should be refreshed but not appended.
>>
>> Regards,
>> YI ZHU
>>
>>
>>
>>
>> Liu, Jervis wrote:
>>     
>>> For your information, CXF-889 has been fixed in CXF2.0.3, though the "Get
>>> Customers!" button is still not working with IE (works with Firefox). I
>>> created https://issues.apache.org/jira/browse/CXF-1306 to track this.
>>>
>>> Cheers,
>>> Jervis
>>>
>>>
>>>       
>>>> -----Original Message-----
>>>> From: Daniel Kulp [mailto:dkulp@apache.org]
>>>> Sent: 2007年12月15日 4:20
>>>> To: cxf-user@incubator.apache.org
>>>> Cc: YI (William) ZHU
>>>> Subject: Re: sample failure: restfull_http_binding
>>>>
>>>>
>>>>
>>>> I think these are logged as:
>>>>
>>>> https://issues.apache.org/jira/browse/CXF-873
>>>> https://issues.apache.org/jira/browse/CXF-889
>>>>
>>>> Patches are most welcome.
>>>>
>>>> Dan
>>>>
>>>>
>>>> On Friday 14 December 2007, YI (William) ZHU wrote:
>>>>         
>>>>> Hi,
>>>>>
>>>>> I found that there two issues in the CXF 2.0.2 sample
>>>>> "restfull_http_binding":
>>>>>
>>>>> 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not
>>>>> working, I found that the javascript has problem.
>>>>>
>>>>> 2) if I change the "CustomerServiceImpl.java" file to let the web
>>>>> service to return two customers, not the  original 1 customer. Then
>>>>> following links work fine:
>>>>>    http://localhost:8080/xml/customers
>>>>>    http://localhost:8080/xml/customers/123
>>>>>    http://localhost:8080/json/customers/123
>>>>>
>>>>> but this link "http://localhost:8080/json/customers" return:
>>>>>
>>>>>
>>>>>           
>> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"Wil
>>     
>>>> l
>>>>         
>>>>> iam Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
>>>>>
>>>>> I thought that's not correct, they should return two "acme.customer"
>>>>> items.
>>>>>
>>>>> Can someone check the implementation of JSON on CXF is OK?
>>>>>
>>>>>
>>>>> Thanks,
>>>>> YI ZHU
>>>>>           
>>>>
>>>> --
>>>> J. Daniel Kulp
>>>> Principal Engineer, IONA
>>>> dkulp@apache.org
>>>> http://www.dankulp.com/blog
>>>>         
>>> ----------------------------
>>> IONA Technologies PLC (registered in Ireland)
>>> Registered Number: 171387
>>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>>>
>>>
>>>       
>> --
>> View this message in context:
>> http://www.nabble.com/sample-failure%3A-restfull_http_binding-tp143397
>> 71p14373995.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>     
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>   

RE: sample failure: restfull_http_binding

Posted by "Liu, Jervis" <jl...@iona.com>.
Another Javascript problem. I hate Javascript. 

https://issues.apache.org/jira/browse/CXF-1308

Thanks,
Jervis

> -----Original Message-----
> From: YI (William) ZHU [mailto:zhu_yi_2001@yahoo.com]
> Sent: 2007年12月18日 3:03
> To: cxf-user@incubator.apache.org
> Subject: RE: sample failure: restfull_http_binding
> 
> 
> Hi Jervis,
> 
> Thanks for your reply.
> 
> I have tested the sample with FireFox 2, it works but not in a correct way:
> 
> Everytime when I click the "Get Customers!" button, the same customers
> were
> appended to the page.
> I think they should be refreshed but not appended.
> 
> Regards,
> YI ZHU
> 
> 
> 
> 
> Liu, Jervis wrote:
> >
> > For your information, CXF-889 has been fixed in CXF2.0.3, though the "Get
> > Customers!" button is still not working with IE (works with Firefox). I
> > created https://issues.apache.org/jira/browse/CXF-1306 to track this.
> >
> > Cheers,
> > Jervis
> >
> >
> >> -----Original Message-----
> >> From: Daniel Kulp [mailto:dkulp@apache.org]
> >> Sent: 2007年12月15日 4:20
> >> To: cxf-user@incubator.apache.org
> >> Cc: YI (William) ZHU
> >> Subject: Re: sample failure: restfull_http_binding
> >>
> >>
> >>
> >> I think these are logged as:
> >>
> >> https://issues.apache.org/jira/browse/CXF-873
> >> https://issues.apache.org/jira/browse/CXF-889
> >>
> >> Patches are most welcome.
> >>
> >> Dan
> >>
> >>
> >> On Friday 14 December 2007, YI (William) ZHU wrote:
> >> > Hi,
> >> >
> >> > I found that there two issues in the CXF 2.0.2 sample
> >> > "restfull_http_binding":
> >> >
> >> > 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not
> >> > working, I found that the javascript has problem.
> >> >
> >> > 2) if I change the "CustomerServiceImpl.java" file to let the web
> >> > service to return two customers, not the  original 1 customer. Then
> >> > following links work fine:
> >> >    http://localhost:8080/xml/customers
> >> >    http://localhost:8080/xml/customers/123
> >> >    http://localhost:8080/json/customers/123
> >> >
> >> > but this link "http://localhost:8080/json/customers" return:
> >> >
> >> >
> >>
> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"Wil
> >> l
> >> >iam Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
> >> >
> >> > I thought that's not correct, they should return two "acme.customer"
> >> > items.
> >> >
> >> > Can someone check the implementation of JSON on CXF is OK?
> >> >
> >> >
> >> > Thanks,
> >> > YI ZHU
> >>
> >>
> >>
> >> --
> >> J. Daniel Kulp
> >> Principal Engineer, IONA
> >> dkulp@apache.org
> >> http://www.dankulp.com/blog
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
> >
> >
> 
> --
> View this message in context:
> http://www.nabble.com/sample-failure%3A-restfull_http_binding-tp143397
> 71p14373995.html
> Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: sample failure: restfull_http_binding

Posted by "YI (William) ZHU" <zh...@yahoo.com>.
Hi Jervis,

Thanks for your reply.

I have tested the sample with FireFox 2, it works but not in a correct way:

Everytime when I click the "Get Customers!" button, the same customers were
appended to the page.
I think they should be refreshed but not appended.

Regards,
YI ZHU




Liu, Jervis wrote:
> 
> For your information, CXF-889 has been fixed in CXF2.0.3, though the "Get
> Customers!" button is still not working with IE (works with Firefox). I
> created https://issues.apache.org/jira/browse/CXF-1306 to track this.
> 
> Cheers,
> Jervis
> 
> 
>> -----Original Message-----
>> From: Daniel Kulp [mailto:dkulp@apache.org]
>> Sent: 2007年12月15日 4:20
>> To: cxf-user@incubator.apache.org
>> Cc: YI (William) ZHU
>> Subject: Re: sample failure: restfull_http_binding
>> 
>> 
>> 
>> I think these are logged as:
>> 
>> https://issues.apache.org/jira/browse/CXF-873
>> https://issues.apache.org/jira/browse/CXF-889
>> 
>> Patches are most welcome.
>> 
>> Dan
>> 
>> 
>> On Friday 14 December 2007, YI (William) ZHU wrote:
>> > Hi,
>> >
>> > I found that there two issues in the CXF 2.0.2 sample
>> > "restfull_http_binding":
>> >
>> > 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not
>> > working, I found that the javascript has problem.
>> >
>> > 2) if I change the "CustomerServiceImpl.java" file to let the web
>> > service to return two customers, not the  original 1 customer. Then
>> > following links work fine:
>> >    http://localhost:8080/xml/customers
>> >    http://localhost:8080/xml/customers/123
>> >    http://localhost:8080/json/customers/123
>> >
>> > but this link "http://localhost:8080/json/customers" return:
>> >
>> >
>> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"Wil
>> l
>> >iam Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
>> >
>> > I thought that's not correct, they should return two "acme.customer"
>> > items.
>> >
>> > Can someone check the implementation of JSON on CXF is OK?
>> >
>> >
>> > Thanks,
>> > YI ZHU
>> 
>> 
>> 
>> --
>> J. Daniel Kulp
>> Principal Engineer, IONA
>> dkulp@apache.org
>> http://www.dankulp.com/blog
> 
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
> 
> 

-- 
View this message in context: http://www.nabble.com/sample-failure%3A-restfull_http_binding-tp14339771p14373995.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: sample failure: restfull_http_binding

Posted by "Liu, Jervis" <jl...@iona.com>.
For your information, CXF-889 has been fixed in CXF2.0.3, though the "Get Customers!" button is still not working with IE (works with Firefox). I created https://issues.apache.org/jira/browse/CXF-1306 to track this.

Cheers,
Jervis


> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 2007年12月15日 4:20
> To: cxf-user@incubator.apache.org
> Cc: YI (William) ZHU
> Subject: Re: sample failure: restfull_http_binding
> 
> 
> 
> I think these are logged as:
> 
> https://issues.apache.org/jira/browse/CXF-873
> https://issues.apache.org/jira/browse/CXF-889
> 
> Patches are most welcome.
> 
> Dan
> 
> 
> On Friday 14 December 2007, YI (William) ZHU wrote:
> > Hi,
> >
> > I found that there two issues in the CXF 2.0.2 sample
> > "restfull_http_binding":
> >
> > 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not
> > working, I found that the javascript has problem.
> >
> > 2) if I change the "CustomerServiceImpl.java" file to let the web
> > service to return two customers, not the  original 1 customer. Then
> > following links work fine:
> >    http://localhost:8080/xml/customers
> >    http://localhost:8080/xml/customers/123
> >    http://localhost:8080/json/customers/123
> >
> > but this link "http://localhost:8080/json/customers" return:
> >
> >
> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"Wil
> l
> >iam Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
> >
> > I thought that's not correct, they should return two "acme.customer"
> > items.
> >
> > Can someone check the implementation of JSON on CXF is OK?
> >
> >
> > Thanks,
> > YI ZHU
> 
> 
> 
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: sample failure: restfull_http_binding

Posted by Daniel Kulp <dk...@apache.org>.

I think these are logged as:

https://issues.apache.org/jira/browse/CXF-873
https://issues.apache.org/jira/browse/CXF-889

Patches are most welcome.  

Dan


On Friday 14 December 2007, YI (William) ZHU wrote:
> Hi,
>
> I found that there two issues in the CXF 2.0.2 sample
> "restfull_http_binding":
>
> 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not
> working, I found that the javascript has problem.
>
> 2) if I change the "CustomerServiceImpl.java" file to let the web
> service to return two customers, not the  original 1 customer. Then
> following links work fine:
>    http://localhost:8080/xml/customers
>    http://localhost:8080/xml/customers/123
>    http://localhost:8080/json/customers/123
>
> but this link "http://localhost:8080/json/customers" return:
>
> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"Will
>iam Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
>
> I thought that's not correct, they should return two "acme.customer"
> items.
>
> Can someone check the implementation of JSON on CXF is OK?
>
>
> Thanks,
> YI ZHU



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: sample failure: restfull_http_binding

Posted by Dan Diephouse <da...@mulesource.com>.
JSON isn't like XML. Its basically a serialized hashmap. It doesn't 
allow multiple entries with the same "key". Which means there can only 
ever be one acme.customer.  Because of this, when there are multiple 
acme.customers, we need to turn it into an array like in the sample you 
attached.
Regards,
- Dan

YI (William) ZHU wrote:
> Hi,
>
> I found that there two issues in the CXF 2.0.2 sample
> "restfull_http_binding":
>
> 1) the "test.html" page to test the "Jettison/CXF AJAX Demo" is not working,
> I found that the javascript has problem.
>
> 2) if I change the "CustomerServiceImpl.java" file to let the web service to
> return two customers, not the  original 1 customer. Then following links
> work fine:
>    http://localhost:8080/xml/customers
>    http://localhost:8080/xml/customers/123
>    http://localhost:8080/json/customers/123 
>
> but this link "http://localhost:8080/json/customers" return:
>
> {"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"William
> Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}}
>
> I thought that's not correct, they should return two "acme.customer" items.
>
> Can someone check the implementation of JSON on CXF is OK?
>
>
> Thanks,
> YI ZHU
>
>   


-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog


Re: sample failure: restfull_http_binding

Posted by "YI (William) ZHU" <zh...@yahoo.com>.
...continue...

should the return from JSON server be like:

{"acme.Customers":{"acme.customer":[{"acme.id":"789","acme.name":"William
Zhu"},{"acme.id":"123","acme.name":"Dan Diephouse"}]}} 

or like this?

{"acme.Customers":{"acme.customer":{"acme.id":"789","acme.name":"William
Zhu"}},{"acme.customer":{"acme.id":"123","acme.name":"Dan Diephouse"}}} 

I think that second one is correct. The first one is from server (JSON).



-- 
View this message in context: http://www.nabble.com/sample-failure%3A-restfull_http_binding-tp14339771p14339790.html
Sent from the cxf-user mailing list archive at Nabble.com.