[ { "id": "ex03-tab", "type": "tab", "label": "Azure: 03 Echo method", "info": "Invoke echo on the Edge module identity. Preserves requestId and returns native JSON; no device state is changed." }, { "id": "ex03-intro", "type": "comment", "z": "ex03-tab", "name": "Start here: invoke MODULE method echo", "info": "Requires Edge workload identity and one shared Module Client. If importing alongside another example, reselect that existing config and remove the redundant imported config before deploying. From an authorized IoT Hub service-side tool, target the Edge DEVICE ID plus this deployment's MODULE ID, method echo, payload {\"value\":42}, response timeout >=30 seconds. Expect status 200 and {\"echo\":{\"value\":42}}. No real device setting is changed and no message route is needed. Wire responses to the same Method node and preserve requestId; requests expire after 25 seconds. Catch only reports errors; it does not answer the method automatically. Review Debug output before production use.", "x": 320, "y": 60, "wires": [] }, { "id": "ex03-client", "type": "moduleclient" }, { "id": "ex03-method", "type": "modulemethod", "z": "ex03-tab", "client": "ex03-client", "method": "echo", "x": 190, "y": 160, "wires": [["ex03-response", "ex03-request-debug"]] }, { "id": "ex03-response", "type": "function", "z": "ex03-tab", "name": "Echo and preserve requestId", "func": "msg.payload = { echo: msg.payload };\nmsg.status = 200;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 490, "y": 160, "wires": [["ex03-method"]] }, { "id": "ex03-request-debug", "type": "debug", "z": "ex03-tab", "name": "Request: retain msg.requestId", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 480, "y": 220, "wires": [] }, { "id": "ex03-catch", "type": "catch", "z": "ex03-tab", "name": "Method/response errors", "scope": ["ex03-method", "ex03-response"], "uncaught": false, "x": 200, "y": 320, "wires": [["ex03-error-debug"]] }, { "id": "ex03-error-debug", "type": "debug", "z": "ex03-tab", "name": "Response failed: inspect msg.error", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 540, "y": 320, "wires": [] }, { "id": "ex03-complete", "type": "complete", "z": "ex03-tab", "name": "Response send completed", "scope": ["ex03-method"], "uncaught": false, "x": 210, "y": 380, "wires": [["ex03-complete-debug"]] }, { "id": "ex03-complete-debug", "type": "debug", "z": "ex03-tab", "name": "Method response SDK completion", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 540, "y": 380, "wires": [] }, { "id": "ex03-status", "type": "status", "z": "ex03-tab", "name": "Method status", "scope": ["ex03-method"], "x": 170, "y": 440, "wires": [["ex03-status-debug"]] }, { "id": "ex03-status-debug", "type": "debug", "z": "ex03-tab", "name": "Method status", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "status", "x": 480, "y": 440, "wires": [] } ]