Forum Discussion
Saur212_130858
Jul 29, 2013Nimbostratus
Reading SOAP header through iRule
Team, Can anyone help me with configuring an iRule script to read a custom SOAP header in an incoming HTTP service request and make my own decision logic based on the content. I basically need to read...
nitass
Aug 02, 2013Employee
the bigip virtual edition you suggested if i understand correctly needs to install it on a vmware system, correct?yes
I am in need of an emulator or something which i can run on a windows machine (like Win 7) and test my script against? Is that possible. i am not sure but i think someone is able to run it on vmware workstation even it is not officially supported. 🙂
Also if you can suggest how i can traverse through all child elements inside a SOAP header element it will be helpful to get me started since I couldn;t find documentation on traversing through child elements in an incoming soap header. i am not much familiar with xml. anyway, hope this is helpful more or less.
e.g.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::method] eq "POST" }{
set clength 0
if {[HTTP::header exists "Content-Length"] && [HTTP::header Content-Length] <= 1048576}{
set clength [HTTP::header Content-Length]
} else {
set clength 1048576
}
if { [info exists clength] && $clength > 0} {
HTTP::collect $clength
}
}
}
when HTTP_REQUEST_DATA {
set header1 [findstr [HTTP::payload] "mycustomheader1>" 16 "<"]
set header2 [findstr [HTTP::payload] "mycustomheader2>" 16 "<"]
foreach var {header1 header2}{
if {[set $var] == "" }{
set $var
}
}
log local0. "\[HTTP::payload\]: [HTTP::payload]"
log local0. "header1: $header1 header2: $header2"
}
}
[root@ve10:Active] config cat /var/log/ltm
Aug 2 15:15:47 local/tmm info tmm[5139]: Rule myrule : [HTTP::payload]: value1value2
Aug 2 15:15:47 local/tmm info tmm[5139]: Rule myrule : header1: value1 header2: value2
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