Reverse Proxy of WCF services?

Jul 19, 2010 at 9:13 PM
Has anyone got reverse proxy of WCF services to work?  For me, calls are making it to the proxied service but are failing with the following exception:

System.ServiceModel.EndpointNotFoundException: The message with To 'http://localhost/TestService/bin' cannot be processed at the receiver,
due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.

I've gone over the existing forum posts on getting the reverse proxy of WCF services working and I've managed to get the calls through to the server, but there's still something not quite right.

The ManagedFusion.Rewriter.txt contains the following proxy pattern:

RewriteRule ^/(.*)$          http://<machinename>:8081/$1 [P]


Here is the SOAP request as captured by Fiddler.  The "a:To" SOAP header needs to be rewritten to match the proxied address.  How can I do this?


<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://tempuri.org/ITestWCFService/Query</a:Action>
<a:MessageID>urn:uuid:7a563798-bb5d-46cc-bd8d-6f588c8824eb</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">http://ipv4.fiddler/TestWCFService</a:To>
</s:Header>
<s:Body>
<Query xmlns="http://tempuri.org/">
<request xmlns:b="http://schemas.datacontract.org/2010/07/TestWCFService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:Echo>Hello</b:Echo>
</request>
</Query>
</s:Body>
</s:Envelope>