I'm looking to do a transformation (xslt), but struggling to find the function to do what I'm trying.
We have an incoming request, which contains an alias. That alias is defined in DataPower (default domain > Network > Host Alias) as a host alias. What I have working is setting that alias (from the incoming request) as my routing url, the message then gets routed to the correct back end system.
What I want to do now is, when setting the routing url, I want to match the alias to the host alias name held in DataPower (they are both the same), get the matching IP address and then set the routing url to use the IP address.
The bit I'm struggling with is finding the dp function to get an IP address from the host alias, when the name is given.
Is this possible?
HermannSW 2700006U546737 Posts
Re: Replace Host Alias with IP address2012-11-23T08:51:56ZThis is the accepted answer. This is the accepted answer.One question first:
Why do you want to replace the host alias by its IP in a stylesheet?
routing-url may contain an alias -- DataPower will resolve that alias when contacting the backend for you.
Re: Replace Host Alias with IP address2012-11-23T09:52:03ZThis is the accepted answer. This is the accepted answer.
- HermannSW 2700006U54
We think it maybe to do with the host field in the http header being populated with the alias, which cannot be resolved, but I also think resolving the alias and populating the routing url with the ip address will fix the problem.
kenhygh 120000PD1B2288 Posts
Re: Replace Host Alias with IP address2012-11-23T12:23:06ZThis is the accepted answer. This is the accepted answer.
- dp_rb 270003YFAD
This kind of thing can be used across multiple dev/test/prod environments cleanly, you can put into such a table either DNS names or IP addresses, whatever you want.
Re: Replace Host Alias with IP address2012-11-23T15:48:25ZThis is the accepted answer. This is the accepted answer.
- kenhygh 120000PD1B
Thanks for the suggestion, although that solution would work, I'd prefer not to go down that route, considering that the IP address's are already stored in the host alias and I didn't want to have anything duplicated.
swlinn 100000E7QE1398 Posts
Re: Replace Host Alias with IP address2012-11-27T17:13:22ZThis is the accepted answer. This is the accepted answer.
- dp_rb 270003YFAD