I did try out the code I mentioned -- it worked with a caveat.
I needed to change:
envelope.Context.Addressing.Via = newAddress;
ISoapOutputChannel channel
= SoapTransport.StaticGetOutputChannel(envelope.Context.Addressing.Destination);
to something like:
envelope.Context.Addressing.Via = newAddress;
ISoapOutputChannel channel
= SoapTransport.StaticGetOutputChannel(new EndpointReference(envelope.Context.Addressing.To.Value, newAddress));
This may not be the best approach, but it does work, and I don't have to clone the soap envelope, which is nice for response time and memory utilization reasons, as I mentioned before. I don't have the code in front of me, so please forgive if something isn't quite right. You should get the general idea. I want to add async sending and correlation of responses, but I need to think through the ramifications a bit. I am also thinking more about the multi-hop routing. I have a need for multi-hop forward-only routing. I don't have to worry about chaining back through the intermediaries. I would like to provide the facility to reply back to the originating systems, but that would be short-circuited, rather than traveling through the intermediaries. Unfortunately, the politics of the design aren't allowing for it. I think it will come back to haunt us a bit, but the world won't end if it does. They'll just have to do the billing by hand when it screws up :)
Comments