9 Replies Latest reply on May 18, 2015 8:47 AM by antnee777

    I need a REST....

    antnee777

      Hello,

       

      I am testing pushing a ruleset via REST, for my test I created a top level ruleset with nothing inside it and exported it to blank.xml (see below)

       

      I try to push the ruleset like this, expecting it to land in the default position (-1). Note that I don't use the '@' sign in front of the xml file name, as the REST documentation tells me not to (or rather the example of this in the REST docs does not use the '@' sign.

      `curl -i -b cookies.txt -X POST -d blank.xml -H "Content-Type: application/xml" "$REST/rulesets/import" --insecure`

      The error thrown is "XMLFormat wrong, or invalid content length", which is a puzzle, as the XML I use is exported from the MWG.

       

      Can anyone spot my error and enlighten me ?

       

      For completeness, if I do include '@' like this:

      `curl -i -b cookies.txt -X POST -d @blank.xml -H "Content-Type: application/xml" "$REST/rulesets/import" --insecure`

      The error thrown is "Internal Server Error"

       

      <From the REST Docs>

      Imports a ruleset to the given position 

       curl -i -b cookies.txt -X POST -d rulesetInMWGLibraryXMLForm.xml -H "Content-Type: application/xml" "$REST/rulesets/import" 

       

      blank.xml

      <libraryContent>

        <libraryObject>

          <name>newblank</name>

          <version>7.5.1-18935</version>

          <description></description>

        </libraryObject>

        <ruleGroup id="347" defaultRights="2" name="newblank" enabled="true" cycleRequest="true" cycleResponse="true" cycleEmbeddedObject="true" cloudSynced="false">

          <acElements/>

          <condition always="true">

            <expressions/>

          </condition>

          <description></description>

          <rules/>

          <ruleGroups/>

        </ruleGroup>

      </libraryContent>

       

      asabban, I'm sure you can help