Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-1335

RPC Invocation via XML POST fails while equivalent JSON succeeds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • None
    • restconf
    • None
    • Operating System: All
      Platform: All

    • 3351

      Using toaster RPC as an example, POST XML to the REST endpoint fails while the equivalent POST using JSON succeeds.

      XML input:
      Endpoint: http://localhost:8181/restconf/operations/toaster:make-toast
      Content-Type: application/xml
      Body:
      <input>
      <toasterDoneness>1</toasterDoneness>
      <toasterToastType>wheat-bread</toasterToastType>
      <foo>fooValue</foo>
      </input>

      Status: 400 Bad Request
      {"errors":{"error":[

      {"error-type":"protocol","error-tag":"malformed-message","error-message":"Error parsing input: Unknown child(ren) node(s) detected, identified by: toasterDoneness, in: container input"}

      ]}}

      When I try using JSON:
      Endpoint: http://localhost:8181/restconf/operations/toaster:make-toast
      Content-Type: application/xml
      Body:
      {
      "input" :

      { "toaster:toasterDoneness" : "1", "toaster:toasterToastType" : "wheat-bread", "toaster:foo" : "fooValue" }

      }
      Status: 200 OK

            Unassigned Unassigned
            rgoulding Ryan Goulding
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: