posted on Monday, June 27, 2005 9:10 AM by Benjy

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.

 

Comments