Petals BC REST

Unable to create the right XML payload from an incoming HTTP POST

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.1.1-BC
  • Fix Version/s: 1.2.0-BC
  • Component/s: Consumer mode
  • Security Level: Public
  • Description:
    Hide

    I want to export my service interface as following:

    • HTTP method: POST
    • HTTP path: http://<server:port>/api/demarches-administratives/cantine
    • HTTP body JSON:
      {
         "usager-demandeur": "jdoe",
         "numero-fiscal": "123456789"
      }

    As it's a POST, only the convertion JSON --> XML is operated, and I'm not able to manage correctly namespaces in XML payload. The expected XML payload is:

    <new xmlns="my-namespace">
       <usager-demandeur xmlns="">jdoe</usager-demandeur>
       <numero-fiscal xmlns="">123456789</numero-fiscal>
    </new>

    I think that we should run a XSL transformation after the JSON-->XML conversion to adjust XML payload.

    Moreover, we should be able to include in the XML payload elements of the URL path according to the URI template. These parameters could be transmitted to the XSL transformation as XSL parameters.

    Show
    I want to export my service interface as following:
    • HTTP method: POST
    • HTTP path: http://<server:port>/api/demarches-administratives/cantine
    • HTTP body JSON:
      {
         "usager-demandeur": "jdoe",
         "numero-fiscal": "123456789"
      }
    As it's a POST, only the convertion JSON --> XML is operated, and I'm not able to manage correctly namespaces in XML payload. The expected XML payload is:
    <new xmlns="my-namespace">
       <usager-demandeur xmlns="">jdoe</usager-demandeur>
       <numero-fiscal xmlns="">123456789</numero-fiscal>
    </new>
    I think that we should run a XSL transformation after the JSON-->XML conversion to adjust XML payload. Moreover, we should be able to include in the XML payload elements of the URL path according to the URI template. These parameters could be transmitted to the XSL transformation as XSL parameters.
  • Environment:
    -

People

Dates

  • Created:
    Wed, 28 Mar 2018 - 11:27:42 +0200
    Updated:
    Wed, 6 Jun 2018 - 09:39:04 +0200
    Resolved:
    Wed, 28 Mar 2018 - 17:39:34 +0200