+ All Categories
Home > Documents > with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk...

with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk...

Date post: 31-Mar-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
27
A Quick Start to A Quick Start to Developing Applications Developing Applications with with Biztalk Biztalk and VS.NET and VS.NET Scott Matsumoto Scott Matsumoto Chief Technical Officer Chief Technical Officer Xtremesoft, Inc. Xtremesoft, Inc.
Transcript
Page 1: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

A Quick Start to A Quick Start to Developing Applications Developing Applications with with BiztalkBiztalk and VS.NETand VS.NET

Scott MatsumotoScott MatsumotoChief Technical OfficerChief Technical OfficerXtremesoft, Inc.Xtremesoft, Inc.

Page 2: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

2Bizet and VS.Net QuickStart

Is Is BizetBizet a Requirement?a Requirement?

nn Officially Officially -- “Yes”“Yes”nn CoCo--installation is supported only on installation is supported only on BizetBizet

nn Anecdotal evidence from the field says “No”Anecdotal evidence from the field says “No”nn The MCS demo CD has BTS 2000 and VS.NETThe MCS demo CD has BTS 2000 and VS.NET

nn Anecdotal evidence from the field says “Yes”Anecdotal evidence from the field says “Yes”

nn Your mileage may varyYour mileage may vary

Page 3: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

3Bizet and VS.Net QuickStart

Known IssuesKnown Issues

nn BTS Tracking Application fails because of “.BTS Tracking Application fails because of “.vbvb” ” mapping in IISmapping in IISnn Solution: Change Solution: Change connection.vbconnection.vb to to connection.vbsconnection.vbs

and fix all references in and fix all references in vbscriptsvbscripts\\

nn Orchestrations Don’t Compile (Orchestrations Don’t Compile (readme.htmreadme.htm))nn Solution: ToolsSolution: Tools\\OptionsOptions\\DebuggingDebugging\\JustJust--InIn--Time Time

and disable JIT debugging for “scripts”and disable JIT debugging for “scripts”

Page 4: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

4Bizet and VS.Net QuickStart

I Know, It’s Only I Know, It’s Only InteropInterop, , But I Like ItBut I Like It

BizTalkBizTalknn Classic COM Classic COM

Programming APIsProgramming APIs

VS.NetVS.Netnn CLR CLR –– Managed CodeManaged Code

How do you spell R-C- W?

Page 5: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

End of Formal Presentation

Questions?Questions?

Page 6: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

6Bizet and VS.Net QuickStart

Who Who InteropsInterops with Whom?with Whom?

BizTalkBizTalknn COM Client COM Client InteropInteropnn Messaging CallingMessaging Calling

nn AICAICnn Custom PreCustom Pre--ProcessorProcessor

nn Orchestration CallingOrchestration Callingnn COM Component StencilCOM Component Stencil

.Net Framework.Net Frameworknn COM Server COM Server InteropInteropnn Call into MessagingCall into Messaging

nn Document SubmissionDocument Submissionnn AdminAdmin

nn Call into OrchestrationCall into Orchestrationnn Starting an OrchestrationStarting an Orchestration

Page 7: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

7Bizet and VS.Net QuickStart

Scenario 1: Adding New Capabilities Scenario 1: Adding New Capabilities to an Existing Applicationto an Existing Application

nn You tell your boss You tell your boss -- “It’s just Visual Studio 7”“It’s just Visual Studio 7”

nn Write or rewrite BTM integration components Write or rewrite BTM integration components using VB (enhanced) or C#using VB (enhanced) or C#

nn Main difference is to build in use of Enterprise Main difference is to build in use of Enterprise Services (COM+)Services (COM+)

Page 8: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

8Bizet and VS.Net QuickStart

Okay Okay –– So, It’s a CCW So, It’s a CCW IPipelineComponent

DemoCSAICs.SimpleAIC

Page 9: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

9Bizet and VS.Net QuickStart

AIC SkeltonAIC Skeltonusing using System.EnterpriseServicesSystem.EnterpriseServices; ; using using System.Runtime.InteropServicesSystem.Runtime.InteropServices;;

using using Interop.MSCSCoreLibInterop.MSCSCoreLib;;using using Interop.PipeCompLibInterop.PipeCompLib;;

