Forum Discussion
forward info not redirect it........
I have DEV asking me to setup a irule that Im not sure you can do.
we have requests going to http://www.etc.com/webapi/service.asmx and want me to have http://app.etc.com/service.asmx answer.
simple, listen for "webapi/services.asmx" and HTTP::redirect to http://app.etc.com/service.asmx
BUT
its a service and once the service request is sent the reply is the new URL and service terminates.
Is there a way to have something come in to http://www.etc.com/webapi/service.asmx and pass the request to http://app.etc.com/service.asmx ?
I have a tool, Test client for Windows Communication Foundation services, that Im using to see if it can work.
Thanks for reading.....
8 Replies
- El_Jefe
Nimbostratus
Have a read of this - https://devcentral.f5.com/blogs/us/irule-modifying-the-uri-without-a-redirect.UNDZyHcfh5M
The question is do you want to change the header or not. - What_Lies_Bene1
Cirrostratus
This should do it;when HTTP_REQUEST { Check for 'bad' URI if { [string tolower [HTTP::uri]] equals "/webapi/service.asmx" } { Rewrite 'bad' URI before sending response to server HTTP::uri "/service.asmx" } Check for 'bad' FQDN in HTTP Host header elseif { [string tolower [HTTP::header "Host"]] equals "www.etc.com" } { Replace the header using the 'good' FQDN HTTP::header replace Host "app.etc.com" Stop processing return } } - F5Hopper_28651
Nimbostratus
thanks Steve, that looks to work... Im waiting on DEV to help test. I will keep you posted.
thanks again.
Ryan
- What_Lies_Bene1
Cirrostratus
You're welcome, please do. - F5Hopper_28651
Nimbostratus
ok after messing with my testing client, "that I was using wrong..." I figured out it still isnt working. my client gets me this 404 error and the main site stops working www.etc.com.
---------------------------------------------------------------------------------------------------------------------
Error: Cannot obtain Metadata from https://dev16.www.etc.com/WebAPI/Service.asmx If this is a
Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at
the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error
URI: https://dev16.www.etc.com/Service.asmx
Metadata contains a reference that cannot be resolved: 'https://dev16.www.etc.com/WebAPI/Service.asmx'.
There was no endpoint listening at https://dev16.www.etc.com/WebAPI/Service.asmx
that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.HTTP GET Error URI: https://dev16.www.etc.com/WebAPI/Service.asmx
There was an error downloading 'https://dev16.www.etc.com/WebAPI/Service.asmx'.
The request failed with HTTP status 404: Not Found.
---------------------------------------------------------------------------------------------------------------------
this is a SOAP service not sure if that makes a difference here.
Thanks - What_Lies_Bene1
Cirrostratus
Ahhh. There's probably some URI's in the body data that need changing too. This could get difficult. If there are URI's in the payload we'll need to rewrite those inbound and again outbound; not the easiest thing to do. - F5Hopper_28651
Nimbostratus
yah, Im going to have to have them find another why on this one.
Thanks for the help
- Arie
Altostratus
Can't the DEV rewrite his (ASP.NET) app? That way he would have full control over the session.
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
