From 53da3dbd813213c853dd289fdc2bc609f9a1cda0 Mon Sep 17 00:00:00 2001 From: Pastrana Date: Wed, 22 May 2024 10:34:21 -0400 Subject: [PATCH] HPCC4J-604 Suppress EclWatch redirects - Appends rawxml param to all axis2 client calls Signed-off-by: Pastrana --- .../java/org/hpccsystems/ws/client/BaseHPCCWsClient.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java b/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java index 2a856a5a2..c26f75ce4 100644 --- a/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java +++ b/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java @@ -561,7 +561,7 @@ protected Integer getStubConnectionTO() throws AxisFault final static UsernamePasswordCredentials emptyCreds = new UsernamePasswordCredentials("", null); /** - * Sets the stub options defaults preemptiveauth to 'true; + * Sets the stub options defaults preemptiveauth to 'true'; * * @param thestub * The Axis generated service stub @@ -573,7 +573,12 @@ protected Integer getStubConnectionTO() throws AxisFault */ static public Stub setStubOptions(Stub thestub, Connection connection) throws AxisFault { + //Add "rawxml_" query param to request ESP to suppress any default redirects Options opt = thestub._getServiceClient().getOptions(); + EndpointReference toRef = opt.getTo(); + String toAddress = toRef.getAddress() + (toRef.getAddress().contains("?") ? "&" : "?") + "rawxml_"; + toRef.setAddress(toAddress); + opt.setTo(toRef); opt.setProperty(HTTPConstants.SO_TIMEOUT, connection.getSocketTimeoutMilli()); opt.setProperty(HTTPConstants.CONNECTION_TIMEOUT, connection.getConnectTimeoutMilli());