XWBVL ;OIFO-Oakland/REM - M2M Broker Server Link Utl ;05/17/2002 17:46
;;1.1;RPC BROKER;**28**;Mar 28, 1997
;
QUIT
;
START(PORT) ; -- start listener
; // TODO: Add checks and structure to not start listener if already active on port
DO START^XWBVLL(PORT)
QUIT
;
; ---------------------------------------------------------------------
; Close Socket: Methods Calls
; ---------------------------------------------------------------------
;
EXECUTE(XWBPARMS) ; -- execute rpc call
NEW STATUS
IF $G(XWBPARMS("RESULTS"))="" SET XWBPARMS("RESULTS")=$NA(^TMP("XWB CLOSE SOCKET",$J,"XML"))
SET STATUS=$$EXECUTE^XWBVLC(.XWBPARMS)
QUIT STATUS
;
REQUEST(XWBPARMS) ; -- build xml request
NEW XWBLINE
SET XWBLINE=0
SET XWBPARMS("MESSAGE TYPE")="Gov.VA.Med.Foundations.CloseSocketRequest"
IF $G(XWBPARMS("REQUEST"))="" SET XWBPARMS("REQUEST")=$NA(XWBPARMS("REQUEST","XML"))
SET XWBREQ=XWBPARMS("REQUEST")
KILL @XWBREQ
;
; -- build request
DO ADD($$XMLHDR^XWBUTL())
DO ADD("<vistalink type="""_$G(XWBPARMS("MESSAGE TYPE"))_"""/>")
QUIT
;
ADD(STR) ; -- add string to array
SET XWBLINE=XWBLINE+1
SET @XWBREQ@(XWBLINE)=STR
QUIT
;
RESPONSE() ; -- build xml response
; -- initialize
DO PRE^XWBRL
DO WRITE^XWBRL($$XMLHDR^XWBUTL())
DO WRITE^XWBRL("<vistalink type=""Gov.VA.Med.Foundations.CloseSocketResponse"">")
DO WRITE^XWBRL("<results success=""1"" />")
DO WRITE^XWBRL("</vistalink>")
; -- send eot and flush buffer
DO POST^XWBRL
QUIT
;
; ---------------------------------------------------------------------
; Parse Results of Successful RPC Request
; ---------------------------------------------------------------------
;
PARSE(XWBPARMS,XWBY) ; -- parse legacy rpc results ; uses DOM parser
NEW XWBDOM
SET XWBDOM=$$EN^MXMLDOM(XWBPARMS("RESULTS"),"")
SET @XWBY=$$VALUE^MXMLDOM(XWBDOM,2,"success")
DO DELETE^MXMLDOM(XWBDOM)
QUIT
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXWBVL 1964 printed Oct 16, 2024@18:38:12 Page 2
XWBVL ;OIFO-Oakland/REM - M2M Broker Server Link Utl ;05/17/2002 17:46
+1 ;;1.1;RPC BROKER;**28**;Mar 28, 1997
+2 ;
+3 QUIT
+4 ;
START(PORT) ; -- start listener
+1 ; // TODO: Add checks and structure to not start listener if already active on port
+2 DO START^XWBVLL(PORT)
+3 QUIT
+4 ;
+5 ; ---------------------------------------------------------------------
+6 ; Close Socket: Methods Calls
+7 ; ---------------------------------------------------------------------
+8 ;
EXECUTE(XWBPARMS) ; -- execute rpc call
+1 NEW STATUS
+2 IF $GET(XWBPARMS("RESULTS"))=""
SET XWBPARMS("RESULTS")=$NAME(^TMP("XWB CLOSE SOCKET",$JOB,"XML"))
+3 SET STATUS=$$EXECUTE^XWBVLC(.XWBPARMS)
+4 QUIT STATUS
+5 ;
REQUEST(XWBPARMS) ; -- build xml request
+1 NEW XWBLINE
+2 SET XWBLINE=0
+3 SET XWBPARMS("MESSAGE TYPE")="Gov.VA.Med.Foundations.CloseSocketRequest"
+4 IF $GET(XWBPARMS("REQUEST"))=""
SET XWBPARMS("REQUEST")=$NAME(XWBPARMS("REQUEST","XML"))
+5 SET XWBREQ=XWBPARMS("REQUEST")
+6 KILL @XWBREQ
+7 ;
+8 ; -- build request
+9 DO ADD($$XMLHDR^XWBUTL())
+10 DO ADD("<vistalink type="""_$GET(XWBPARMS("MESSAGE TYPE"))_"""/>")
+11 QUIT
+12 ;
ADD(STR) ; -- add string to array
+1 SET XWBLINE=XWBLINE+1
+2 SET @XWBREQ@(XWBLINE)=STR
+3 QUIT
+4 ;
RESPONSE() ; -- build xml response
+1 ; -- initialize
+2 DO PRE^XWBRL
+3 DO WRITE^XWBRL($$XMLHDR^XWBUTL())
+4 DO WRITE^XWBRL("<vistalink type=""Gov.VA.Med.Foundations.CloseSocketResponse"">")
+5 DO WRITE^XWBRL("<results success=""1"" />")
+6 DO WRITE^XWBRL("</vistalink>")
+7 ; -- send eot and flush buffer
+8 DO POST^XWBRL
+9 QUIT
+10 ;
+11 ; ---------------------------------------------------------------------
+12 ; Parse Results of Successful RPC Request
+13 ; ---------------------------------------------------------------------
+14 ;
PARSE(XWBPARMS,XWBY) ; -- parse legacy rpc results ; uses DOM parser
+1 NEW XWBDOM
+2 SET XWBDOM=$$EN^MXMLDOM(XWBPARMS("RESULTS"),"")
+3 SET @XWBY=$$VALUE^MXMLDOM(XWBDOM,2,"success")
+4 DO DELETE^MXMLDOM(XWBDOM)
+5 QUIT
+6 ;