XOBWPA04 ;OAK/BDT - HWSC :: Environmental Check ; 06/28/2016
;;1.0;HwscWebServiceClient;**4**;September 13, 2010;Build 9
;Per VA Directive 6402, this routine should not be modified.
;
; ***** IMPORTANT NOTE *******************************************
; This routine requires access to the manager (%SYS) namespace and
; can only be run by a user with permissions to that namespace.
; ****************************************************************
;
; Loads "xobw4.xml" into XOBW*1*4 transport global. Post-installation
; routine ^XOBWPA04 will reconstruct the file for the installation of Cache
; classes into VistA to support SSL. The "xobw4.xml"
; file must be in the PRIMARY HFS DIRECTORY prior to transport.
;
; Note: Make sure that there are no lines longer than 255 chars in the file
; to be loaded! It appears $$FTG is not creating overflow nodes.
;
POST ;
D SETDATA ;
D IMPDATA ;
Q
GETDATA ; export data from xobw4.xml file
N I,X,XFILE,XPATH,XREF
K ^TMP($J,4)
S XFILE="xobw4.xml"
S XPATH=$$DEFDIR^%ZISH ;PRIMARY HFS DIRECTORY
S XREF="^TMP("_$J_",4,1,0)"
S X=$$FTG^%ZISH(XPATH,XFILE,XREF,3) ;Load file into global
Q
;
IMPDATA ; import data into xobw4.xml file
N XDIR,XOBWY,Y
S XDIR=$$DEFDIR^%ZISH
S XREF="^TMP("_$J_",4,1,0)"
S Y=$$GTF^%ZISH(XREF,3,XDIR,"xobw4.xml") ;Export ^TMP global to XML file
K ^TMP($J,4)
S XDIR=$$DEFDIR^%ZISH
S XOBWY=$$IMPORT^XOBWLIB1(XDIR,"xobw4.xml") ;Import Cache classes
IF 'XOBWY DO
. DO BMES^XPDUTL("Error occurred during the importing of support classes file:")
. DO MES^XPDUTL(" Directory: "_XDIR)
. DO MES^XPDUTL(" File Name: "_"xobw4.xml")
. DO MES^XPDUTL(" Error: "_$PIECE(XOBWY,"^",2))
. DO MES^XPDUTL(" o Classes not imported.")
ELSE DO
. DO MES^XPDUTL(" o Support classes imported successfully.")
. DO MES^XPDUTL(" ")
Q
;
SETDATA ;
N I,IT
K ^TMP($J,4)
F I=1:1:158 S IT=$T(DATA+I) S ^TMP($J,4,I,0)=$P(IT,";;",2)
Q
DATA ;
;;<?xml version="1.0" encoding="UTF-8"?>
;;<Export generator="Cache" version="25" zv="Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2014.1.3 (Build 775)" ts="2016-06-10 11:14:51">
;;<Class name="xobw.WebServiceProxyFactory">
;;<Description><![CDATA[
;;This factory class contains methods to create web service proxy instances.
;;<br><br>As part of the creation process, web server ip/port resolution is performed and
;;any security implementation, as defined by ISS, is executed. ]]></Description>
;;<ClassType/>
;;<ProcedureBlock>1</ProcedureBlock>
;;<Super>%RegisteredObject</Super>
;;<TimeChanged>64072,51245.767727</TimeChanged>
;;<TimeCreated>60655,58903.754395</TimeCreated>
;;
;;<UDLText name="T">
;;<Content><![CDATA[
;;// 1.0;HwscWebServiceClient ;;September 13, 2010
;;
;;]]></Content>
;;</UDLText>
;;
;;<UDLText name="T">
;;<Content><![CDATA[
;;// HealtheVet Web Service Client v1 [Build: 1.0.1.009]
;;
;;]]></Content>
;;</UDLText>
;;
;;<Property name="webServiceMetadata">
;;<Type>WebServiceMetadata</Type>
;;<Private>1</Private>
;;</Property>
;;
;;<Method name="%OnNew">
;;<FormalSpec>webServiceName:%String</FormalSpec>
;;<ReturnType>%Status</ReturnType>
;;<Implementation><![CDATA[
;; set webServiceId=##class(xobw.WebServiceMetadata).getWebServiceId(webServiceName)
;; if 'webServiceId {
;; do ##class(xobw.error.DialogError).forceError(186006_"^"_webServiceName)
;; }
;; set ..webServiceMetadata=##class(xobw.WebServiceMetadata).%OpenId(webServiceId)
;; quit $$$OK
;;]]></Implementation>
;;</Method>
;;
;;<Method name="getProxy">
;;<Description><![CDATA[
;;Creates web service client proxy for a web server.
;;<ul>
;;Parameter:
;; <li><parameter>webServerName = name of server as it appears in NAME (#.01) field of a WEB SERVER (#18.12) file entry</parameter>
;;</ul>]]></Description>
;;<FormalSpec>webServerName:%String</FormalSpec>
;;<ReturnType>%SOAP.WebClient</ReturnType>
;;<Implementation><![CDATA[
;; // Future: Add any required headers to proxy when discovered, if any
;; new %proxy
;; if ..webServiceMetadata.type'=1 {
;; do ##class(xobw.error.DialogError).forceError(186007)
;; }
;; xecute "set %proxy=##class("_..webServiceMetadata.proxyClassName_").%New()"
;; if %proxy'=$$$NULLOREF {
;; set webServerId=##class(xobw.WebServer).getWebServerId(webServerName)
;; if 'webServerId {
;; do ##class(xobw.error.DialogError).forceError(186005_"^"_webServerName)
;; }
;; set webServer=##class(xobw.WebServer).%OpenId(webServerId)
;;
;; // web server is disabled
;; if 'webServer.status {
;; do ##class(xobw.error.DialogError).forceError(186002_"^"_webServer.name)
;; }
;;
;; do ..setUpCredentials(webServer, %proxy)
;; do ..setUpLocation(webServer, %proxy)
;; }
;; quit $get(%proxy)
;;]]></Implementation>
;;</Method>
;;
;;<Method name="setUpCredentials">
;;<FormalSpec>webServer:WebServer,proxy:%SOAP.WebClient</FormalSpec>
;;<Private>1</Private>
;;<Implementation><![CDATA[
;; set authorizedWebServiceId=##class(xobw.WebServicesAuthorized).getAuthorizedWebServiceId(webServer,..webServiceMetadata)
;;
;; // web service is not authorized
;; if 'authorizedWebServiceId {
;; do ##class(xobw.error.DialogError).forceError(186003_"^"_..webServiceMetadata.name_"^"_webServer.name)
;; }
;;
;; set authorizedWebService=##class(xobw.WebServicesAuthorized).%OpenId(authorizedWebServiceId)
;;
;; // web service is disabled
;; if 'authorizedWebService.status {
;; do ##class(xobw.error.DialogError).forceError(186004_"^"_..webServiceMetadata.name_"^"_webServer.name)
;; }
;;
;; if webServer.loginRequired="1"!(webServer.loginRequired="") {
;; set proxy.HttpUsername=webServer.userName
;; set proxy.HttpPassword=webServer.getPassword()
;; }
;; quit
;;]]></Implementation>
;;</Method>
;;
;;<Method name="setUpLocation">
;;<FormalSpec>webServer:WebServer,proxy:%SOAP.WebClient</FormalSpec>
;;<Private>1</Private>
;;<Implementation><![CDATA[
;; if (webServer.sslEnabled && ('$$SSLOK^XOBWENV())) {
;; do ##class(xobw.error.DialogError).forceError(186002_"^"_webServer.name_" (SSL is disabled on VMS)")
;; }
;; if (webServer.sslEnabled) {
;; set proxy.Location="https://"_webServer.server_":"_webServer.sslPort_"/"_..webServiceMetadata.contextRoot
;; set proxy.SSLConfiguration = webServer.sslConfiguration
;; set proxy.SSLCheckServerIdentity = 0
;; } else {
;; set proxy.Location="http://"_webServer.server_":"_webServer.port_"/"_..webServiceMetadata.contextRoot
;; }
;; set proxy.Timeout=webServer.defaultTimeout
;; quit
;;]]></Implementation>
;;</Method>
;;
;;<Method name="close">
;;<Description><![CDATA[
;;Close web service proxy factory
;;<br>
;;<br>Performs any close processing activities required.]]></Description>
;;<ReturnType>%Status</ReturnType>
;;<Implementation><![CDATA[ quit $$$OK
;;]]></Implementation>
;;</Method>
;;
;;<Method name="getWebServiceProxy">
;;<Description><![CDATA[
;;Create web service proxy
;;<ul>
;;Parameters:
;; <li><parameter>webServiceName = name of service as it appears NAME (#.01) field in an WEB SERVICE (#18.02) file entry</parameter>
;; <li><parameter>webServerName = name of server as it appears NAME (#.01) field in an WEB SERVER (#18.12) file entry</parameter>
;;</ul>
;;<br><b>Restricted Use:</b> This method is for HWSC use only. Applications should use the $$GETPROXY^XOBWLB(...) API]]></Description>
;;<ClassMethod>1</ClassMethod>
;;<FormalSpec>webServiceName:%String,webServerName:%String</FormalSpec>
;;<ReturnType>%SOAP.WebClient</ReturnType>
;;<Implementation><![CDATA[
;; set factory=##class(xobw.WebServiceProxyFactory).%New(webServiceName)
;; if factory'=$$$NULLOREF {
;; set proxy=factory.getProxy(webServerName)
;; set ok=factory.close()
;; }
;; quit $get(proxy,$$$NULLOREF)
;;]]></Implementation>
;;</Method>
;;</Class>
;;</Export>
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXOBWPA04 8449 printed Dec 13, 2024@02:46:13 Page 2
XOBWPA04 ;OAK/BDT - HWSC :: Environmental Check ; 06/28/2016
+1 ;;1.0;HwscWebServiceClient;**4**;September 13, 2010;Build 9
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; ***** IMPORTANT NOTE *******************************************
+5 ; This routine requires access to the manager (%SYS) namespace and
+6 ; can only be run by a user with permissions to that namespace.
+7 ; ****************************************************************
+8 ;
+9 ; Loads "xobw4.xml" into XOBW*1*4 transport global. Post-installation
+10 ; routine ^XOBWPA04 will reconstruct the file for the installation of Cache
+11 ; classes into VistA to support SSL. The "xobw4.xml"
+12 ; file must be in the PRIMARY HFS DIRECTORY prior to transport.
+13 ;
+14 ; Note: Make sure that there are no lines longer than 255 chars in the file
+15 ; to be loaded! It appears $$FTG is not creating overflow nodes.
+16 ;
POST ;
+1 ;
DO SETDATA
+2 ;
DO IMPDATA
+3 QUIT
GETDATA ; export data from xobw4.xml file
+1 NEW I,X,XFILE,XPATH,XREF
+2 KILL ^TMP($JOB,4)
+3 SET XFILE="xobw4.xml"
+4 ;PRIMARY HFS DIRECTORY
SET XPATH=$$DEFDIR^%ZISH
+5 SET XREF="^TMP("_$JOB_",4,1,0)"
+6 ;Load file into global
SET X=$$FTG^%ZISH(XPATH,XFILE,XREF,3)
+7 QUIT
+8 ;
IMPDATA ; import data into xobw4.xml file
+1 NEW XDIR,XOBWY,Y
+2 SET XDIR=$$DEFDIR^%ZISH
+3 SET XREF="^TMP("_$JOB_",4,1,0)"
+4 ;Export ^TMP global to XML file
SET Y=$$GTF^%ZISH(XREF,3,XDIR,"xobw4.xml")
+5 KILL ^TMP($JOB,4)
+6 SET XDIR=$$DEFDIR^%ZISH
+7 ;Import Cache classes
SET XOBWY=$$IMPORT^XOBWLIB1(XDIR,"xobw4.xml")
+8 IF 'XOBWY
Begin DoDot:1
+9 DO BMES^XPDUTL("Error occurred during the importing of support classes file:")
+10 DO MES^XPDUTL(" Directory: "_XDIR)
+11 DO MES^XPDUTL(" File Name: "_"xobw4.xml")
+12 DO MES^XPDUTL(" Error: "_$PIECE(XOBWY,"^",2))
+13 DO MES^XPDUTL(" o Classes not imported.")
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 DO MES^XPDUTL(" o Support classes imported successfully.")
+16 DO MES^XPDUTL(" ")
End DoDot:1
+17 QUIT
+18 ;
SETDATA ;
+1 NEW I,IT
+2 KILL ^TMP($JOB,4)
+3 FOR I=1:1:158
SET IT=$TEXT(DATA+I)
SET ^TMP($JOB,4,I,0)=$PIECE(IT,";;",2)
+4 QUIT
DATA ;
+1 ;;<?xml version="1.0" encoding="UTF-8"?>
+2 ;;<Export generator="Cache" version="25" zv="Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2014.1.3 (Build 775)" ts="2016-06-10 11:14:51">
+3 ;;<Class name="xobw.WebServiceProxyFactory">
+4 ;;<Description><![CDATA[
+5 ;;This factory class contains methods to create web service proxy instances.
+6 ;;<br><br>As part of the creation process, web server ip/port resolution is performed and
+7 ;;any security implementation, as defined by ISS, is executed. ]]></Description>
+8 ;;<ClassType/>
+9 ;;<ProcedureBlock>1</ProcedureBlock>
+10 ;;<Super>%RegisteredObject</Super>
+11 ;;<TimeChanged>64072,51245.767727</TimeChanged>
+12 ;;<TimeCreated>60655,58903.754395</TimeCreated>
+13 ;;
+14 ;;<UDLText name="T">
+15 ;;<Content><![CDATA[
+16 ;;// 1.0;HwscWebServiceClient ;;September 13, 2010
+17 ;;
+18 ;;]]></Content>
+19 ;;</UDLText>
+20 ;;
+21 ;;<UDLText name="T">
+22 ;;<Content><![CDATA[
+23 ;;// HealtheVet Web Service Client v1 [Build: 1.0.1.009]
+24 ;;
+25 ;;]]></Content>
+26 ;;</UDLText>
+27 ;;
+28 ;;<Property name="webServiceMetadata">
+29 ;;<Type>WebServiceMetadata</Type>
+30 ;;<Private>1</Private>
+31 ;;</Property>
+32 ;;
+33 ;;<Method name="%OnNew">
+34 ;;<FormalSpec>webServiceName:%String</FormalSpec>
+35 ;;<ReturnType>%Status</ReturnType>
+36 ;;<Implementation><![CDATA[
+37 ;; set webServiceId=##class(xobw.WebServiceMetadata).getWebServiceId(webServiceName)
+38 ;; if 'webServiceId {
+39 ;; do ##class(xobw.error.DialogError).forceError(186006_"^"_webServiceName)
+40 ;; }
+41 ;; set ..webServiceMetadata=##class(xobw.WebServiceMetadata).%OpenId(webServiceId)
+42 ;; quit $$$OK
+43 ;;]]></Implementation>
+44 ;;</Method>
+45 ;;
+46 ;;<Method name="getProxy">
+47 ;;<Description><![CDATA[
+48 ;;Creates web service client proxy for a web server.
+49 ;;<ul>
+50 ;;Parameter:
+51 ;; <li><parameter>webServerName = name of server as it appears in NAME (#.01) field of a WEB SERVER (#18.12) file entry</parameter>
+52 ;;</ul>]]></Description>
+53 ;;<FormalSpec>webServerName:%String</FormalSpec>
+54 ;;<ReturnType>%SOAP.WebClient</ReturnType>
+55 ;;<Implementation><![CDATA[
+56 ;; // Future: Add any required headers to proxy when discovered, if any
+57 ;; new %proxy
+58 ;; if ..webServiceMetadata.type'=1 {
+59 ;; do ##class(xobw.error.DialogError).forceError(186007)
+60 ;; }
+61 ;; xecute "set %proxy=##class("_..webServiceMetadata.proxyClassName_").%New()"
+62 ;; if %proxy'=$$$NULLOREF {
+63 ;; set webServerId=##class(xobw.WebServer).getWebServerId(webServerName)
+64 ;; if 'webServerId {
+65 ;; do ##class(xobw.error.DialogError).forceError(186005_"^"_webServerName)
+66 ;; }
+67 ;; set webServer=##class(xobw.WebServer).%OpenId(webServerId)
+68 ;;
+69 ;; // web server is disabled
+70 ;; if 'webServer.status {
+71 ;; do ##class(xobw.error.DialogError).forceError(186002_"^"_webServer.name)
+72 ;; }
+73 ;;
+74 ;; do ..setUpCredentials(webServer, %proxy)
+75 ;; do ..setUpLocation(webServer, %proxy)
+76 ;; }
+77 ;; quit $get(%proxy)
+78 ;;]]></Implementation>
+79 ;;</Method>
+80 ;;
+81 ;;<Method name="setUpCredentials">
+82 ;;<FormalSpec>webServer:WebServer,proxy:%SOAP.WebClient</FormalSpec>
+83 ;;<Private>1</Private>
+84 ;;<Implementation><![CDATA[
+85 ;; set authorizedWebServiceId=##class(xobw.WebServicesAuthorized).getAuthorizedWebServiceId(webServer,..webServiceMetadata)
+86 ;;
+87 ;; // web service is not authorized
+88 ;; if 'authorizedWebServiceId {
+89 ;; do ##class(xobw.error.DialogError).forceError(186003_"^"_..webServiceMetadata.name_"^"_webServer.name)
+90 ;; }
+91 ;;
+92 ;; set authorizedWebService=##class(xobw.WebServicesAuthorized).%OpenId(authorizedWebServiceId)
+93 ;;
+94 ;; // web service is disabled
+95 ;; if 'authorizedWebService.status {
+96 ;; do ##class(xobw.error.DialogError).forceError(186004_"^"_..webServiceMetadata.name_"^"_webServer.name)
+97 ;; }
+98 ;;
+99 ;; if webServer.loginRequired="1"!(webServer.loginRequired="") {
+100 ;; set proxy.HttpUsername=webServer.userName
+101 ;; set proxy.HttpPassword=webServer.getPassword()
+102 ;; }
+103 ;; quit
+104 ;;]]></Implementation>
+105 ;;</Method>
+106 ;;
+107 ;;<Method name="setUpLocation">
+108 ;;<FormalSpec>webServer:WebServer,proxy:%SOAP.WebClient</FormalSpec>
+109 ;;<Private>1</Private>
+110 ;;<Implementation><![CDATA[
+111 ;; if (webServer.sslEnabled && ('$$SSLOK^XOBWENV())) {
+112 ;; do ##class(xobw.error.DialogError).forceError(186002_"^"_webServer.name_" (SSL is disabled on VMS)")
+113 ;; }
+114 ;; if (webServer.sslEnabled) {
+115 ;; set proxy.Location="https://"_webServer.server_":"_webServer.sslPort_"/"_..webServiceMetadata.contextRoot
+116 ;; set proxy.SSLConfiguration = webServer.sslConfiguration
+117 ;; set proxy.SSLCheckServerIdentity = 0
+118 ;; } else {
+119 ;; set proxy.Location="http://"_webServer.server_":"_webServer.port_"/"_..webServiceMetadata.contextRoot
+120 ;; }
+121 ;; set proxy.Timeout=webServer.defaultTimeout
+122 ;; quit
+123 ;;]]></Implementation>
+124 ;;</Method>
+125 ;;
+126 ;;<Method name="close">
+127 ;;<Description><![CDATA[
+128 ;;Close web service proxy factory
+129 ;;<br>
+130 ;;<br>Performs any close processing activities required.]]></Description>
+131 ;;<ReturnType>%Status</ReturnType>
+132 ;;<Implementation><![CDATA[ quit $$$OK
+133 ;;]]></Implementation>
+134 ;;</Method>
+135 ;;
+136 ;;<Method name="getWebServiceProxy">
+137 ;;<Description><![CDATA[
+138 ;;Create web service proxy
+139 ;;<ul>
+140 ;;Parameters:
+141 ;; <li><parameter>webServiceName = name of service as it appears NAME (#.01) field in an WEB SERVICE (#18.02) file entry</parameter>
+142 ;; <li><parameter>webServerName = name of server as it appears NAME (#.01) field in an WEB SERVER (#18.12) file entry</parameter>
+143 ;;</ul>
+144 ;;<br><b>Restricted Use:</b> This method is for HWSC use only. Applications should use the $$GETPROXY^XOBWLB(...) API]]></Description>
+145 ;;<ClassMethod>1</ClassMethod>
+146 ;;<FormalSpec>webServiceName:%String,webServerName:%String</FormalSpec>
+147 ;;<ReturnType>%SOAP.WebClient</ReturnType>
+148 ;;<Implementation><![CDATA[
+149 ;; set factory=##class(xobw.WebServiceProxyFactory).%New(webServiceName)
+150 ;; if factory'=$$$NULLOREF {
+151 ;; set proxy=factory.getProxy(webServerName)
+152 ;; set ok=factory.close()
+153 ;; }
+154 ;; quit $get(proxy,$$$NULLOREF)
+155 ;;]]></Implementation>
+156 ;;</Method>
+157 ;;</Class>
+158 ;;</Export>