Questions tagged [jettison]

Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON.

Allows the creation of JSON based web services in frameworks like or XML serialization frameworks like .

There are currently two conventions for mapping JSON to XML.

  • BadgerFish which implements the full XML infoset in JSON using various techniques.
  • Mapped convention which allows you to manually map [tag:XML namespaces] to JSON element prefixes.

Jettison was initially developed for usage in XFire and CXF to enable JSON based services, later it also found its place in Java object serialization with XStream

Jettison Home Page

Jettison User Guide

99 questions
0
votes
1 answer

Axis2 JSon Support (Jettison) bad xml conversion

I am using Axis2 1.6.4 to implement REST Json WebServices (https://axis.apache.org/axis2/java/core/docs/json_support.html) and I face an issue when Jettison converts Json object To XML if it does not have a "root" element. Details: If request…
Marti Pàmies Solà
  • 611
  • 1
  • 6
  • 12
0
votes
1 answer

Parsing Nested JSON in java without know structure of JSON

I have a use case where i get a random jsonstring and variable name. I need to verify if that particular variable is present in that json, and if present fetch its value. For example, let us the json is as follows { "a" : { "b":1, …
vamsi
  • 325
  • 5
  • 15
0
votes
1 answer

Unmarshalling JSON array via Jettison/Resteasy

Ran into a similar problem like the following forum post: http://jersey.576304.n2.nabble.com/parsing-JSON-with-Arrays-using-Jettison-td5732207.html Using Resteasy 2.0.1GA with Jettison 1.2 and getting a problem marshalling arrays when involving…
Matthew Campbell
  • 1,864
  • 3
  • 24
  • 51
0
votes
1 answer

apache wink jettison

Using Jettison provider. public Set getClasses() { Set s = new HashSet(); s.add(DatabaseResource.class); return s; } public Set getSingletons() { Set s = new HashSet(); JettisonJAXBProvider jaxbProvider = new…
user451872
  • 9
  • 2
  • 5
0
votes
1 answer

How to handle both JSON array and JSON object response

I have a JSON array which I receive from a HTTP request : [ '{{repeat(5, 7)}}', { _id: '{{objectId()}}' } ] At times I receive only a simply JSON object and not an array. How do I generalize and store the response, since sometimes I get…
user1692342
  • 5,007
  • 11
  • 69
  • 128
0
votes
1 answer

Changing JSON Provider (Spring / Spring-Boot)

Is it possible to use Jettison with Spring / Spring-Boot instead of default JSON Provider Jackson? I have one such requirement to match Json output with an very old project which used Jettison. If yes, can i get some pointers/hints please?
Rajkishan Swami
  • 3,569
  • 10
  • 48
  • 68
0
votes
1 answer

compare 2 JSONObjects without regard to value types

I'm using Jettison to make JSONObjects out of some Strings I want to get a list of all the keys in one JSONObject (j1) and compare the values to the values attached to the keys in the other JSONObject (j2). I'm trying to create something where I…
user1126515
  • 1,133
  • 3
  • 17
  • 34
0
votes
1 answer

Ignore line break while parsing JSON

I am using Jettison in Java for parsing JSON messages, But in some cases JSON contains line break in values hence getting exception. { "errors": { "error": [ { "error-message": "values are not unique:…
Abhij
  • 1,222
  • 4
  • 19
  • 37
0
votes
1 answer

Unable to get through CXF with JSON

I am trying to build a CXF RESTFul service with JSON as input and output. I am using JAXRSServerFactoryBean to boot my service. When I try to hit the URL from a client program, I am getting the following exception. My program is very simple and…
Saji V
  • 1
0
votes
1 answer

Jersey Use Jackson or Jettison for JSONConfiguration.natural().build()

I am trying to portable rest application for Weblogic and Jboss. Currently we are using jersey for rest app. with portable implementation jboss will use resteasy. Context: in our app we are @Provider class using ContextResolver return…
0
votes
1 answer

Parsing JSON to XML using net.sf.json (java)

I'm parsing a generic JSON to a XML using net.sf.json. (I'm not using POJO Obj in the conversion) Json that I'm converting: { "root": { "accountId": "1000", "Items": [ { "cost": 0.1, …
rafa.ferreira
  • 1,997
  • 7
  • 26
  • 41
0
votes
0 answers

Migrated to Jersey 2, now needing to interperate a valueType in Client

After migrating to Jersey 2.0, my REST service seems to serve up this boolean flag in a slightly different manner. (I can provide the Service code as well if it helps, but this seems pretty standard and just needs interperated different on the…
aohm1989
  • 401
  • 1
  • 8
  • 19
0
votes
1 answer

How to receive JSON Messages in POST body in a JAX-RS Restful web service in CXF?

I'm trying to develop a REST service using Apache-CXF, on top of JAX-RS. For starters, I have a method called test that receives a String message and int value. I want the clients to be able to pass these parameters in a POST message body. I can't…
Hakim Luqman
  • 91
  • 2
  • 8
0
votes
1 answer

What will be the structure of JSON string inside POST array

Here is my Java program that trying to send JSON object to the server. I'm using Apache HTTPClient for HTTP requests and Jettison as JSON library. I have few question about this. What will be the structure of JSON string inside POST array.…
Nayana Adassuriya
  • 23,596
  • 30
  • 104
  • 147
0
votes
0 answers

Wildfly using the Jackson provider instead of Jettison

I've been using JBoss since version 4.3, I'm currently putting together a dimple demo webapp using Wildfly Beta1, CDI, JPA and RESTeasy, but I can't get to configure the JSON provider like I use to do in my other JBossAS projects... I added a custom…
gcauchon
  • 31
  • 1
  • 7