How senthilkumarv/purchasesample works
Project Type and Purpose
• This is a Microsoft BizTalk Server sample application that orchestrates a purchase flow.
• It includes message schemas, maps, orchestrations, a WCF service application, and a sample .NET client.
File Structure
• Top-level solution: PurchaseSample.sln
• Key projects / folders:
• PurchaseSchemas: XML schema definitions (.xsd) and generated classes for PurchaseRequest, PurchaseResponse, ErrorSchema.
• PurchaseMaps: BizTalk maps (.btm) to transform between schemas.
• PurchaseOrchestrations: BizTalk orchestrations (.odx) that implement the business process.
• PurchaseExternalServices: WCF-exposed endpoints for external purchase service ports.
• PurchaseServiceApplication: The WCF service host (MakePurchaseService.svc) that receives client calls.
• PurchaseLibrary: Shared .NET code (entities, validators, repository, business helper).
• WcfClient: Sample .NET console client that calls the BizTalk-exposed WCF service.
• DeployScripts: Build scripts for deployment.
• SampleData.sql: Placeholder for any database scripts if needed.
README
• Confirms this is a BizTalk orchestration sample for a purchase flow.
Main Components
a. WCF Client
• Reads .NET proxy under WcfClient/Service References.
• Sends PurchaseRequest via SOAP to the BizTalk WCF endpoint.
b. BizTalk Receive Port / WCF Adapter
• Hosted in PurchaseServiceApplication.
• Exposes MakePurchaseService.svc endpoint.
• Accepts and serializes incoming XML into BizTalk messages (using schemas from PurchaseSchemas).
c. Orchestration Layer
• PurchaseOrchestrations project.
• Implements the ProcessPurchase / PurchaseOrchestration flows.
• Invokes message validations, transformations, business rules.
d. Maps & Pipelines
• PurchaseMaps maps for Request→Orchestration internal format, and Orchestration output→Response.
e. Business Library
• PurchaseLibrary: domain entities (Customer, Product), validators, repository, helpers.
f. External Service Port(s)
• PurchaseExternalServices: a WCF service endpoint(s) representing the back-end fulfillment system.
• Uses schemas in PurchaseExternalServices/App_Data.
g. Data Store (optional)
• If PurchaseRepository uses a database, represent it as a Database component.
h. WCF Return Path
• Orchestration returns PurchaseResponse back out via the BizTalk send port to the client.
Architectural Patterns & Design Principles
• Message-based choreography with BizTalk MessageBox acting as the publish-subscribe broker.
• Separation of concerns:
• Schemas define message contracts
• Maps handle transformations
• Orchestrations coordinate process logic
• Libraries encapsulate business rules & persistence.
• Use of WCF adapters for inbound (receive) and outbound (send) communication.
• Exception handling via the ErrorSchema and ErrorPort messages.
Technologies & Frameworks to Call Out
• BizTalk Server (MessageBox, Orchestrations, Maps, Pipelines).
• WCF (for service contracts & endpoints).
• .NET Class Library (C#) for business logic.
• XML Schema (XSD) for message definitions.
• BTDF or custom DeployScripts for automated deployment.
• SQL Server (if PurchaseRepository persists data).