“Send web request” Activity fails to print the output json file in Alert!
Hi All,
“Send web request” Activity fails to print the output json file in Alert!
For Example, I have 2 workflows:
Workflow1: The client workflow that allow the end user to upload file (.dwg)
Workflow2: The server workflow that take the uploaded file (.dwg) and put in in the “send web request” activity
Send web request url is the published fme workbench that convert (.dwg) file to json file
The below 2 workflow that I built but the json file is not printed in the alert! And the workflow didn’t return any error and display the json in the console, what could be the issue here?
Client WF
{
"_properties": {
"isServerWorkflow": false
},
"components": [
{
"id": 2,
"steps": [
{
"id": 3,
"inputs": {},
"position": "0,0",
"purpose": "start",
"title": "Start",
"transitions": [
{
"id": 6,
"inputs": {},
"position": "90,60 90,110",
"sourceConnector": "bottom",
"target": {
"id": 4
}
}
]
},
{
"action": "gcx:wf:forms:form:DisplayForm",
"id": 4,
"inputs": {
"form": {
"accessors": [],
"code": "resources.forms[values.id]",
"values": {
"id": 5
}
}
},
"name": "form1",
"position": "-30,110",
"title": "Display Form",
"transitions": [
{
"id": 12,
"inputs": {},
"position": "90,230 90,280",
"sourceConnector": "bottom",
"target": {
"id": 11
}
}
]
},
{
"action": "gcx:wf:core::GetBase64StringFromFile",
"id": 11,
"inputs": {
"file": {
"accessors": [
"$form1"
],
"annotations": [
{
"count": 6,
"index": 0,
"kind": "idref"
}
],
"code": "$form1.state.filePicker1.value.files[0]",
"source": "$form1.state.filePicker1.value.files[0]"
}
},
"name": "getBase64",
"position": "-30,280",
"title": "Get Base64 String From File",
"transitions": [
{
"id": 59,
"position": "90,350 90,470",
"sourceConnector": "bottom",
"target": {
"id": 58
},
"targetConnector": "top"
}
]
},
{
"action": "gcx:wf:ui::Alert",
"id": 20,
"inputs": {
"text": {
"accessors": [
"$runWorkflow1"
],
"annotations": [
{
"count": 13,
"index": 0,
"kind": "idref"
}
],
"code": "$runWorkflow1.result.output",
"source": "$runWorkflow1.result.output"
},
"title": "json file"
},
"position": "-30,640",
"title": "Alert"
},
{
"action": "gcx:wf:core::RunWorkflow",
"id": 58,
"inputs": {
"arguments": {
"accessors": [
"$getBase64",
"$form1"
],
"annotations": [
{
"count": 10,
"index": 27,
"kind": "idref"
},
{
"count": 6,
"index": 55,
"kind": "idref"
}
],
"code": "{ base64FromClientWorkflow: $getBase64.result,\n fileName: $form1.state.filePicker1.value.files[0].name }",
"source": "{base64FromClientWorkflow: $getBase64.result,\nfileName:$form1.state.filePicker1.value.files[0].name}"
},
"url": "https://lubnaj-pc.molg.pna.ps/adaptor/home/item.html?id=7b20acfe3ab84015b9d59fb738fff873"
},
"name": "runWorkflow1",
"position": "-30,470",
"title": "Run Workflow",
"transitions": [
{
"id": 60,
"position": "90,540 90,640",
"sourceConnector": "bottom",
"target": {
"id": 20
}
}
]
}
]
}
],
"designerVersion": "5.30.1+1",
"forms": [
{
"defaults": {},
"elements": {
"filePicker1": {
"enabled": true,
"fileTypes": "*",
"index": 0,
"prompt": {
"markdown": "Add File"
},
"rowIndex": 0,
"rowNumber": 0,
"size": 1,
"title": {
"markdown": "File Picker"
},
"type": "FilePicker"
},
"footer": {
"enabled": true,
"items": {
"0": {
"default": true,
"index": 0,
"label": {
"markdown": "Submit"
},
"validates": true,
"value": "submit"
},
"1": {
"index": 1,
"label": {
"markdown": "Cancel"
},
"validates": false,
"value": "cancel"
}
},
"section": "footer",
"type": "ButtonBar"
},
"header": {
"section": "header",
"title": {
"markdown": "Form Title"
},
"type": "Header"
}
},
"id": 5
}
],
"licenseInfo": {
"licenseUrl": "https://lubnaj-pc.molg.pna.ps/vertigisstudio/workflow/service/auth/license"
},
"start": {
"id": 3
}
}

