1146 connectivity & integration for .net environments (ibm impact 2014)

68
© 2014 IBM Corporation 1146: Connectivity & Integration for .NET Environments Matthew Golby-Kirk, IBM UK Tony W. Robinson, PNC

Upload: matt-lucas

Post on 08-Jun-2015

533 views

Category:

Technology


10 download

DESCRIPTION

Presentation from IBM Impact 2014. It is simple to integrate IBM Integration Bus with .NET applications. Come along and find out how to run your .NET assemblies natively inside IIB to provide fast access to your data and broker facilities in any of the languages supported by the V4 CLR (e.g. C#, VB.NET, F#). See how easy it can be to build transformation nodes in Microsoft Visual Studio and integrate Microsoft Dynamics or other .NET applications directly from within your integrations. If you're an existing user of this technology, come and find out the latest enhancements to this key feature of IBM Integration Bus.

TRANSCRIPT

Page 1: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2014 IBM Corporation

1146: Connectivity &

Integration for .NET

EnvironmentsMatthew Golby-Kirk, IBM UK

Tony W. Robinson, PNC

Page 2: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

Please Note

IBM’s statements regarding its plans, directions, and intent are subject to change

or withdrawal without notice at IBM’s sole discretion.

Information regarding potential future products is intended to outline our general

product direction and it should not be relied on in making a purchasing decision.

The information mentioned regarding potential future products is not a

commitment, promise, or legal obligation to deliver any material, code or

functionality. Information about potential future products may not be incorporated

into any contract. The development, release, and timing of any future features or

functionality described for our products remains at our sole discretion.

Performance is based on measurements and projections using standard IBM

benchmarks in a controlled environment. The actual throughput or performance

that any user will experience will vary depending upon many factors, including

considerations such as the amount of multiprogramming in the user’s job stream,

the I/O configuration, the storage configuration, and the workload processed.

Therefore, no assurance can be given that an individual user will achieve results

similar to those stated here.

Page 3: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

IBM Integration Bus This Week – Selected Sessions

Monday

• 2.30-3.30 Palazzo H – Integration Featured Session

• 4.00-5.00 Palazzo H – What's New in IIB

• 5.15-6.15 Palazzo H – Introduction to IIB

Tuesday

• 10.30-11.30 Palazzo H – Cloud Integration Options

• 10.30-11.30 San Polo 3502 – Meet The Experts

• 1.00-2.00 Palazzo H – WESB Conversion

• 1.00-2.00 Marcello 4403 – IIB Retail Integration Pack

• 1.00-3.15 Murano 3303 – IIB V9 Lab

• 2.15-3.15 Palazzo H – Designing for Performance

• 3.45-4.45 Palazzo H – Mobile Integration

• 5.00-6.00 Palazzo H – DFDL Introduction

• 5.00-6.00 Marcello 4402 – Manufacturing in IIB

3

Page 4: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

IBM Integration Bus This Week – Selected Sessions

Wednesday

• 10.30-11.30 Palazzo H – .NET Integration

• 1.00-2.00 Palazzo H – Effective Application Development

• 1.00-2.00 Marcello 4403 – IIB Healthcare Integration Pack

• 1.00-2.00 San Polo 3503 – Meet The Experts (Repeat)

• 2.15-3.15 Palazzo H – Effective Administration

• 3.45-4.45 Palazzo H – Applications, Libraries, APIs

• 3.45-6.00 Murano 3303 – IIB Open Beta Lab

• 5.00-6.00 Palazzo H – Transformation Options in IIB

Thursday

• 9.00-10.00 Palazzo H – Predictive Analytics

• 10.30-11.30 Palazzo H – BPM Integration

• 1.00-2.00 Palazzo H – Modelling Industry Formats

• 2.15-3.15 Palazzo H – What's New in IIB (Repeat)

4

Page 5: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation5

Agenda

� IIB Overview

� Why .NET?

� .NET Overview

– Framework and CLR

� Integration with WMB and IIB

– .NET Input node

– .NET Compute node

� Visual Studio Integration

– Plugins

– Debugging

� The Plugin API

– Navigation and Tree access

� Integrating .Net and COM applications

� ESQL Calling .NET

� Hosting the CLR

� Summary

� Tony W. Robinson, PNC

� Removing Hurdles:

Exploiting .Net and Interoperating with IIB 9

Agenda for Part 2

Page 6: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation6

Why .NET?

� Many clients have a large investment in Microsoft, .NET and related technologies

– Dynamics for CRM / ERP

– SharePoint for collaboration

– Visual Studio for development

– Custom .NET applications

� .NET is very widely used - 1.8 billion active installs of .NET . [//build/ 2014]

� .NET is a very popular environment for developers.

– TIOBE Programming Community Index for June 2011. [www.tiobe.com]

– IIB now provides transformation capability for all of the top 6 languages

Language Access and Transform

Java JavaCompute Node

C C Plugin Node

C++ C Plugin Node

C# .NET Compute Node

PHP PHPCompute Node

VB .NET Compute Node

Page 7: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

.NET Framework Overview

7

Operating System

Visu

al S

tud

io T

oo

ls

Garbage

Collector

Garbage

Collector

Exception

HandlingSecurity Loader

Profiling &

Debugging

JIT &

NGEN

JIT &

NGENCommon Language Runtime

Base Class Library

ADO

.NET DLR WCF LINQ

ASP

.NET

Win

FormsWPF

Common Language Specification

Many other 3rd

party optionsJScript

C++/

CLIF#

VB

.NETC#

Threading

Page 8: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

The .NET Common Language Runtime (CLR)

8

Garbage

Collector

Garbage

Collector

Exception

HandlingSecurity Loader

Profiling &

Debugging

JIT &

NGEN

JIT &

NGENCommon Language Runtime

� The CLR provides an environment inside which “managed” code is executed

� Similar to a JVM

� Can be hosted inside another process

� Gives the ability to run managed code

� SQLServer does this to run managed Stored Procedures

� Provides key services to all code running inside it

� Loading, GC, Debugging, Threading, Exception Handling, JIT, etc.

Operating System

Threading

Page 9: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation9

From Source Code to Byte Code

� All .NET code is compiled from the source language into Managed “CIL” (MSIL) code

� Common Type System (CTS) and Common Language Spec (CLS)

� The CIL code lives in a .DLL or .EXE and is called an Assembly

– The Assembly is loaded into the CLR to be executed

– Code is “JITted” before it is executed

• Can be JITted before hand with NGEN

� At runtime the CLR does not care what the source language wasCIL

VB

C#F#

Common Language Specification

40+ Others...JScriptC++/

CLIF#

VB

.NETC#

Page 10: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation10

A short history of .NET in IIB

� Write .NET code and associate it with the .NETCompute

� Call .NET code from an ESQL Compute node

� .NETCompute node sample

� Mobile Enable .NET Assemblies

– Expose .NET Assemblies as Mobile Services using a simple pattern

� Deploy .NET Assemblies in the BAR file

� Microsoft Dynamics Patterns

– Patterns to integrate SAP, File, MQ and HTTP to Microsoft Dynamics CRM

� MSMQ Sample Provided

– MSMQ -> MQ

– MQ -> MSMQ

� User Properties on .NETInput and .NETCompute nodes

– Allows easy configuration

� .NET Input Nodes can be cloned with a customised icon and properties.

– These settings are saved for you in a node representation

– Allows distribution of the node to other teams

WMBv8.0.0.0

WMBv8.0.0.1

IIBv9

Page 11: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� Extremely tight language agnostic integration

– Integrates any CLR language (V4 and V4.5) at a very low level

� Create your own .NET Input nodes using Visual Studio

– Start flows from .NET data sources (MSMQ etc)

– Use an event or polling style

� Create your own .NET Compute nodes using Visual Studio

– Integrate new or existing .NET applications directly with your Message Flow

• Write nodes in C#, VB, F#, C++/CLI, and many more

� Tightly integrated with Visual Studio

– Integration toolkit can launch Visual Studio

– Visual studio plugin to simplify node development

� Call .NET code directly from ESQL

– Jump straight from ESQL into .NET code

� Integrate with existing COM applications

11

Integrating .NET with WMB and Integration Bus

Page 12: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Integrating .NET with WMB and Integration Bus 2

� Mobile Enable .NET Assemblies

– Expose .NET Assemblies as Mobile Services using a simple pattern

� Microsoft Dynamics Patterns

– Patterns to integrate SAP, File, MQ and HTTP to Microsoft Dynamics CRM

� MSMQ Sample Provided

– MSMQ -> MQ

– MQ -> MSMQ

� User Properties on .NET Input and Compute nodes

– Allows easy configuration

� .NET Nodes can be “templated” with customised icon

– Allows distribution of the node to other teams

� Deploy .NET Assemblies in the BAR file

12

Page 13: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation13

Managing .NET Integration

� Fine grained operation control

– Configurable Service, Resource Stats

� The CLR is hosted inside each Execution Group

– One CLR per E.G.

� Each CLR is split into different App Domains

– Provided as unit of scoping

– Choose which .NET App Domain your code runs in

Page 14: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� Microsoft .NET is supported on the Windows platform

� .NET functionality is available in all editions of Integration Bus (Express, Standard,

Advanced, etc)

� Existing connectivity options give flexible deployment options

– You can position .NET in the “middle” as part of your core infrastructure

– You can position .NET at the “edge” and connect to your main infrastructure

– Use any IIB transport option to make the links

• WebService, MQ, JMS, etc

Running .NET in your Enterprise

14

Page 15: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� First Class Input node

– Very straightforward to configure

� Write your Input node in any CLR compliant language

– Build transformations in: C#, VB, F#, C++/CLI, Jscript, etcO

� Allows you to start a flow directly from .NET code

– Two Visual Studio code “templates” to get you started

• Polling Style

• Event Style

� Simply return a byte array to IIB for auto hand off to the built in parsers

– DFDL, XMLNSC, JSON, etc

– Or choose to construct the tree yourself

� Dynamic Output Terminals

– As many as you need

� MSMQ Input sample provided

– MSMQ -> MQ and vice versa

15

.NET Input Node – Start it up!

Page 16: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� First Class transformation node

– similar to JavaCompute

� Write your transformations in any CLR compliant language

– Build transformations in: C#, VB, F#, C++/CLI, Jscript, etcO

� Allows you to integrate your .NET code directly with your Flow

– Three code “templates” to get you started

• Filter Message

• Modify Message

• Create Message

� Implement a single method “Evaluate”

– Stub is auto implemented in Visual Studio

� Provides full access to the Message Trees

– Message,

– LocalEnvironment,

– Environment,

– ExceptionList

� Dynamic Output Terminals

– As many as you need

16

.NET Compute Node - What do you want to integrate today?

Page 17: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation17

.NET Compute Node Configuration

� Browse to choose Assembly

� Drag / Drop an assembly on the node to configure

Page 18: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Launch Visual Studio directly from the .NET Compute node

� Simply double-click on the node

- Or right click “Open Microsoft Visual Studio”

Page 19: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation19

Visual Studio 2010 and 2012 Integration

� Visual Studio is the “toolkit” when developing .NET assemblies

– Visual Studio is the “industry standard” for .NET development

– Use any version – “Express” through to “Ultimate”

� Tight integration with the WMB and IIB runtime

– “Double Click” on a .NETCompute Node to launch Visual Studio

– Node can be configured with a “Solution” to launch automatically

� Plugin for Visual Studio to generate skeleton .NET Input code

– Specific to the language choice and the node type (Event driven or Polling driven)

� Plugin for Visual Studio to generate skeleton .NET Compute code

– Specific to the language choice and the node type (Filter / Modify / Create)

� Use Visual Studio debugger to debug your .NET assemblies.

– “Attach” the debugger to the runtime “dataflowengine.exe” process for the E.G.

• See all the message trees in their entirety.

Page 20: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Speed up development with the Visual Studio Node Templates

20

Page 21: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Auto generated node templates for Visual Studio

21

Page 22: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

The Visual Studio Object Browser

22

� Use the Object browser to view the.NET APIs provided

Page 23: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation23

Page 24: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Visual Studio Content Assist for the Plugin API

24

Page 25: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Debug your .NET code with the Visual Studio Debugger

25

Page 26: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� The API is designed to look and feel like a standard .NET API

– Follows the Microsoft “Framework Design Guidelines”

– For example, uses properties where appropriate, follows naming conventions etc

� Is designed to be usable by as many .NET languages as possible

– Plugin assembly is marked as ‘CLSCompliant’.

– CLS guidelines followed

– Where facilities that are not CLS compliant are used, alternatives are offered

• E.g. Alternatives for explicit datatype casting

� Scalar values and Nullable value types supported throughout

– All IIB types are “Nullable”

– Conversions to/from Nullable equivalents available

� Simple but Powerful

– Utility methods provided for common tasks, such as throwing user exceptions,

– creating XMLDecl’s etc [<?xml version="1.0" encoding="UTF-8" standalone="yes"?>]

NBParsers.XMLNSC.CreateXmlDeclaration( element, "1.0", "utf-8", "yes" );

Programming with the .NET APIs

26

Page 27: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� Navigation by name is also possible

NBElement amount = root["XMLNSC"]["Money"]["Amount"];

� Navigation by name and namespace as well

string ns = new string("http://my.long.namespace");

NBElement amount = root["XMLNSC"][ns, "Money"][ns, "Amount"];

� Still have to be careful:

– NullReferenceException still possible

27

Message Broker Tree : Access by Name

XML Message<ns:Money xmlns:ns="http://my.long.namespace">

<ns:Currency>USD</ns:Currency><ns:Amount>5000.00</ns:Amount>

</ns:Money>

Root

... XMLNSC

ns:Money

ns:Currency ns:Amount

USD 5000.00’

Page 28: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� Allows easy integration with WCF, COM and .NET applications

– Access existing COM and .NET applications that run in a .NET 4 or 4.5 environment

� .NET makes it easy to call other .NET applications and components

//Call WCF Service with details from Message

private void UpdateService(NBElement customer)

{

MyWcfServiceClient client = new MyWcfServiceClient();

// Use the 'client' variable to call operations on the service.

client.SetData((string)customer[“Name"]);

// Always close the client.

client.Close();

}

28

Integration breadth: Call WCF and custom .NET applications

Page 29: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

� WMB and IIB exceptions turned into NBExceptions which can be caught in .NET code

– NBException

• NBRecoverableException

NBUserException

NBXxxException

� NBExceptions are turned into WMB or IIB exceptions if thrown from user .NET code

– You can “leave” your .NET code with an exception if necessary.

– You can catch the exception by using in a Try/Catch node or wiring a Catch terminal.

– NBRecoverable exceptions can be caught in an ESQL handler, with a specified

SQLCode and SQLState

� .NET exceptions are turned into WMB or IIB exceptions if thrown from user .NET code

– You can catch the exception by using in a Try/Catch node or wiring a Catch terminal

29

Handle Exceptions with Ease

Page 30: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation30

Hosting the CLR in the Execution Group

� A CLR is hosted inside each Server on Windows

– V4.5 CLR. If the .NET code is supported running in the .NET 4.5 CLR then you can run it

in Broker.

� The CLR is started automatically if found when the Server starts

– Not an error if it is not found

– But .NET code cannot run without it.

� CLR statistics available to show memory usage, Garbage collections etc.

Page 31: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation31

Application Domains in .NET : 1

� All code executed in the CLR runs inside an App Domain

– A default App Domain created by the CLR

– Extra App Domains can be created by user code

– Code can be shared between App Domains if it is loaded “domain neutral”

� An App Domain provides a scoping point

– A sub-process unit of isolation for managed code

• For unload / reload of code

• For sharing of data

Domain 1

Shared “neutral” Domain Default Domain

Domain 2

Assembly1.dll

Assembly2.dll

Shared data

Assembly1.dll

Assembly3.dll

Shared data

mscoree.dll

Process 1

Page 32: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation32

Application Domains in .NET : 2

� Only whole App Domains can be unloaded

– Not possible to unload a single Assembly

– Not possible to unload “domain neutral” assemblies

� Sharing Data between assemblies

– Code sharing an app domain can share state

– Cross App Domain data sharing requires “remoting” of the data to be shared

Domain 1

Shared “neutral” Domain Default Domain

Assembly1.dll

Assembly2.dll

Shared data

mscoree.dll

Process 1

Page 33: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation33

Application Domains in the Broker : 1

� App Domains provide the unit of scoping for all .NET code

� App Domains have several properties

– A name and a “base directory” where the code in that AppDomain lives

– An optional configuration file

• Provides extra information to code running in that domain

� App Domains can be created by name

– If unnamed a domain will be named after the broker Application the flow is a part of

� App Domains can also be created by a Configurable Service

– Specify App Domain properties

� App Domains allow the “hot swap” of a .NET assembly with “Shadow Copy”

� Flow will dynamically reload associated App Domains if the code is changed.

� Speed up development time

� App Domains provide statistics about their memory usage

Page 34: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Application Domains in the Broker : 2

34

ESQL

Shared “Neutral” Domain Default Domain

DotNetFlow

CLR inside the Execution Group

LibraryAssembly.dll

IBM.Broker.Plugin.dll

Shared data

NodeAssembly.dll

IBM.Broker.Plugin.dll

Shared data

IBM.Broker.Support.dll

DotNetFlow

ExecutionGroup1

Page 35: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

“Hot Swap” Your .NET Code

1: Build your assembly in Visual Studio

2: .NET Compute Node points to the assembly on disk

– Deployed as part of a flow

3: Test flow

4: Rebuild in Visual Studio after changes

5: Re-test flow

– No re-deploy / restart needed

35

“Rebuild”

Page 36: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Example: Creating a new account in Dynamics CRM

Sending a request in

Page 37: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Getting a response back

Example: Creating a new account in Dynamics CRM

Page 38: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

© 2013 IBM Corporation

Summary

� Very tight .NET Integration

– CLR (v4 or v4.5) hosted inside the Execution Group

– .NET code executed natively

– Use any CLR language to create your nodes

– Integrated App Domain support

� Large API to provide access to integration facilities

– Navigation

– Element creation

– Exception handling

• From .NET exception to ExceptionList

• From ExceptionList to .NET exception

• Catch exceptions in ESQL

� Strong Visual Studio Integration

– Launch Visual Studio from the Integration Toolkit

– Plugins to provide fast node creation

– Content assist for easy access to the API

– Debug your nodes using Visual Studio

38

Page 39: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

Part 2:

Tony W. Robinson

Manager, Application Services Delivery,

PNC

Page 40: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

40

Removing Hurdles: Exploiting .Net and Interoperating with

IBM Integration Bus v.9

Tony W. RobinsonManager, Application Services Delivery

Integration PlatformsPNC

Page 41: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

41

What are we up to?

In the time I have, let me tell you about…

• PNC as a whole

• Service Orchestration, Applications Services at PNC

• Our plans with IBM Integration Bus v.9

• Challenges and opportunities we’ve encountered while exploring IBM Integration Bus v.9

– Why .Net support in IIBv9 matters

– A simple POC

…Then, after the talk, I’m available for questions and/or demo

Page 42: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

42

About PNC

Facts about PNC … from pnc.com/factsheets

• Retail Banking

– 2,700 branches in 19 states and the District of Columbia

– 7,400 ATMs

– 6.6 million checking account customers

– www.pnc.com

• Asset Management, Corporate & Institutional Banking, Residential Mortgage Bankingand BlackRock

• $320 billion in assets

• $221 billion in deposits

• 54,400 employees

Page 43: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

43

Service Orchestration, Application Services

What do we provide? In a word (or two):

Shared Platforms

• Have been called “Common Technology Assets” and “Business Accelerators” in the past

• Now we provide “Application Services”

– Engineered to be used by multiple customers across the lines of business

– Saves each of the I.S. teams aligned with a specific LOB from having to choose vendors, stand up infrastructure, manage licensing, etc.

– Helps ensure conformity to reference architectures, best practices and standards

• Some of our shared platforms

– Integration

– Business Process Management

– Business Rules

• Development work done in java, .Net and other languages

– Content Management

– Collaboration

– Mobility

Page 44: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

44

Delivery of Integration Platforms

The team I manage delivers multiple platforms:

• WebSphere ESB

• WebSphere Message Broker (v.7)

• IBM Integration Bus v.9

• Microsoft BizTalk

• We are moving from v.7 to v.9 and will eventually consolidate to one IBM platform

Why should .Net teams care?

What can they do with the platform?

Page 45: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

45

Our Proof of Concept

Demonstrate how to…

• Start Server-Side and Client-Side Development at the same time, working from the same WSDL

• Easily invoke web services hosted on IIBv9 from a .Net, Windows Communication Foundation (WCF) Client

• Modify messages inside an IIBv9 messageflow using transformation code writtenin a .Net language in Visual Studio (usually C#, sometimes VB)

• Debug both the IIBv9 message flow and the .Net code at the same time, as a flow executes inside IIBv9

Page 46: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

46

Our Proof of Concept

The “Hurdle Processing” service

• Hurdles go in, none come out!

• Send in a Request with one to many hurdle elements

• Receive a Response with the hurdle elements removed

Page 47: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

47

Start from the same WSDL

Use a common WSDL generation tool…

• Bring the WSDL into each development environment

– As the basis for a Message Model in IIBv9

– As the basis for a .Net proxy class created using SVCUtil utility

• Can instead “Add Service Reference” in Visual Studio if you prefer

– Requires a live endpoint with support for ?wsdl enabled (checkbox)

Page 48: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

48

Start from the same WSDL

Observations and recommendations

• Choose Unique names

– Assign distinct names to the service and all the ports, bindings, operations, complex types, elements, parts, etc.

– Makes it easier to tell things apart

– Definitely choose your own unique namespace

• Beware of subtle differences in the ways in which the tools generate XML that conforms to the WSDL

– Operation name vs. class name as root element

– SOAP UI will tolerate a lot that IIBv9 or .Net, WCF will not

• Note, if your WSDL has an embedded schema

– Wizard in IIBV9 will extract it to a separate file

– May make .Net proxy creation simpler

• Expect Broker & SVCUtil to complain if your WSDL has issues

Page 49: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

49

Quick Steps

One quick way to turn your WSDL into a service hosted on IIBv9:

• Create an empty application

• Create a Message Model (Click New, Message Model)

– SOAP XML

– I already have a WSDL for my data

– Select your WSDL file, wherever it is, add it to the application

– Select bindings

– Build (if Eclipse didn’t automatically)

• Create a Message Flow (Click New, Message Flow)

– Just give it a name, you start with a blank flow

• Drag and Drop your WSDL onto the white space in the flow

– Expose message flow as web service

– SOAP Nodes

Page 50: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

50

Quick Steps

Your new flow contains an obvious place to wire in your .Net Compute Node:

• First Node Receives the SOAP Message

• Second Node is a Subflow that removesthe SOAP envelope

• Third Node sends the response

Page 51: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

51

Quick Steps

Alternatively: Drag a SOAP Input Node onto the flow

– And drag your WSDL onto that node

– Better approach if you need to work with the contents of the SOAP message as a whole

Page 52: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

52

Message Transformation

When finished, the flow will look like this:

To get there, you start with a template in Visual Studio

• Modify an IBMIntegration Message

• Different typesof input nodes

• Other templatesfor creating orfiltering

Page 53: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

53

Message Transformation

Matthew has done the work for us!

• ModifyNode class is wired up right out of the box

• “Add user code in this region to modify the message”

• Your Challenge: Learn to navigate the message tree

Page 54: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

54

Message Transformation

In the Transformation section of Palette in IIBv9, there is a .Net Compute node

• Drag a .Net Compute node onto your flow– Wire it up, out to in, out to in

– Only one property to set

• Even Easier: Drag your .Net assembly onto the flow– Broker uses reflection to find the class inside

– Auto-populates all the necessary properties

Page 55: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

55

Consume the Service from .Net

SVCUtil.exe generates code and configuration

• Run from Visual Studio Developer Command Prompt

– See documentation regarding command line switches

• Generated proxy class includes interface with all the necessary attributes

– Class can be added directly to another project, or

– Class can be built into its own assembly and referenced from other project

Page 56: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

56

Consume the Service from .Net

Add key references to your project…

• System.Runtime.Serialization

• System.Runtime.ServiceModel

Update your application configuration file…

• Copy System.ServiceModel section from generated configuration file to App.configof your client application

Page 57: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

57

Consume the Service from .Net

Some things to keep in mind

• We encountered a “silent failure” in our first attempts

– Though the client received and logged a response in the trace file, the response was not deserialized successfully, so our response was null

– No exception was thrown (uuuugh)

• WCF Trace Logging and Message Inspectors can let you see the XML that’s going out and coming back in

– IClientMessageInspector interface contains BeforeSendRequest and AfterReceiveReply methods

• The root element on the request may be different than what is required as the root element on the response

– WCF uses (and broker accepts) the operation name as the name of the root element on the request

• The root element on the response must have the same name as the complex type that defines it in your schema & WSDL

Page 58: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

58

Debugging

Fortunately, there is excellent debugging available

• In Integration Toolkit

– Launch the debugger on the Execution Group

– Right-Click the flow in the IDE

– Click Test Message Flow

• Add Breakpoints to the flow to inspect the state of variables along the way

Page 59: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

59

Debugging

Fortunately, there is excellent debugging available

• In Visual Studio

– Debug Menu, Attach to Process…

– Attach to DataFlowEngine.exe (there will be one instance per Execution Group)

– Use Integration Explorer to find the process ID of the execution group in which your code is running

Page 60: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

60

Debugging

You can limit what code is debugged

• In the Attach to Process dialog

– Click Select button next to “Attach to:” drop-down list

– Specify the target framework for your .Net assembly

– IIBv9, written in C++, also has debug symbols

Page 61: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

61

Debugging

Visual Studio shows you when you’ve properly attached to DataFlowEngine.exe

• The look of the breakpoint is different

– before you’ve attached, after you’ve attached, and when the breakpoint is hit

Page 62: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

62

Debugging

Many Options

• Launch the Debugger on the Execution Group in Integration Toolkit & Run Test Using toolkit test harness

• Attach the Visual Studio debugger to DataFlowEngine.exe and run toolkit test harness

– To debug modification code without involving the .Net client

• Debug both .Net client & .Net modification code at the same time

– Debug your client and attach debugger to DataFlowEngine.exe before sending your request

• Debug EVERYTHING at the same time

– Launch the debugger on the Execution Group in Integration Toolkit with breakpoints in your flow

– Debug your client and attach Visual Studio debugger to DataFlowEngine.exe before sending request.

– Watch as your dev box bounces back and forth between IDE’s

Page 63: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

63

Summary

Interoperability Works!

• Common WSDL as a starting point

• Wizards and Templates

– Easy ways to stand up your service on IIBv9

– Easy ways to create .Net assemblies that can run inside IIBv9

– Easy ways to generate a proxy and consume the service

• Powerful debugging tools

– Run the whole process from beginning to end

– Set breakpoints anywhere along the way

• Either side can serve as client or server

– Our POC illustrates only one use case

Success!!!

Page 64: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

64

Contact Information & Questions?

Feel free to contact me

Tony W. [email protected]

http://www.linkedin.com/pub/tony-w-robinson/4/b86/323

Page 65: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

Questions?

Page 66: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

We Value Your Feedback

Don’t forget to submit your Impact session and speaker

feedback! Your feedback is very important to us – we use it to

continually improve the conference.

Use the Conference Mobile App or the online Agenda Builder to

quickly submit your survey

• Navigate to “Surveys” to see a view of surveys for sessions

you’ve attended

66

Page 67: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

Thank You

Page 68: 1146 Connectivity & Integration for .NET Environments (IBM IMPACT 2014)

Legal Disclaimer

• © IBM Corporation 2014. All Rights Reserved.

• The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained

in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are

subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing

contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and

conditions of the applicable license agreement governing the use of IBM software.

• References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or

capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to

future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by

you will result in any specific sales, revenue growth or other results.

• Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will

experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage

configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

• All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs

and performance characteristics may vary by customer.

• Lotus® Sametime® Unyte™). Subsequent references can drop “IBM” but should include the proper branding (e.g., Lotus Sametime Gateway, or WebSphere Application Server).

Please refer to http://www.ibm.com/legal/copytrade.shtml for guidance on which trademarks require the ® or ™ symbol. Do not use abbreviations for IBM product names in your

presentation. All product names must be used as adjectives rather than nouns. Please list all of the trademarks that you use in your presentation as follows; delete any not included in

your presentation. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International

Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.

• Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

• Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.

Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and

other countries.

• UNIX is a registered trademark of The Open Group in the United States and other countries.

• Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of

others.