2011 m. gruodžio 13 d., antradienis

Pass port as a parameter - What a hell?

"Why on Earth would you need to pass a port as a parameter" one may think. But one may be wrong :)

I have faced some interesting situation when I've decided that passing port as a parameter is much more easier than using dynamic port.

The solution had to cover two totaly the same web services from two different banks. It is really nice, when the whole country has standarts to all their banks (see http://www.fkl.fi). The problem is when you have to use different authentication parameters inside WCF-Custom port, while underlying service remains the same. There are a lot of tricky adapter settings which sometimes should be changed, so I've came up with decision, that it is more conveient to have two configurable ports on the administration console, than trying to cofigure adapter settings on the dynamic send port.

Here is the main orchestration, which have real ports (Port_A and Port_B), which are cofigured using BizTalk Administration Console
Within main orchestration there are logic which decides which port to use. All the buisness logic goes to second orchestration, which is called from the first one. 

As you can see, second orchestration have three parameters: port, input message and output message. Output message parameter should be marked as "Out":
Of cource, the port parameter type should match port type from the main orchestration, and you should pay attetion that communication direction also can be changed from the properties window.

 Below you can see how both of call orchestration shapes are configured inside the main orchestration. Only thing which differs is port configuration.

Komentarų nėra:

Rašyti komentarą