Forum Discussion
iRule STREAM:expression problem
Hello, I try to modify the payload of a HTTP SOAP Request by an iRule. I try to use STREAM::expressions to modify. The first expression works. The second expression works. But a combination of both didn't works, see below. I tried also to implement it in 2 iRules, but only the last iRule in the chain was used.
Any idea ?
HTTP Request: panzer@system 0815
expression1 works: STREAM::expression {@id=.*?>@xmlns:n0="http://osmc.services.osmc.synium.com">@} Result:
expression2 works: STREAM::expression {@:i=@:xsi=@} Result:
a combination of (expression1 + expression2) fails. the expression will cut the message STREAM::expression {@id=.*?>@xmlns:n0="http://osmc.services.osmc.synium.com">@ @:i=@:xsi=@} Result:
3 Replies
- gamm_31377
Nimbostratus
I think there is a problem when uploading XML code ? - kunjan
Nimbostratus
Looks good as in terms of syntax and logic. Able to provide a sample string stream that's failing for you.
- gamm_31377
Nimbostratus
I fixed the bug it was a masquerading problem, but I still get an error: Malformed document Document has no root element
The HTTP Request looks good, but I'm missing the element content-legth. STREAM profile and HTTP_Rechunk are added to the virtual server.
POST /axis/services/OSMCService HTTP/1.1 User-Agent: kSOAP/2.0 SOAPAction: login Content-Type: text/xml Connection: close Host: 172.30.245.13 Accept-Encoding: gzip
panzer@system01*Test!BwAAAAAKVC1Nb2JpbGUgRAEAAAAQU2Ftc3VuZyBHVC1JOTAwMQIAAAAGSkRR MzlFAwAAAAdBbmRyb2lkBAAAAAU0LjIuMgUAAAART3BlblNjYXBlIE1vYmls ZSAGAAAABTcyMzkw0+491754392793 when RULE_INIT { set static::debug 1 } when HTTP_REQUEST { if { [HTTP::header Content-Type] contains "text/xml" } { if {$static::debug}{log local0. "payload before: [HTTP::payload]"} switch -glob [HTTP::uri] { "*OSMCService" {STREAM::expression {@id=.*?OSMCService">@xmlns:n0="http://osmc.services.osmc.synium.com">@ @:i=@:xsi=@ @i:@xsi:@ @:d=@:xsd=@ @d:@xsd:@ @:c=@:soapenc=@ @ c:@ soapenc:@ @:v@:soapenv@ @v:@soapenv:@}} } STREAM::enable } else { STREAM::disable } } when HTTP_RESPONSE { STREAM::disable }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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