Question

We have a WCF routing service which (obviously) routes to several WCF services. We use SOAP messaging, and our SOAP headers contain a value for the consumer system to set it's identifier.

How do you test/prove that a particular request is routed to a particular WCF service?

The scenario is: the router is deployed with a particular routing configuration. The router is then updated to include new routes to more services, how do we prove the new requests are being routed correctly and existing routes remain unchanged (i.e. still routing correctly)

One solution we have thought of is to have the response populate the SOAP header with the identifier of the provider service and perform an assertion based on consumer system + request should match the provider system.

Is using SOAP headers the best way?

Was it helpful?

Solution 2

I raised a related question on how to read the Router configuration programmatically.

Currently there is no answer there, but if we do find one, that answer will be part of the answer to this question.

How to programmatically read the current Filter Table on a WCF Router


We went with the solution I proposed in the question as we decided this was the best way.

  • Populate the SOAP header on the response to the call to the provider service, with an identifier.
  • Send a request to the router and perform an assertion on where you expect it to go
  • Match the expected result with the identifier on the soap header value on the response

OTHER TIPS

You can (temporarily) enable message tracing for the routing service. If you log enough info you'll be able to use the Service Trace Viewer to inspect the messages, which should tell you all the details you want to know about the messages, including where each one was routed to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top