Question
· 14 hr ago

Web Gateway/Apache configuration to make SOAP Client Requests?

I am having issues trying to send SOAP requests to a Cloud Based AWS Application that lives outside of our network. 

It is using a Basic Authentication, Key, Certificate Authority and Whitelist for Security. 

If I attempt the connection using wget from the command line I am able to connect,

:>wget --bind-address=10.95.129.245 --server-response https://xxxxxxxxxx/xxxxxxx/services/Mirth
--2025-06-06 15:54:51--  https://xxxxxxx/xxxxxxxx/services/Mirth
wget: /ensemble/.netrc:16: unknown token xxxxxxx
wget: /ensemble/.netrc:16: unknown token xxxxxxxx
Resolving xxxxxxx.com (xxxxxxx)... 34.233.89.102, 54.165.234.62
Connecting to hcis-staging.cbord.com (xxxxxxxx)|xxxxxxx|:443... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Cache-control: no-cache="set-cookie"
  Content-Type: text/html; charset=utf-8
  Date: Fri, 06 Jun 2025 19:54:51 GMT
  Server: nginx
  Set-Cookie: AWSELB=D507B3110AAE4C39FED576EDFCA8C486670B04F18A5E3BBF0AE38321B36B528F14A78096B862E1C523ADEB028C4EB54BB3C1A6750FC29A6832764251160DDA704F73127995;PATH=/
  Set-Cookie: AWSELBCORS=D507B3110AAE4C39FED576EDFCA8C486670B04F18A5E3BBF0AE38321B36B528F14A78096B862E1C523ADEB028C4EB54BB3C1A6750FC29A6832764251160DDA704F73127995;PATH=/;SECURE;SAMESITE=None
  Content-Length: 754
  Connection: keep-alive
Length: 754 [text/html]
Saving to: 'Mirth'
 

 

 

however when I attempt from a Business Operation I am getting....

06/06/2025 15:51:49.8039637 *********************
Output from Web client with SOAP action = http://xxxxxxxx/msg/SendMessage
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
  <SOAP-ENV:Body><SendMessage xmlns="http://xxxxxxxxx/msg/"><key xsi:type="s:string">xxxxxxxxxxxxxxx</key><encodedMessage xsi:type="s:string">xxxx@EnsLib.HL7.Message</encodedMessage></SendMessage></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

06/06/2025 15:51:54.8081368 *********************
Input to Web client with SOAP action = http://xxxxxxx/msg/SendMessage

ERROR #6059: Unable to open TCP/IP socket to server xxxxxxx:443
string**** SOAP client return error. method=SendMessage, action=http://xxxxxxxx/msg/SendMessage
     ERROR #6059: Unable to open TCP/IP socket to server xxxxxxxxxx:443

Within the Business Operation class, I was able to define the Local Interface it should use.

Class osuwmc.Nutrition.OSU.CBORD.Operation.CBORDHL7Port Extends Ens.BusinessOperation [ ProcedureBlock ]
{

Parameter ADAPTER = "EnsLib.SOAP.OutboundAdapter";

Property LocalInterface As %String(MAXLEN = 255);

Parameter SETTINGS = "LocalInterface:Connection:selector?context={Ens.ContextSearch/TCPLocalInterfaces}";

Method OnInit() As %Status
{
 IF '$IsObject(..Adapter.%Client.HttpRequest) {
	set ..Adapter.%Client.HttpRequest = ##class(%Net.HttpRequest).%New()
 }
 set ..Adapter.%Client.HttpRequest.LocalInterface = $ZStrip($P(..LocalInterface,"("),"*W")

	quit $$$OK
}

Method SendMessage(pRequest As osuwmc.Nutrition.OSU.CBORD.Request.SendMessageRequest, Output pResponse As osuwmc.Nutrition.OSU.CBORD.Response.SendMessageResponse) As %Library.Status
{
 Set ..Adapter.WebServiceClientClass = "CBORDHL7WSService.CBORDHL7Por.....

Do I have to do something special with the Web Gateway and Apache Web Service to allow the connection out?

$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT [HealthConnect:7.2.0-1.r1]
Discussion (2)3
Log in or sign up to continue

Set ..Adapter.WebServiceClientClass = "CBORDHL7WSService.CBORDHL7Por.....

If you reset the WebServiceClientClass the ..Adapter.%Client property is recreated and the ..Adapter.%Client.HttpRequest.LocalInterface property you modified in OnInit() in lost.

Set the WebServiceClientClass  in the BO settings from the portal and don't change it from code.

If you REALLY need (do you?) to change the WebServiceClientClass  from code (unlikely since you use a constant string), then when you change it:

Set ..Adapter.WebServiceClientClass = "CBORDHL7WSService.CBORDHL7Por.....
If '$IsObject(..Adapter.%Client.HttpRequest) {
    Set ..Adapter.%Client.HttpRequest = ##class(%Net.HttpRequest).%New()
}
Set ..Adapter.%Client.HttpRequest.LocalInterface = $ZStrip($P(..LocalInterface,"("),"*W")