Forum Discussion

tarakilroy's avatar
tarakilroy
Icon for Nimbostratus rankNimbostratus
Dec 15, 2014

stream irule trouble

I am trying to rewrite a soap wsdl going back to the client and I cant get it working. I have the plain stream profile on the virtual server and a response re-chunk http profile. I am running 11.5.1 HF5.

 

thanks, here is my irule-

 

when HTTP_RESPONSE { log local0. "TARA2" set before "" set after "https://services.dev.myjonline.com/InvAcct/CashPosition/10" log local0. "$before" log local0. "$after" STREAM::expression {@$before@$after@} STREAM::enable }

 

  • When you use the {} like you are in the expression, the variables won't expand. So you're better off trying something like this:

    when HTTP_RESPONSE { 
        log local0. "TARA2" 
        set before "" 
        set after "https://services.dev.myjonline.com/InvAcct/CashPosition/10" 
    
        log local0. "$before"   
        log local0. "$after" 
    
        STREAM::expression "@$before@$after@" 
        STREAM::enable
    }
    
  • Michael, thank you so much for responding.

     

    I changed the }s to "s to no avail. I started with quotes actually but saw a post with }s so thought I would try it. I double checked the syntax of the matching string too, so I am confident that its correct. would the virtual server's config be helpful to see if I've missed anything?

     

    thanks! tara

     

  • Did you add a

    STREAM::disable
    in the HTTP_REQUEST event? You may also need to remove the accept-encoding header if the response is being compressed.
    HTTP::header remove "Accept-Encoding"

  • Or try changing the stream expression to something simple just to test and see if is working at all... Like

    @a@X@@
    .

  • I just added the STREAM::disable to the request. I added HTTP::header remove "Accept-Encoding" to the Response rule. Is that where it should go?

     

    the simple test didn't work either @a@X@.

     

  • The remove header should also be in the request.

    You can also add this to log when a match happens... I think it's the right syntax.

    when STREAM_MATCHED {
        log local0. "[STREAM::match]"
    }
    
  • Decided to setup a redirect on the AZ F5s which would redirect to the xsd wsdl. Since a redirect response was now indeed coming back to the PZ F5s with the Location header containing the wsdl with http; the PZ F5 change from http to https worked correctly. This was just to prove out that the issue was not that we weren’t checking for redirects correctly and that this part of the code I wrote was not the issue. Furthermore, the code for changing any instances of http://$host to in the response payload has also been working.

     

    Realized that it had to be the 200 response payload containing the https xsd wsdl to do the update definition. The code I have has been doing that already. So then I started looking into the soapui options, because I was wondering about how soapui was sending these requests for the update definition.

     

    So I think after some research that what we need to do is to specify to KEEP any SOAP Headers when recreating requests before doing the update definition on interface in soapui (theory is soapui update definition was failing because it wasn’t keeping the required dev-env header in the other irule.

     

    Watch out for the HTTP::is_redirect command not working:

     

    ;) https://support.f5.com/kb/en-us/solutions/public/15000/800/sol15896.html