none
Contract and Schemas

    Question

  • Hello

    I have a contract in separate <g class="gr_ gr_19 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" data-gr-id="19" id="19">dll</g> (shared between BizTalk app and external service):

        [MessageCon tract]
        [DataContract(Name = "ActionRequestTrigger", Namespace = "http://schemas.datacontract.org/2004/07/Test123.Operations")]
        public class ActionRequestTrigger
        {
            [MessageBodyMember(Order = 0, Namespace = "http://schemas.datacontract.org/2004/07/Test123.Operations")]
            [DataMember]
            public List<Operation> Operations { get; set; }
        }
    
        [MessageContract]
        [DataContract(Name = "Operation", Namespace = "http://schemas.datacontract.org/2004/07/Test123.Domain")]
        public class Operation
        {
                [MessageBodyMember(Order = 0, Namespace = "http://schemas.datacontract.org/2004/07/Test123.Domain")]
                [DataMember]
                public string ActionName { get; set; }
    
                [MessageBodyMember(Order = 1, Namespace = "http://schemas.datacontract.org/2004/07/Test123.Domain")]
                [DataMember]
                public string ActionId { get; set; }        
        }

    I want to use this definition in BizTalk transformation (for example!). What I do now is to generate XML schema using XSD.
    Finally I end up with generating schemas for every contract....

    Are there any best practices so I can depend only on the C# definition in <g class="gr_ gr_437 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="437" id="437">contract</g> from separate <g class="gr_ gr_78 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="78" id="78">dll</g> and use transformation etc? Or how those things are done in BizTalk?

    Friday, May 12, 2017 7:44 AM

All replies

  • Well, what do you mean Contract?  WCF, SOAP, EF?
    Friday, May 12, 2017 1:25 PM
    Moderator
  • The code quoted. It will be delivered as separate signed assembly.
    Friday, May 12, 2017 1:28 PM
  • You can use "Contract First", let the service depend on the schema 
    https://msdn.microsoft.com/en-us/library/hh674270(v=vs.110).aspx

    /Peter

    Saturday, May 13, 2017 9:14 AM
  • So, here's the deal.  BizTalk app really don't play with such Contracts, as you would be WCF Remoting or similar implementations.  The one exception would be a SOAP Service, but really, no one does that anymore.

    So, realistically, with only 2 fields, it's not worth trying to 'reuse' this contract.

    One important point, you biggest consideration is how the external app will communicate with the BizTalk app.  That will be the biggest driver of how the message manifests.

    Saturday, May 13, 2017 4:20 PM
    Moderator