0
votes

I'm a beginner to BT and am using VS.net 2013 BizTalk project template to construct an orchestration to call a stored procedure.

I am trying to use a Construct Message Component to initiate a Message which I've defined in the Orchestration. The Type of the message was generated by the designer when I added a Configured Port using WCF-SQL and represents the input parameters for my stored procedure.

When I try to compile my Orchestration it gives the message an "object reference, method parameter or return value may not have an XSD-based type" indicating that my Message Assignment is incorrect. I can understand the error, but don't know what to do about it.

The Assignment Expression is

GetVersionInputSchema = new IS_Schema_ERMC.ERMC_dbo.usp_IntegrationServiceChangeTracking_GetVersion();

which is the Type assigned by the designer to the parameters property of the Multi-part Message Type which represents the stored procedure call.

Could anyone give me an idea why (a) I cannot Assign a new message based on a XSD Schema, and (b) what I can do about the problem. I think I must Assign my Message before I can use it to pass to my Port (I get a pretty obvious error message if I don't) but it seems I'm not allowed to Assign my Message using the Assignment Component. What gives ?

1

1 Answers

1
votes

There are a few ways to construct a message in an orchestration. They all have to be done in a Construct Message block.

  1. You could use a Transform shape to map from a source to destination message. If your SP call is based on data from a received message, this may be the way to go - especially if there's lots of data to feed to the SP from that inbound message.
  2. Using an XmlDocument. Make your "GetVersionInputSchema" message be of type System.Xml.XmlDocument (under .NET classes). Then, in a MessageAssignment shape, have code like this:

    GetVersionInputSchema = new System.Xml.XmlDocument(); GetVersionInputSchema.LoadXml("");

  3. Create a custom class that inherits from BTXMessage, instantiate that class, add a body part, call the .Load() or .LoadFrom() methods - this is more advanced and involved.

There's some more details here: http://blogs.msdn.com/b/paolos/archive/2009/09/10/4-different-ways-to-process-an-xlangmessage-within-an-helper-component-invoked-by-an-orchestration.aspx

I'd note that if you use method 2, you should really use a .NET helper class - have it either return an XmlDocument or at least have it contain the string template (and call System.String.Format in the Orchestration expression).