0

Step Functionality: creation of draft; success status shown by creation of draft id in server response

Call:

web_custom_request("draft",
        "URL=https://xxx.yyy.com/__services/v2/rest/draft", 
        "Method=POST", 
        "Resource=0", 
        "RecContentType=text/xml", 
        "Referer=https://xxx.yyy.com/blog/create-post.jspa?containerType=14&containerID=1", 
        "Snapshot=t7.inf", 
        "Mode=HTML", 
        "EncType=application/json; charset=utf-8", 
        "Body={\"objectType\":38,\"draftObjectType\":2020,\"draftObjectID\":137742,\"subject\":\"perf test 2\",\"body\":\"<body><p>test data</p></body>\",\"properties\":{\"publishBar\":{\"container\":{\"objectType\":\"37\",\"objectID\":\"90094\"},\"visibility\":\"all\",\"commentStatus\":\"2\",\"blogPublishOption\":false,\"publishDate\":{\"selectedDate\":\"{p_Date}\",\"selectedHour\":\"1\",\"selectedMinute\":\"0\",\"selectedPeriod\":\"AM\"}}}}", 
        LAST);

Data correlated: draft ID; response of this call Data parameterized: selectedDate remaining values are constant

Recording response body:

{
  "id" : 2814,
  "objectType" : 38,
  "draftObjectType" : 2020,
  "draftObjectID" : 137742,
  "subject" : "perf test",
  "body" : "<body><p>this i</p></body>",
  "modificationDate" : "2015-10-12T13:44:00.854+0000",
  "properties" : {
    "publishBar" : {
      "container" : {
        "objectType" : "37",
        "objectID" : "90094"
      },
      "visibility" : "all",
      "commentStatus" : "2",
      "blogPublishOption" : false,
      "publishDate" : {
        "selectedDate" : "10/13/2015",
        "selectedHour" : "1",
        "selectedMinute" : "0",
        "selectedPeriod" : "AM"
      }
    }
  }
}

Error during replay:

{ "code" : 500, "message" :com.sun.istack.SAXException2: class java.util.LinkedHashMap nor any of its super class is known to this context.
javax.xml.bind.JAXBException: class java.util.LinkedHashMap nor any of its super class is known to this context." }

Kindly help.

2 Answers2

0

It's obvious you're not correlating all that needs to be correlated. Do some re-recordings and see what's different between the responses of each recording.

Michael Galos
  • 1,065
  • 3
  • 13
  • 27
0

Without the complete script I can't say for sure, but at least change the following in your request:

"RecContentType=text/xml" to "RecContentType=application/json"

"Mode=HTML" to ""Mode=HTTP"

The 1st sets the expected response content type, and if it's not XML there might be problems. This is assuming the service responds with the correct content-type.

2nd sets the mode to HTTP as REST API responses usually do not need parsing of the content.

K.Sandell
  • 1,369
  • 10
  • 19