What is the best way to create a new message within a Biztalk Orchestration?

前端 未结 6 748
时光说笑
时光说笑 2020-12-31 23:48

I\'m looking for your best solutions for creating a new message instance based on a pre-defined XSD schema to be used within a Biztalk orchestration.

Extra votes go

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-01 00:50

    xsd.exe /classes /namespace:MyNamespace myschemafile.xsd
    

    You can use this to generate c# classes for a given schema file. The result is a .cs file that you can include in one of your solution projects.

    When using within a "Message Assignment Shape", you can instantiate one of these generated classes, fill out values for all it's properties, then finally assign the Message part to your instance. Biztalk will auto-magically serialize the instance for you. Nice and OO. No need for any fancy xlang stuff.

    I didn't really have much luck with some of the other solutions like loading up a temp XmlDocument with hardcoded XML, or going the whole hog and using the documentSpecification.GetDocSchema().CreateXmlInstance() that others have suggested.

提交回复
热议问题