Forum Discussion
Oz_Ayd_69699
Nimbostratus
Mar 07, 2007regexp and xml
How do you extract the operation name from a SOAP request (body) using regexp?
In the following request, how do you extract CalcSalary from the XML using regexp?
----- Sample Request Bo...
Mar 08, 2007
Give this a shot:
when HTTP_REQUEST {
set content " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">123"
set matches [regexp -inline {[\r\n ]*<(\w+)} $content]
if { [llength $matches] > 1 } {
$fullMatch = [lindex $matches 0]
$methodName = [lindex $matches 1]
}
}Not foolproof but it should work for the example you've given.
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
