Skip to main content

Difference between Publishing orchestration as wcf service and schema as wcf service

Publishing an orchestration as a WCF Service leads to tight coupling. Whereas publishing schema as a WCF Service achieves loose coupling.

When an orchestration is published as a WCF Service, the data (message) received via the WCF Service will be directly bound the Orchestration which is published.

On the other hand when a schema is published as a WCF Service, the data (BizTalk message) received via the WCF Service will be published to the BizTalk Server Message Box and hence any number of subscribers can subscribe for the message.
When we expose an orchestration as a WCF service, it means we should execute the orchestration by calling the WCF service from client with the parameter message payload same as what the orchestration receive shape expects. The message payload is received by message box first and the subscribing orchestration instance then gets fired and the 'processing' takes place very much similar to what happens inside the method of a WCF service which is decorated with [OperationContract] attribute.
·          
Now when a schema is exposed as a WCF service, it gives rise to a very loosely coupled pattern. Here only the schema is coupled, which is the contract of the 'contract first' approach. Here no 'processing' like orchestration is yet defined, which means, any orchestration can subscribe to the message payload received from the message box, when the WCF service is called by client. Here the loose coupling comes from the fact that we can simply make any, just any orchestration to subscribe to that message. Whereas, while you expose an orchestration as WCF service, you essentially mean to use that orchestration alone, a tighter coupling scenario.
Now the thing is after you expose certain schemas as WCF service, then when you add reference to the .svc file from your client application then appropriate proxy classes are created in the wsdl wherein all the types you declared are already available. This also happens when you consume the WCF service from another orchestration by saying "Add Generated Items --> Consume WCF service" eventually going through the WCF service consuming wizard. The types with appropriate namespaces would be automatically available to you and you need to populate the objects from your client code and call the service by submitting the payload

Comments

  1. Hi Ashok, I am new to BizTalk.
    I have an assignment to consume WCF from BizTalk Orchestration.
    The actual requirement is to wrap WCF into BizTalk.
    There is no change in input/output parameters.
    So I successfully consumed WCF into BizTalk Orchestration.
    I followed below steps:
    1. Used WCF Consume Wizard & Added artifacts
    2. Created 4-messages (Biz-Input, Biz-Output, WCF-Input, WCF-Output)
    3. For Biz-Input/WCF-Input, I used reqest message from Multi-part, generated by Wizard
    4. For Biz-Output, WCF-Output, I used response message from Multi-part, generated by Wizard
    5. I even used construct message before & after call WCF in Orchestration for converting Biz-Input to WCF-Input & WCF-Output to Biz-Output
    6. Build & Deployed Successfully.
    7. Configured on BizTalk Administration Console Successfully.
    8. I can added the URL into SOAP UI and it got loaded as well.
    The issue is Request message is not displaying the parameters.
    Could you please help me out here...

    ReplyDelete

Post a Comment

Popular posts from this blog

WCF MaxReceivedMessageSize max value in .config

MaxReceivedMessageSize parameter in binding config   file:   For max file size in WCF, we need to set following parameter in binding files. <binding name="MyService"        maxReceivedMessageSize="2147483647"        maxBufferSize="2147483647" transferMode="Streamed" >        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> <!-- other binding info here, such as security --> </binding> Max possible size: MaxReceivedMessageSize to 2147483647 (i.e. Int32.MaxValue), which is 2GB For our case, as we are using WsHttpBinding. <wsHttpBinding>         <binding name="wsHttpBindingSettings" maxReceivedMessageSize="2147483647">           <readerQuotas maxDepth="2147483647" maxStringContentLength

biztalk schema remove ns0 prefix

We can remove ns0 prefix simply by set the schema elements property or both elements and attributes properties to be qualified. To do that follow my steps: 1-       Open your schema 2-       Right Click <Schema> and select properties 3-       Use schema property editior and Set [Element FromDefult] to Unqualified , and then set [Attribute FromDefault] to Unqualified if you are using attributes in your schema. After applying the steps above, both XML instances below will be valid: Instance 1 (with ns0) < ns0:Root xmlns:ns0 = " http://RandomBizTalkProject.Schema1 " >   < Field1 > Field1_0 </ Field1 >   < Field2 > Field2_0 </ Field2 > </ ns0:Root > Instance 2 (without ns0) < Root xmlns = " http://RandomBizTalkProject.Schema1 " >   < Field1 > Field1_0 </ Field1 >   < Field2 > Field2_0 </ Field2 > </ Root >

Object Oriented Programming Concepts

OOP Basics Visual Basic was Object-Based, Visual Basic .NET is Object-Oriented , which means that it's a true Object-Oriented Programming Language . Visual Basic .NET supports all the key OOP features like Polymorphism , Inheritance , Abstraction and Encapsulation. It's worth having a brief overview of OOP before starting OOP with VB. Why Object Oriented approach? A major factor in the invention of Object-Oriented approach is to remove some of the flaws encountered with the procedural approach. In OOP, data is treated as a critical element and does not allow it to flow freely. It bounds data closely to the functions that operate on it and protects it from accidental modification from outside functions. OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. A major advantage of OOP is code reusability. Some important features of Object Oriented programming are as follows: Emphasis on