Monday, June 27, 2005 - Posts

BTS Diary 3 - Now to tame Enterprise Library

Solving the Web Service communication issue: Thanks to a great post from Matt Meleski on passing complex messages to web services, we sorted the problem with communicating between the Orch and the WS. Basically we were very close. I sort of knew we werent doing the correct thing by assigning the WS request message directly with the Target Data message and that we should be dealing with variable assignation instead. As it turns out, I was right. We first have to load the incoming message (or the transformed one, whichever you want) into an XmlDocument variable. Then if you are using the XmlDocument as a parameter in the webservice, you can simply assign the web service parameter to the .OuterXml of the variable. Matt gives more examples of using strings as web service arguments as well as complex types as arguments.

But cannot handle EnterpriseLibrary.Data: Looking through Andy Morrisons blog on using Ent Lib Logging Block was fine and useful, but it does not address the beast that happens to be lurking in the new DAAB. The event log always says that it failed to load the assembly even though its clearly marked in the BTSNTSVC.exe.config. Actually the problem is in the dataConfiguration.config file since the BTSNTSVC file points to this and it would appear that BTS is able to go to the dataConfiguration file but just cannot read the config section properly. The funny thing is that on its own, the new DAAB and the web service work fine (when tested using NUnit) but when called from BizTalk they start acting funny.

Weird huh? We're going to give it just one more shot tomorrow for a couple of hours and then we'll scrap Ent Lib completely. Will keep you folks posted.

with 0 Comments

BTS Diary 2 - When Schema equivalence is not enough

The requirement: Convert schemas of type A1, A2 etc (various diff forms) into a common schema, B and then load the message into a custom database.

In my previous post  I explained that we finally got the data load component working. Next we were asked to re-factor it so that the loading could be done through a web service. That started another round of hair loss. We created a web service interface for the data loader and created a method called ImportData taking a class corresponding to schema B (generated by XSD.exe). Now when we added the web reference, it created a WebService_Request message and a WebService_response message.

In the transform, we had already created schema B, so one would think its easy to pass it to the WS since after all they are the same thing arent they?. Thats where we fell down. We put in a message assignment shape to assign WS_Request to the Target_Msg created earlier, but it wouldnt let us assign or cast it. We couldnt simply send the WS_request because, obviously it hadnt been assigned. In fact it wouldnt even compile and said that the request message was not initialised and couldnt be used.

To work around this we thought we could construct a new message of type WS_Request and at least MAP the Target_Message to WS_Request (although the mapping is redundant since the schemas are identical). We created the map, but in the Transform shape where we indicate the map and the source and destination, the destination drop down simply refused to pick up the WS_Request. I wonder if it is a namespace issue.

So that left us stymied. Without the web service life is difficult because we are using Enterprise Library in the data loader and all attempts to set up Ent Lib to work with BizTalk (including using BTSNTSVC.exe.config) have failed. The system always complains that it cannot find the needed configuration section. At least with the web service we can use the web.config so that Ent Lib does not complain.

Anyway, the plan now is to (a) get rid of enterprise library and either use the old DAAB or write our own and (b) to remove the redundant Target_Message mapping and try to construct a message of type WS_Request directly (assuming it will appear in the Transform drop down). Might also look at the PUBLISH SCHEMA AS WEB SERVICE option to see if that helps.

Does anyone have any ideas on why the ws_request doesnt appear in the Transform drop down. Would appreciate any feedback.

 

with 0 Comments