> -----Original Message-----
> From: mgibble [mailto:[EMAIL PROTECTED]
> Sent: 2007年11月28日 4:29
> To: [email protected]
> Subject: Empty string namespace mapping with JSON and HTTP Post
> 
> 
> I am using the restful_http_binding sample and I have changed the following
> lines:
> 
>         // Set up the JSON StAX implementation
>         Map<String, String> nstojns = new HashMap<String, String>();
>         nstojns.put("http://customer.acme.com";, "acme");
> 
> to:
> 
>         // Set up the JSON StAX implementation
>         Map<String, String> nstojns = new HashMap<String, String>();
>         nstojns.put("http://customer.acme.com";, "");
> 
> I do an HTTP Post according to the README using wget with the following
> add.json file:
> 
> {
>   "Customer" : {
>     "name" : "Jim Bob"
>   }
> }
> 
> I would have thought that this would have worked, but the Customer
> parameter
> of the addCustomer method is not populated with any data.  However, if I
> change the add.json file to:
> 
> {
>   ".Customer" : {
>     ".name" : "Jim Bob"
>   }
> }
> 
> the Customer parameter is populated appropriately.  I would have thought
> that with the mapping of "customer.acme.com" to "" that my original JSON
> would have worked and not required a period ('.') before each field name.
> Am I misunderstanding or is this a bug?  If so, is there a way that I can
> achieve the functionality that I desire?

This is expected behavior. CXF HTTP binding is using Jettison to do the 
JSON/XML mappings. [1] explaines how the default mapping works. You can also 
try the BadgerFish convention. 

[1]. http://jettison.codehaus.org/User%27s+Guide

> 
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Empty-string-namespace-mapping-with-JSON-and-
> HTTP-Post-tf4884221.html#a13979132
> 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

Reply via email to