Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5270

[GSOC 2012] Improve Json support in Axis2 with google-gson

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.7.0
    • json

    Description

      There are two ways that xml string can be converted into JSON string, Badgerfish and Mapped . Current Axis2 with JSON module completely supports Badgerfish convention[1] while partialy supports Mapped convention[1] as Mapped formatted JSON with namespaces are not supported in Axis2. Therefore if the client side java-script code needs to talk with java service which is deployed in Axis2, it should be sent as Badgerfish convention. It is cumbersome to generate Badgerfish convention of JSON string again and again to call services if there is no xml representation string in client side.

      If java script client can send JSON object to relevant java service in Axis2, defining service and operation in request url, without doing any modifications to JSON objects, then it would be very helpful for Java-Script users at client side.

      According to the thread in the mailing list, which discussed $subject we have two approaches. i have summarized those two approaches as below.

      1. Store json inputstream in message context at the message builder while putting dummy SOAPEnvelop to the message context, and using google-gson process it inside the message receiver

      2. Preserve the requirement that a message must have a well defined SOAP infoset and use a trivial representation similar (or identical) to what we use for plain text. This has the advantage that it is more in line with the rest of the Axis2 architecture,
      or
      another option is to write an xmlstream reader/writer implementation to parse the json stream. And provide that xml stream implementation to Axiom.

      [1]http://wso2.org/library/768

      Attachments

        1. performance_test.txt
          2 kB
          Shameera
        2. JsonTestService.aar
          4 kB
          Shameera
        3. jsonSample.patch
          0.6 kB
          Shameera
        4. jsonImpl-1st-approach-sample.diff
          44 kB
          Shameera
        5. jsonImpl-1st-approach.diff
          21 kB
          Shameera
        6. attachments.zip
          17 kB
          Shameera

        Activity

          People

            shameera Shameera
            shameera Shameera
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: