From 340eb35cbb537770dc0108cdc40543dbb2d2fa0d Mon Sep 17 00:00:00 2001 From: Nick Coblentz Date: Tue, 16 Apr 2024 08:41:14 -0500 Subject: [PATCH] Custom Column for SOAPMethods --- CustomColumn/Proxy/HTTP/SOAPMethod.bambda | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CustomColumn/Proxy/HTTP/SOAPMethod.bambda diff --git a/CustomColumn/Proxy/HTTP/SOAPMethod.bambda b/CustomColumn/Proxy/HTTP/SOAPMethod.bambda new file mode 100644 index 0000000..c927153 --- /dev/null +++ b/CustomColumn/Proxy/HTTP/SOAPMethod.bambda @@ -0,0 +1,26 @@ +/** + * Extracts the Method and an example value from a SOAP Request + * @author Nick Coblentz (https://github.com/ncoblentz) + * + * Currently extracts the soap method and the WS-Security Username field's value. + * Assumes the body tag's namespace is "s" as in `([^<]+)|<(?:[a-zA-Z0-9]+:)*Body[^>]*><([^ ]+)",Pattern.CASE_INSENSITIVE).matcher(requestResponse.request().bodyToString()); + while(m.find() && m.groupCount()>0) { + for(int i=1;i<=m.groupCount();i++) { + if(m.group(i)!=null) + builder.append(m.group(i)+" "); + } + } + return builder.toString(); + } +} +return "";