Forum Discussion

dwwatk01_25473's avatar
dwwatk01_25473
Icon for Nimbostratus rankNimbostratus
Nov 10, 2009

Web Service WSDL Rewrite

Hi!

 

 

I've read a few other threads describing similar problems, but cannot make those solutions work for our situation.

 

 

Here's what we have: a user is hitting a web service through F5 to our internal app servers. The user hits F5 via http, then is routed via https to the app servers. What is happening is that in the payload of the web service wsdl, xsd locations are being written as follows:

 

 

https://ourDNS:443/xsdURI

 

 

when what it needs to be is:

 

 

http://ourDNS/xsdURI

 

 

Can this be accomplished with an iRule? Is there an easier way to go about this?

 

 

Please let me know if any clarification is needed.

 

 

Thanks!

 

David

1 Reply

  • Hi David,

    If you want to rewrite content in the HTTP response payload, you can use a blank stream profile and STREAM::expression iRule. The iRule would look something like this:

     
      From: http://devcentral.f5.com/wiki/default.aspx/iRules/stream__expression 
     when HTTP_RESPONSE { 
      
         Disable the stream filter by default 
        STREAM::disable 
      
         Check if response type is text 
        if {[HTTP::header value Content-Type] contains "text"}{ 
      
            Replace https://ourDNS:443/xsdURI with http://ourDNS/xsdURI 
           STREAM::expression "@https://ourDNS:443/xsdURI@http://ourDNS/xsdURI@" 
      
            Enable the stream filter for this response only 
           STREAM::enable 
        } 
     } 
     

    Some additional notes:

    If any part of the string to search for has periods (https://ourDNS.example.com:443/xsdURI), you should escape them with a backslash (https://ourDNS\.example\.com:443/xsdURI).

    If the server compresses responses, you should either disable compression on the server or add an HTTP_REQUEST event to remove the Accept-Encoding header to prevent server compression.

    If the find/replace strings are of different length, you should create a custom HTTP profile with chunking set to rechunk and add it to the VIP so the Content-Length header will not be included in responses (with an incorrect value).

    Aaron