Web Services from your

abnormalobeisanceSecurity

Nov 3, 2013 (3 years and 11 months ago)

81 views

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

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



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

?

?

?

why do we need web service import?

How was this done before CA
Plex

r7.0?

Method 1: Hand Coding

X
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



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
Go

2. Review service
details and
descriptions

3. Enter service name, press
OK

Query WSDL

Generate
Temporary
.NET Stub
Assembly

Import .NET
Stub Types
into
Plex

how do we do it?

h
ow are services imported into the
Plex

model?

how do we do it?

h
ow 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


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?

h
ow are services represented in the
Plex

model?


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?

h
ow are services represented in the
Plex

model?

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?

h
ow are services represented in the
Plex

model?


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?

h
ow are services represented in the
Plex

model?


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?

c
alling web services


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


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


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
StockQuoteService
GetStockQuote
StockQuote Web Service
StockQuote Web Service
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


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 topic

web services versus WCF services

Plex
.
NET Runtime
PlexApp
.
dll
TestStockQuote
_
ObFnc
TestStockQuote
_
ObIn
TestStockQuote
_
ObOut
GetStockQuote
_
ObIn
GetStockQuote
_
ObOut
StockQuoteWebProxy
.
dll
StockQuoteService
GetStockQuote
StockQuote Web Service
StockQuote Web Service
Plex
.
NET Runtime
PlexApp
.
dll
TestStockQuote
_
ObFnc
TestStockQuote
_
ObIn
TestStockQuote
_
ObOut
GetStockQuote
_
ObIn
GetStockQuote
_
ObOut
StockQuoteWCFProxy
.
dll
StockQuoteService
GetStockQuote
StockQuote WCF Service
StockQuote WCF Service
PlexApp
.
exe
.
config
<
endpoint
=
IGetStockQuote
/
>
GetStockQuote
DataContracts





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 topics

web services versus WCF services

Web Service

Client Stub

WCF Service

Client Stub

SOAP 1.1 only

Any WCF http
-
based protocol

“Black box” proxy

Pro硹⁨慳 e硴敲湡氠c潮晩杵fa瑩潮

Wi摥s琠灬p瑦潲洠ov慩a慢楬i瑹

䑥数敳琠⹎䕔.int敧ra瑩潮


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 topics

configuring proxy servers


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

?

questions?


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