Server WF
{
"_properties": {
"isServerWorkflow": true
},
"components": [
{
"id": 2,
"steps": [
{
"id": 3,
"inputs": {},
"position": "150,-100",
"purpose": "start",
"title": "Start",
"transitions": [
{
"id": 24,
"position": "240,-40 240,50",
"sourceConnector": "bottom",
"target": {
"id": 8
}
}
]
},
{
"action": "gcx:wf:server::WriteFileBytes",
"id": 6,
"inputs": {
"bytes": {
"accessors": [
"$getBytesFromBase64String1"
],
"annotations": [
{
"count": 26,
"index": 0,
"kind": "idref"
}
],
"code": "$getBytesFromBase64String1.result",
"source": "$getBytesFromBase64String1.result"
},
"path": {
"accessors": [
"$getWorkflowInputs1"
],
"annotations": [
{
"count": 19,
"index": 43,
"kind": "idref"
}
],
"code": "\"C:/ProgramData/Geocortex/Workflow/fme/\" + $getWorkflowInputs1.inputs.fileName",
"source": " \"C:/ProgramData/Geocortex/Workflow/fme/\" +$getWorkflowInputs1.inputs.fileName\n\n\n"
}
},
"position": "110,340",
"title": "Write File Bytes",
"transitions": [
{
"id": 30,
"position": "230,370 230,460",
"sourceConnector": "bottom",
"target": {
"id": 18
},
"targetConnector": "top"
}
]
},
{
"action": "gcx:wf:core::GetWorkflowInputs",
"id": 8,
"inputs": {},
"name": "getWorkflowInputs1",
"position": "120,50",
"title": "Get Workflow Inputs",
"transitions": [
{
"id": 25,
"position": "240,120 240,190 230,190 230,210",
"sourceConnector": "bottom",
"target": {
"id": 11
},
"targetConnector": "top"
}
]
},
{
"action": "gcx:wf:core::GetBytesFromBase64String",
"id": 11,
"inputs": {
"base64": {
"accessors": [
"$getWorkflowInputs1"
],
"annotations": [
{
"count": 19,
"index": 0,
"kind": "idref"
}
],
"code": "$getWorkflowInputs1.inputs.base64FromClientWorkflow",
"source": "$getWorkflowInputs1.inputs.base64FromClientWorkflow"
}
},
"name": "getBytesFromBase64String1",
"position": "110,210",
"title": "Get Bytes From Base64 String",
"transitions": [
{
"id": 28,
"position": "230,280 230,340",
"sourceConnector": "bottom",
"target": {
"id": 6
},
"targetConnector": "top"
}
]
},
{
"action": "gcx:wf:core:request:WebRequest",
"id": 18,
"inputs": {
"expect": "json",
"headers": {
"accessors": [],
"annotations": [],
"code": "{ \"Header\": \"headers\",\n \"Content-Type\": \"Application/json\" }",
"source": "{\"Header\": \"headers\",\n\"Content-Type\": \"Application/json\"}"
},
"method": "POST",
"query": {
"accessors": [
"$getWorkflowInputs1"
],
"annotations": [
{
"count": 19,
"index": 0,
"kind": "idref"
}
],
"code": "$getWorkflowInputs1.inputs.fileName",
"source": "$getWorkflowInputs1.inputs.fileName"
},
"timeout": 1000,
"url": "http://10.111.60.100/fmedatastreaming/Samples/CAD_To_GIS.fmw?"
},
"name": "webRequest1",
"position": "110,460",
"title": "Send Web Request",
"transitions": [
{
"id": 41,
"position": "230,530 230,610",
"sourceConnector": "bottom",
"target": {
"id": 33
},
"targetConnector": "top"
}
]
},
{
"action": "gcx:wf:core::SetWorkflowOutput",
"id": 33,
"inputs": {
"name": "json file send web request",
"value": {
"accessors": [
"$webRequest1"
],
"annotations": [
{
"count": 12,
"index": 0,
"kind": "idref"
}
],
"code": "$webRequest1.json",
"source": "$webRequest1.json"
}
},
"name": "output",
"position": "110,610",
"title": "Set Workflow Output"
}
]
}
],
"designerVersion": "5.30.1+1",
"licenseInfo": {
"licenseUrl": "https://lubnaj-pc.molg.pna.ps/vertigisstudio/workflow/service/auth/license"
},
"start": {
"id": 3
}
}

console output:

Best,
Lubna
-
+1
0 -
It works fine with me after make the output of the server workflow to be text then parse it to json
Best,
Lubna
1
Please sign in to leave a comment.
Comments
2 comments