Forum Discussion

IT_Xena_18030's avatar
IT_Xena_18030
Icon for Nimbostratus rankNimbostratus
Mar 18, 2008

iRule WSDL response find and replace soap response

Hoping someone has already scripted an iRule like this. We implemented our F5 after all internal APIs were coded.

 

Our challenge. 3rd party Consumer tries to refresh their web service reference

 

-Consumer's system sends a request to https://api.oursite.com/rateservice/rateservice.aspx?wsdl

 

-Load balancer intercepts request and transfers to http://someinternalurl:82/rateService.aspx?wsdl

 

-The .net web service generates a WSDL xml file - which describes the web service to other systems

 

-While generating the WSDL the request address http://someinternalurl:82/rateService.aspx?wsdl is used to generate the element within the WSDL file.

 

-The WSDL file is sent back to the consumer

 

-The consumer uses the element for future communication with the web service

 

-Further communication fails because the address in the is not accessible from the consumers location

 

There are several solutions we may want to look into:

 

irule to rewrite the element

 

 

Suggestions?

 

I am on the track of doing a search and replace for the soap:address location element based on the server response WSDL xml file. Scripting is not my thing, but eager to learn.

4 Replies

  • Why not write the code on the WSDL file to look for a name, rather then an IP address. That way the name can be resolved differently on the internet if that is where the consumers location is. See if you can do this w/o writing an iRULE.

     

     

    /CB

     

     

  • Hi,

     

     

    You should find a lots of example about how to do so in the forum.

     

     

    To do this job, you'll need to use STREAM commands that are used to replace a statement by another statement in the http response.

     

     

    the HTTP::host command will allow you to update the host requested in the request

     

     

    here is the syntax: Click here

     

    Click here

     

     

    Some example:

     

    Click here

     

    Click here

     

    Click here

     

    it would be something like this for the syntax:

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::host] equals "api.oursite.com"} {

     

    HTTP::header replace "Host" "someinternalurl"

     

    }

     

    }

     

     

    when HTTP_RESPONSE {

     

    STREAM::enable

     

    STREAM::expression "@someinternalurl@api.oursite.com@"

     

    }

     

     

    my iRules won't do the job but it's more like a guidedline
  • I ran into this situation before with our content developers. I went down the path of writing an iRULE. It became apparent to me that what I was much simpler and also for support.

     

     

    Just something to think about

     

     

    /CB

     

  • Colin, I am working with the developer and will post the final working solution.