Forum Discussion
SOAP rewrite
This is apparently a security addition in the SOAP standard and it's not possible to turn this checking off. I think the only way we can possibly get around this would be to rewrite the XML in the HTTP content data matching for 'https://' and rewrite to 'http://'.
My iRule looks like this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri] ] starts_with "/acordmsgsvc/" } {
if { [string first "To>https://" [HTTP::payload]] >= 0 } {
HTTP::payload replace [string first "To>https://" [HTTP::payload]] 16 "To>http://"
}
pool epidev-msgservers-http
p ersist none
}
}
It's not quite as efficient as i'd like as it searches the payload twice, but it doesn't work anyway.
I've tried:
when HTTP_REQUEST {
HTTP::payload replace 1 1 "THIS IS A TEST"
}
But that didn't make any different as far as I could tell, though I don't have a good script on the server to capture what's received unless it's in the SOAP XML standard. I think I also tried this:
when HTTP_REQUEST {
HTTP::collect 1024
}
when HTTP_REQUEST_DATA {
HTTP::payload replace 1 1 "THIS IS A TEST"
}
It's not clear how the HTTP_REQUEST_DATA 'when' statement gets called but I don't think it's being called at the moment.
I tried:
when HTTP_REQUEST_DATA {
if { [string tolower [HTTP::uri] ] starts_with "/acordmsgsvc/" } {
if { [string first "To>https://" [HTTP::payload]] >= 0 } {
HTTP::payload replace [string first "To>https://" [HTTP::payload]] 16 "To>http://"
}
pool epidev-msgservers-http
p ersist none
}
}
But that did even less and didn't even set the pool correctly.
Anyone done this before or point me in the right direction??!
- What you are doing looks correct aside from the offset value in the HTTP::payload replace command
when HTTP_REQUEST { set clen [HTTP::header Content-Length] if { not [info exists clen] or "" eq $clen } { set clen 4096 } HTTP::collect $clen } when HTTP_REQUEST_DATA { set old_content "To>https://" set new_content "To>http://" set len_old_content [string length $old_content] set offset [string first $old_content [HTTP::payload]] if { $offset >= 0 } { log local0. "Found '$old_content' in payload at offset $offset" log local0. "Content Before: [HTTP::payload]" HTTP::payload replace $offset $len_old_content $new_content log local0. "Content After : [HTTP::payload]" } else { log local0. "Didn't find '$old_content' in payload!" log local0. "Payload: [HTTP::payload]" } }
- Jaz_170005
Nimbostratus
Hello, I need to with rewritting the soap request/message by adding an extra tag and replace xmlns:xsd value to it before forward it. is that possible? for example: original msg is : xmlns:xsd="http://service1.mycompany.com/path1">
new msg: xmlns:xsd="http://service2.mycompany.com/path2">
Recent Discussions
Related Content
* 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