Trying to call a REST service from within Uniface code.
Using the following code.
putitem/id v_headers,"X-PCI-Token",<token>
putitem/id v_headers,"content-type","application/json"
v_data = $newstruct
.... some code to build the struct correctly.......
structtojson/whitespace v_content, v_data
$api$->set_flags(15)
v_status = $api$->SEND($uri$, "POST", "", "", v_Headers, v_Content, v_Response)
v_headers, v_contact and v_response are all strings.
I have checked v_content just before the send operation, and it contains correctly formatted JSON. Pasting this JSON into SoapUI activates the far end correctly.
However, logging on the far end shows blank content when send from uniface.
Is there any way I can catch/log the output of UHTTP to get the raw data sent to the far end? Or can anyone spot why UHTTP might be clearing the content before sending (bad parsing or something?
Iain
JSON content sample for reference.
{
"subscription_type" : "company.creation",
"properties" : {
"name" : "St, Vat, Eom, No stdisc. Doc Email",
"phone" : "+44114201220",
"address_line_1" : "23 PCI House ims",
"address_line_2" : "Woodseats Avenue",
"city" : "Sheffield",
"county" : "S. Yorkshire",
"country" : "UK",
"post_code" : "S8 0TB",
"company_tier" : ""
}
}------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------