Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF routing and service metadata

I'm building a WCF router which needs to act as a proxy for a number of internal web services (WCF and ASMX). The routing part is fairly straight-forward, but I can't understand how the service metadata exchange would work in this solution.

In other words: how would a client obtain metadata for an internal service behind the router? Do I need to manually supply WSDL files to the consumer? Can I somehow setup the router to return the metadata for an appropriate internal service?

Or perhaps my architecture is completely wrong?

like image 936
Ilya Ayzenshtok Avatar asked Nov 03 '12 10:11

Ilya Ayzenshtok


People also ask

What is service metadata in WCF?

WCF services use metadata to describe how to interact with the service's endpoints so that tools, such as Svcutil.exe, can automatically generate client code for accessing the service. Most of the types that make up the WCF metadata infrastructure reside in the System. ServiceModel. Description namespace.

How do I find the metadata of a WCF service?

You can retrieve service metadata using WS-MetadataExchange or HTTP/GET requests by using the ServiceModel Metadata Utility Tool (Svcutil.exe) tool and passing the /target:metadata switch and an address. Svcutil.exe downloads the metadata at the specified address and saves the file to disk.

Which point is capable of routing messages?

The Routing Service provides a generic pluggable SOAP intermediary that is capable of routing messages based on message content. With the Routing Service, you can create complex routing logic that allows you to implement scenarios such as service aggregation, service versioning, priority routing, and multicast routing.


1 Answers

I see 2 options here:

  1. It may be an option to create a "non-transparent" proxy, if you don't want to expose the internal addresses. The advantage is that you can do more than just routing messages (i.e. such proxy may serve as a "security boundary", unwrapping ciphered messages and passing them plain to the internal endpoint). It can also provide an "interoperable level", exposing a WCF service as simple SOAP using same datatypes/message XML structure. The downside is that you'll have to update its code along with the proxied services
  2. You may implement a WSDL rewriter. With it, you can mask the internal service URL on-the-fly - depending on your conditions, a simple string replace may or may not suffice.

Refer to:

  • Message Inspectors
  • IWsdlExportExtension
like image 59
DarkWanderer Avatar answered Oct 24 '22 14:10

DarkWanderer