23
Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

Embed Size (px)

Citation preview

Page 1: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

Importing and Calling Web Services from your CA Plex Applications

Session Code: Lab13Rob Layzell

Page 2: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

— Why do we need it?−A brief history of CA Plex and SOA

−How was this done before Plex r7.0?

— How do we do it?−What can you import?

−How are services represented in the Plex model?

− Calling Web Services

−What gets deployed

— Advanced topics:−Web Services versus WCF Services

− Configuring proxy servers

— Demo, Q&A, Summary

agenda

Page 3: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

why do we need web service import?a brief history of CA Plex and SOA

—Before SOA:−Monolithic Applications−Ridged Business Processes−Functional Duplication−Proprietary Communications−Maintenance Complexity

Tight-coupling between application, services and

platforms

Page 4: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

why do we need web service import?a brief history of CA Plex and SOA

—After SOA:−Modularized Applications−Flexible Business Processes−Functional Reuse−Standardized Communication−Maintenance Simplification

Loose-coupling between application, services and

platforms

??

?

Page 5: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

why do we need web service import?How was this done before CA Plex r7.0?

Method 1: Hand CodingX No model representation

X Manual setup

Flexible

X Can’t maintain easily

X Error prone

Method 2: TransactXML ‘Familiar’ pattern modeling

X Fairly complex setup

Flexible modeling

Easy maintenance

High degree of automation

Page 6: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Anything with a WSDL−SOAP-based Web service−Windows Communication Foundation (WCF) HTTP-based Service

how do we do it?what can we import?

1. Enter WSDL address, press Go2. Review service

details and descriptions

3. Enter service name, press OK

Page 7: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

Query WSDL

Generate Temporary .NE

T Stub Assembly

Import .NET Stub Types into Plex

how do we do it?how are services imported into the Plex model?

Page 8: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

how do we do it?how are services represented in the Plex model?

— Document

— Service Name

— Operation Name

— Input Message

— Output Message

— Package

— Component

— Function

— Input Parameters

— Returns Parameter

Web Service Plex Model Object

Page 9: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Simple parameters−Hold a single, discrete value−Similar to COM Import, these are inherited from standard

field objects−Inherited from fields under System.Value−Unlike COM Import, System.Value fields are created in the

local model

double GetQuote(string symbol)

how do we do it?how are services represented in the Plex model?

Page 10: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Complex parameters−Hold multiple values−Structure defined in WSDL schema elements−Imported as Plex structure fields under Package−‘leaf’ fields are simple data types−Inherited onto input and return parameters

how do we do it?how are services represented in the Plex model?

Page 11: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

QuoteData GetQuoteDetails(string symbol)

<s:complexType name="QuoteData"><s:sequence>

<s:element name="Symbol" type="s:string" /> <s:element name="lastTradeValue" type="s:double" /> <s:element name="lastTradeDate"

type="s:dateTime" /> </s:sequence>

</s:complexType>

how do we do it?how are services represented in the Plex model?

Page 12: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Enumerators−‘Special case’ simple parameters imported as a System.Value.Enum type−Each value imported as using FLD value VAL triples

<s:simpleType name="Currency"><s:enumeration value=“AED" /> <s:enumeration value="AFA" /> <s:enumeration value=“ALL" />

…</s:simpleType>

—Arrays−Any data type can be an array−Array sizes are currently fixed at 64−Change the FLD occurs NBR triple if you are expecting more or less data

how do we do it?how are services represented in the Plex model?

Page 13: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Create an Object Reference Field to access imported Web Service in AD code

—Add field to Local variable group in a function

—Expand field in AD palette to see service operations

how do we do it?calling web services

Page 14: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Use Call statement to call a service operation

—Parameters mapped the same as for other call types

—No need to create object instance using New statement

how do we do it?calling web services

Page 15: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Monitor state of call using Environment<*Call status>

—Check application event log for actual runtime exceptions

—Returns value placed in the Output variable group

how do we do it?calling web services

Page 16: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—ObIn & ObOut classes for each service operation

—Web Service Client Stub assembly for imported service

how do we do it?what gets generated and deployed?

Plex .NET Runtime

PlexApp.dll

TestStockQuote_ObFnc

TestStockQuote_ObIn

TestStockQuote_ObOut

GetStockQuote_ObIn

GetStockQuote_ObOut

StockQuoteWebProxy.dll

StockQuoteServiceGetStockQuote

StockQuote Web ServiceStockQuote Web Service

Page 17: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

how do we do it?what gets deployed?

—Web Service Client Stub generated based on WSDL address

—Address stored in Narrative for imported Package object

—Update address if location of web service changes and then regenerate & build your stub

Page 18: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Can also generate a WCF Proxy assembly for imported service

—Can only be used for remote services that use WCF (e.g. Plex WCF Service Connectors).

advanced topicweb services versus WCF services

Plex .NET Runtime

PlexApp.dll

TestStockQuote_ObFnc

TestStockQuote_ObIn

TestStockQuote_ObOut

GetStockQuote_ObIn

GetStockQuote_ObOut

StockQuoteWebProxy.dll

StockQuoteServiceGetStockQuote

StockQuote Web ServiceStockQuote Web Service

Plex .NET Runtime

PlexApp.dll

TestStockQuote_ObFnc

TestStockQuote_ObIn

TestStockQuote_ObOut

GetStockQuote_ObIn

GetStockQuote_ObOut

StockQuoteWCFProxy.dll

StockQuoteServiceGetStockQuote

StockQuote WCF ServiceStockQuote WCF ServicePlexApp.exe.config<endpoint=IGetStockQuote />

GetStockQuote DataContracts

Page 19: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Unless you have a specific need for a feature in the WCF column; Web Service Client Stub is recommended

—Type of stub generated decided by a Build File option:

[CSharp build]

ServiceWrapperType=Web|Wcf

advanced topicsweb services versus WCF services

Web Service Client Stub WCF Service Client Stub

SOAP 1.1 only Any WCF http-based protocol

“Black box” proxy Proxy has external configuration

Widest platform availability Deepest .NET integration

Page 20: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Some corporate networks use Proxy Servers to facilitate access to the internet

—Configure the proxy server using the <system.net> element in your Plex .NET application configuration file

<system.net><proxy

bypassonlocal = "true" proxyaddress = “http://proxyserver:80"

/></system.net>

— See MSDN <proxy> Element documentation for more details

advanced topicsconfiguring proxy servers

Page 21: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

—Explains the following:−General Web Service Import mechanism−How different data types are represented−Web and WCF Service client deployment

—CA Plex Partner Training Resources:−Lab13 - Importing and Calling Web Services from your CA Plex

Applications

demo

Page 22: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

?

questions?

Page 23: Importing and Calling Web Services from your CA Plex Applications Session Code: Lab13 Rob Layzell

— If you understand the Plex Object Model; you can understand imported Web Services

— If you understand Plex Fields (structure fields, arrays), then you can understand Web Service operation parameters

— If you can troubleshoot the Plex .NET runtime, you can troubleshoot Web Service operation call failures

—Currently only supports .NET runtime (client and server)

—Possible enhancements:−Support other generators (e.g. Java)−Add imported service type triple (PKG service type SYS/Web/WCF)−Support non-http WCF protocols (e.g. TCPIP, named-pipes)

summary