biztalkbiztalk-2010biztalk-orchestrationsbiztalk-wcf

Calling a web/wcf service from orchestration: adding a generated item vs adding service reference


If I want to call a web service or wcf method from an orchestration, I can do it by either adding a service reference to the project or adding a generated item. What is the advantage of either approach - is there a best practice?


Solution

  • Steef -Jan Wiggers answers a similar question here

    TL;DR - Always use the Generated Items wizard.

    My 10c - Although the .xsd files imported by Add Service is added as a schema and set to BtsCompile, there are some limitations such as:

    Using the Add Generated Items wizard does extra work for you:

    One thing I would recommend with the Wizard, is to create a folder for the WCF reference and always import all the artifacts into the folder (i.e. don't do the usual separation of Schemas from Ports and leave the dummy .odx there as well). This way, if you need to regenerate the items, just delete everything in the folder and start again (sadly, the wizard doesn't have a Update Service Reference equivalent.

    Also note that if you do move the generated Schemas and Port Types into a separate assembly, that you will need to change the type modifier access to Public (it is internal by default)