I have a web application hosted in discountasp.net that consumes a WCF Service deployed at an IIS server located at the company?s server, the network guys allowed me to consume the service from discountasp.net through a firewall in order to reach the server that allocates the WCF Service. A diagram would look like this.</o> </o> </o> </o> </o> I also wanted to use wsHttpBinding to take advantage of its security features, and encrypt sensible information.</o> </o> I get the following error:</o> Exception Details: System.ServiceModel.EndpointNotFoundException: The message with To 'http://<IP>:<Port>/service/WCFService.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.</o> </o> Doing some research I found out that wsHttpBinding uses WS-Addressing standards, and reading about this standard I learned that the SOAP header is enhanced to include tags like ?MessageID?, ?ReplyTo?, ?Action? and ?To?</o> <a:To s:mustUnderstand=?1?>[address]</To> </o> </o> So I?m guessing that, because the client application endpoint specifies the Firewall IP address and Port, and the service replies with its internal network address which is different from the Firewall?s IP, then WS-Addressing fires the above Exception. Which I think it?s a very good security measure, but it?s not quite useful in my scenario.</o> </o> Quoting the WS-Addressing standard submission ?Due to the range of network technologies currently in wide-spread use (e.g.,NAT, DHCP, firewalls),many deployments cannot assign a meaningful global URI to a given endpoint. To allow these ?anonymous? endpoints to initiate message exchange patterns and receive replies, WS-Addressing defines the following well-known URI for use by endpoints that cannot have a stable, resolvable URI.</o>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</o> ?</o> ---</o> HOW can I configure my wsHttpBinding Endpoint to address my Firewall?s IP and to ignore or bypass the address specified in the ?To? WS-Addressing tag in the SOAP message header? Or do I have to change something in my service endpoint configuration?</o> Help and guidance will be much appreciated.</o> Marko. </o> P.S.: While I find any solution to this, I?m using basicHttpBinding with absolutely no problem.</o>
Try adding another serviceendpoint with the same binding and contract, but with the address of your firewall. Aristotle DiscountASP.NET www.DiscountASP.NET
Found it! This addressing 'To' header functionality can be disabled with an attribute that decorates the class that implements the service, this way:
No way! Thanks for sharing that. Technical Evangelist for DiscountASP.NET http://www.iis7test.com/webcasts/ http://weblogs.asp.net/markwisecarver/ http://blogs.windowsclient.net/wisecarver/default.aspx (Microsoft IT Usability http://msitusability.multiply.com/)