namespace namespace DemoCSAICsDemoCSAICs{{

[Guid(“11220B3A[Guid(“11220B3A--205B205B--3C8D3C8D--8AB58AB5--21ABD1397624")]21ABD1397624")]public class public class SimpleAICSimpleAIC : : ServicedComponentServicedComponent, , IPipelineComponentIPipelineComponent, …, …{{

intint IPipelineComponent.ExecuteIPipelineComponent.Execute(…)(…)

Runs as a configured component

Imported Commerce Server Core Components TypeLib

Imported Commerce Server Pipeline Component TypeLib

Page 10: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

10Bizet and VS.Net QuickStart

Why Use Enterprise ServicesWhy Use Enterprise Services

nn Maximizes your flexibility for Maximizes your flexibility for inprocinproc vsvs outout--ofof--proc activationproc activationnn Tradeoff speed and fault isolationTradeoff speed and fault isolationnn Raw, configured components are almost as fast as Raw, configured components are almost as fast as

classic COMclassic COM

nn .Net requires the support for services to be .Net requires the support for services to be compiled incompiled in

Page 11: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

11Bizet and VS.Net QuickStart

Assembly InformationAssembly Information

nn Use the Assembly to specific COM+ Use the Assembly to specific COM+ Application parametersApplication parameters

nn Use Use regsvcsregsvcs to register (create) the COM+ to register (create) the COM+ Application and componentsApplication and components

[assembly: [assembly: AssemblyDelaySign(falseAssemblyDelaySign(false)])][assembly: [assembly: AssemblyKeyFile(@"..AssemblyKeyFile(@"..\\....\\AICSign.snkAICSign.snk")]")][assembly: [assembly: AssemblyKeyNameAssemblyKeyName("")]("")]

[assembly: [assembly: ApplicationName("InteropingAICsApplicationName("InteropingAICs")]")][assembly: ApplicationID(“F5FDEC23[assembly: ApplicationID(“F5FDEC23--4A124A12--6D846D84--71647164--23145ECF526B")]23145ECF526B")][assembly: [assembly: Description(“CDescription(“C# Pipeline Component # Pipeline Component AICsAICs")]")]

COM+ requires strong naming

COM+ Setup Information

Page 12: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

12Bizet and VS.Net QuickStart

One Fine One Fine LookinLookin’ COM+ App’ COM+ App

Page 13: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

13Bizet and VS.Net QuickStart

Usage in BTMUsage in BTM

Page 14: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

14Bizet and VS.Net QuickStart

GotchasGotchas

nn Be wary of Be wary of inetinfoinetinfonn it likes to hold on to your component it likes to hold on to your component dllsdlls (for the (for the

property pages) after you add them to BizTalkproperty pages) after you add them to BizTalk

nn COM Implemented CategoriesCOM Implemented Categoriesnn AICsAICs just workjust worknn PreProcessorPreProcessor components must be “dinked”components must be “dinked”

Page 15: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

15Bizet and VS.Net QuickStart

Calling A Web Service from Calling A Web Service from OrchestrationOrchestration

Assembly

using System.EnterpriseServices;using System.Runtime.InteropServices;

class CallWS : ServicedComponent

DocSubmission ds = new DocSubmission();

ds.InvokeSked( "sked:///foo.skx" );

DocSubmission.CS

WSFlange.CS

Page 16: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

16Bizet and VS.Net QuickStart

Scenario 2: Implementing the Front Scenario 2: Implementing the Front End Using ASP.NETEnd Using ASP.NET

nn You tell your boss You tell your boss –– “We’ll get better Web site “We’ll get better Web site performance” (the upgrade line didn’t work)performance” (the upgrade line didn’t work)

nn You’ve finally decided that You’ve finally decided that VARIANTsVARIANTs are evilare evil

nn You want all the benefits of Early BindingYou want all the benefits of Early Binding

Page 17: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

17Bizet and VS.Net QuickStart

This Is A True RCWThis Is A True RCW

Page 18: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

18Bizet and VS.Net QuickStart

Import the Import the TypeLibTypeLib Into the .NET Into the .NET AssembyAssemby

nn VS.NETVS.NETnn From the From the ProjectProject menu, select menu, select ReferencesReferences. . nn Select the Select the COMCOM tab. tab. nn Select the type library from the Select the type library from the Available Available

ReferencesReferences list, or browse for the TLB file. list, or browse for the TLB file.

nn Type Library Importer Type Library Importer nn c:c:\\>>tlbimptlbimp csiapi.tlbcsiapi.tlbnn Type library imported to Type library imported to BTSInterchangeLib.dllBTSInterchangeLib.dll

Page 19: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

19Bizet and VS.Net QuickStart

ASP.NET ExampleASP.NET Exampleusing using BTSInterchangeLibBTSInterchangeLib;;……

public string public string SubmitSync(BIZTALK_OPENNESS_TYPESubmitSync(BIZTALK_OPENNESS_TYPE …)…){{

Interchange Interchange interchangeinterchange = new = new InterchangeClassInterchangeClass();();trytry{{

interchange.SubmitSyncinterchange.SubmitSync(…);(…);}}catch (Exception e)catch (Exception e)}}finallyfinally{{

Marshal.ReleaseComObject(interchangeMarshal.ReleaseComObject(interchange););}}

Invoke BizTalk Invoke BizTalk Interchange RCW Interchange RCW SubmitSyncSubmitSync methodmethod

CoCICoCI BizTalkBizTalk

pUnkpUnk-->Release();>Release();

Page 20: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

20Bizet and VS.Net QuickStart

Just Below the SurfaceJust Below the Surface

nn BizTalkConfigBizTalkConfig objects return late bound ADO objects return late bound ADO record setsrecord sets

nn IDL for the COM IDL for the COM TypelibTypelib::

interface interface IBizTalkConfigIBizTalkConfig : : IDispatchIDispatch {{……[id(0x00000008), [id(0x00000008), propgetpropget, , helpstring("Returnshelpstring("Returns a set of messaging port objects.")]a set of messaging port objects.")]

HRESULT HRESULT Ports([outPorts([out, , retvalretval] ] IDispatchIDispatch** ** ppPortsDispppPortsDisp););

Page 21: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

21Bizet and VS.Net QuickStart

Converting An ADO Converting An ADO RecordSetRecordSet to an to an ADO.NET ADO.NET DataSetDataSet

BTSObjectModelLib.BizTalkConfigBTSObjectModelLib.BizTalkConfig configconfig;;ADODB._RecordsetADODB._Recordset adoRSadoRS;;OleDbDataAdapterOleDbDataAdapter oledboledb;;

DataSetDataSet ports = new ports = new DataSetDataSet();();configconfig = new = new BTSObjectModelLib.BizTalkConfigClassBTSObjectModelLib.BizTalkConfigClass();();trytry{{

oledboledb = new = new OleDbDataAdapterOleDbDataAdapter();();adoRSadoRS = (= (ADODB._Recordset)BTConfig.PortsADODB._Recordset)BTConfig.Ports;;oledb.Fill(portsoledb.Fill(ports, , adoRSadoRS, “Ports");, “Ports");

}}catch(Exceptioncatch(Exception e)e){{

……}}finallyfinally{{

Marshal.ReleaseComObject(configMarshal.ReleaseComObject(config););}}

The returned data setThe returned data set

Make a copyMake a copy

QI for the ADO QI for the ADO Record Set from BTSRecord Set from BTS

Page 22: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

22Bizet and VS.Net QuickStart

Working With OrchestrationsWorking With Orchestrations

nn Need to do the equivalent of Need to do the equivalent of CoGetObjectCoGetObject and and QueryInterfaceQueryInterface for the XLANG objectsfor the XLANG objects

nn TypeLibsTypeLibsnn SYSMGRLibSYSMGRLib –– SkedsMgr.dllSkedsMgr.dllnn COMRUNTIME COMRUNTIME –– SkedCore.dllSkedCore.dll

Page 23: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

23Bizet and VS.Net QuickStart

Sample Sample SkedSkedNo Instantiation component reference

Page 24: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

24Bizet and VS.Net QuickStart

Activating A Activating A SkedSked (Simple)(Simple)Object Object skedsked = null;= null;

skedsked = = Marshal.BindToMoniker(skedMonikerMarshal.BindToMoniker(skedMoniker););skedTypeskedType = = sked.GetTypesked.GetType();();

COMRUNTIME.IWFWorkflowInstanceCOMRUNTIME.IWFWorkflowInstance pSchedulepSchedule = = ((COMRUNTIME.IWFWorkflowInstanceCOMRUNTIME.IWFWorkflowInstance) ) skedsked;;

Object Object ActionPortActionPort = = pSchedule.get_PortpSchedule.get_Port( "( "AXSObjectPortAXSObjectPort" );" );ABT…ABT…Lib.IABTAlertNumActSkedsSkedLib.IABTAlertNumActSkedsSked piSkedpiSked = =

(ABT…(ABT…Lib.IABTAlertNumActSkedsSkedLib.IABTAlertNumActSkedsSked) ) ActionPortActionPort;;

piSked.SetObjectReferencepiSked.SetObjectReference(…);(…);

CoGetObjectCoGetObject of the of the skedsked monikermoniker

QI for the QI for the skedskedinstanceinstance

Get the initial Get the initial SkedSked Port Port and QI for the interface and QI for the interface it implementsit implements

Pass in the initial valuesPass in the initial values

Page 25: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

25Bizet and VS.Net QuickStart

Implementing A Web Service Using Implementing A Web Service Using BizetBizet

nn We just did itWe just did it

nn Doing Business Transactions (Loosely Coupled, Doing Business Transactions (Loosely Coupled, Correlated Web Services Requests) is another Correlated Web Services Requests) is another topictopic

Page 26: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

26Bizet and VS.Net QuickStart

Help Is ComingHelp Is Coming

nn Don’t ask me for my sample codeDon’t ask me for my sample code

nn Toolkit containing samples and helper classes Toolkit containing samples and helper classes from Microsoftfrom Microsoft

nn ETA ETA –– Sometime next weekSometime next week

nn Bug Mike Bug Mike –– not menot me

Page 27: with Biztalk - Xtremesoft · 2012-09-09 · A Quick Start to Developing Applications with Biztalk and VS.NET Scott Matsumoto Chief Technical Officer Xtremesoft, Inc.

End of Formal Presentation

Questions?Questions?


Recommended