Universal Linker - 1.7


Compatibility: v2 v3 Express
What's new? Release Notes
ID: com.castsoftware.wbslinker

Description

The “Universal Linker” (com.castsoftware.wbslinker) extension is a “dependent” extension that automatically creates links for “web services” between client and server components by following a particular protocol based on objects and names. The extension can be downloaded on its own as a standalone extension, however, it is usually automatically downloaded as a dependency with other extensions.

For example for the AngularJS extension:

Application to Application dependencies scope

The information generated by the extension is also used in CAST Imaging for the “Application to Application dependencies scope” - see the “Where do the links come from” section in the documentation for CAST Imaging V3 and the documentation for V2).

How does it do it?

End-users do not need to interact or configure the Universal Linker extension, all configuration is automatic.

The cross-layer linking model

Whatever the underlying protocol - HTTP/REST, SOAP, a message queue, a remote procedure call, or a cloud-native trigger - the Universal Linker always resolves a cross-layer call the same way:

  • Origin: a technology-specific analyzer (AngularJS, Spring, Node.js,.NET, RabbitMQ, AWS, Azure, CICS, IMS, …) creates an intermediate"call"/“service exit” object at the point where a request, message, or transaction leaves Layer A.
  • Execution: on Layer B, the same or a different technology-specific analyzer creates the object representing where the request is actually serviced - a REST/SOAP operation, a queue receiver, a Lambda or Function, a CICS transaction, an IMS PCB, and so on.
  • Peer evaluation: the Universal Linker loads both populations ofobjects and evaluates which ones are compatible peers, using contextual and sometimes dynamic matching keys - name, URI, queue name, topic, routing/binding key, protocol identifier, exchange type, or position (for example a PCB position for IMS) - normalizing them first when needed (REST URI transformation, name lower-casing, environment-variable resolution for cloud resources only known through Infrastructure-as-Code, and so on).
  • Peer linking: once compatible peers are identified, the extension creates a callLink (or, for data access, an accessReadLink / accessWriteLink) between the origin and execution objects, so the dependency appears end-to-end in CAST Imaging regardless of the technologies, languages, or layers involved:

This model is the same whether Layer A and Layer B are two microservices communicating over REST, a producer and a consumer of a message queue, or a mainframe program invoking a CICS transaction.

The Universal Linker supports several communication modes:

  • SOAP/REST Protocol
    • REST services
    • WSDL/SOAP services
    • Intra-layers
      • Bean (EL expressions)
      • Servlet
      • Razor to MVC Controller Action (.NET)
  • Messaging Protocol
    • RabbitMQ
    • ActiveMQ
    • IBM MQ
    • MSMQ
    • AWS SQS, SNS, Kinesis, Data Firehose
    • Azure Event Hub, Service Bus, SignalR
    • GCP Pub/Sub
  • Executable Call
    • Program Call
      • Shell script
      • Cobol Program
      • RPG IV Program
      • RPG III Program
      • CL IV Program
      • Assembler Program
      • Rexx Program
      • PLI/PLC MainProcedure
      • Java Application
    • Java Method Call
    • C/C++ Function Call
    • Commands running SQL script
  • Remote Code Execution
    • gRPC
    • Generic RPC
    • Direct Web Remoting (DWR)
    • WebSockets
    • Mainframe Transaction Processing
      • CICS (Transaction, Map, Dataset, Transient Data Queue)
      • IMS (DL/I PCB calls, CHNG Transaction switch)
  • Serverless
    • AWS Lambda
    • Azure Functions / WebJobs

SOAP/REST Protocol

REST services

The connection is made via the following “root” objects:

Icon Description
HTTP GET Service
HTTP PUT Service
HTTP DELETE Service
HTTP POST Service, HTTP PATCH Service

The Universal Linker searches for objects stored in the CAST Analysis Service schema whose type inherits from CAST_ResourceService or CAST_WebServiceLinker_Resource. These objects represent queries to web services on the client side. Then it searches for the web services on the server side: these are objects whose type inherits from CAST_WebService_Operation or CAST_WebServiceLinker_Operation.

When a match is found using the properties CAST_ResourceService.uri / CAST_WebServiceLinker_Resource.uri and CAST_WebService_Operation.identification.name / CAST_WebServiceLinker_Operation.identification.name and type of both objects, then a link is created. The matching is done between using the properties CAST_ResourceService.uri / CAST_WebServiceLinker_Resource.uri and CAST_WebService_Operation.identification.name / CAST_WebServiceLinker_Operation.identification.name.

Before matching, the Universal Linker transforms the CAST_ResourceService.uri using following rules, in this order:

  • It replace all “//” with “/{}/” except “//” after “:” (to avoid replacing “http://”), supposing that a parameter was intended between both “/” (REST format).
  • It removes everything after “?” in the uri (to suppress uri parameters part which are not part of REST format parameters).
  • It adds a “/” at the end of uri when not present
CAST_ResourceService.uri After transformation
https://www.castsoftware.com/offices//phone// external link https://www.castsoftware.com/offices/{}/phone/{}/ external link
https://www.castsoftware.com/offices//phone/ external link https://www.castsoftware.com/offices/{}/phone/ external link
https://www.castsoftware.com/offices//phone external link https://www.castsoftware.com/offices/{}/phone/ external link
https://www.castsoftware.com/offices/{}/phone external link https://www.castsoftware.com/offices/{}/phone/ external link
https://www.castsoftware.com/offices?office=1 external link https://www.castsoftware.com/offices/ external link

The result is then compared to CAST_WebService_Operation.identification.name / CAST_WebServiceLinker_Operation.identification.name using the endswith function, ignoring the uri part corresponding to the operation name part whose value is {}.

CAST_ResourceService.uri CAST_WebService_Operation.identification.name Match: Yes/No
…/path1/path2/path3/ path4/path3/ No
…/path1/path2/path3/{}/ path3/{}/ Yes
…/path1/path2/path3/ path2/path3/ Yes
…/param1/value1/param2/value2/ …/param1/{}/param2/{}/ Yes

Examples of matches:

A client side url like:

is transformed as:

It will match a server side operation whose name is “place/{}/”.

Code examples

Server side: the Analysis Service schema contains an object CAST_WebService_GetOperation named /users/

@RequestMapping("/users")
public class UserController {

    @RequestMapping(method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    @ResponseBody
    public PagedResources<UserResource> collectionList(...){
       ...
    }

Client side: the Analysis Service schema contains an object CAST_AngularJS_GetResourceService whose property CAST_ResourceService.uri equals ‘resources/scenarios/{}/'

return $resource('resources/scenarios/:id', {'id':'@id'}, {
    'query': { method: 'GET', isArray: false },
    'save': {method:'POST', isArray: false },
    'update': {method:'PUT', isArray: false },
    'notify': {method:'PUT', params: {notify: true}, isArray: false },
    'remove': {method:'POST', isArray: false, headers:{'X-HTTP-Method-Override':'DELETE'}}

WSDL external link/SOAP services

The connection is made via two “root” objects:

Icon Description
SOAP POST Service
SOAP Any Service

WSDL is generally used in the context of SOAP web services: calls are to an operation, and operations are identified by :

  • operation name
  • port type

Samples:

Client side: BPEL: Invocation of EmployeeTravelStatusPT.EmployeeTravelStatus:

<invoke partnerLink="employeeTravelStatus" 
    portType="emp:EmployeeTravelStatusPT" 
    operation="EmployeeTravelStatus"
    inputVariable="EmployeeTravelStatusRequest" 
    outputVariable="EmployeeTravelStatusResponse" />

Server side: JAX-WS: Reception of operation EmployeeTravelStatusPT.EmployeeTravelStatus:

import javax.jws.WebService;

@WebService(targetNamespace = "http://superbiz.org/wsdl")
public class EmployeeTravelStatusPT {

    public int EmployeeTravelStatus(int add1, int add2)
    {

    }
}

BPEL: Reception of operation TravelApprovalPT.TravelApproval:

<receive partnerLink="client" 
    portType="trv:TravelApprovalPT" 
    operation="TravelApproval" 
    variable="TravelRequest"
    createInstance="yes" />

REST/SOAP Cross-Technology

Front-End/Service Exit Point Back-end/Service Entry Point
  • Web Technologies
    • HTML5/Javascript or TypeScript
      • XMLHttpRequest Service (XMLHttpRequest)
      • Http Request Service (HttpRequest, Fetch, Axios, SuperAgent)
    • AngularJS
      • AngularJS Service ($resource)

      • Restangular Service (Restangular)

      • Http Service ($http)

    • Vue.js
      • Axios
      • Vue-resources
      • Fetch
    • jQuery
      • jQuery Service ($.ajax, $.get, $.getJSON)
      • SAPUI5 Service.
  • Mobile
    • iOS (Objective-C, Swift)
      • NSURLConnection, NSURLSession
      • AFNetworking
    • Android
      • HttpClient
      • HttpURLConnection
      • AsyncTask
  • .NET
    •  ASP.NET
      • SOAP Resource (SoapDocumentAttr, WebMethodAttr)
      • Razor HttpRequest
  • JEE
    • Java
      • URLConnection, HttpURLConnection 
    • Spring
      • Rest Template
      • Web Util
      • Social Support
      • Web Reactive
    • Apache
      • WebClient
      • HttpClient
      • Utils URIBuilder
      • Wink Resource
      • Wink RestClient
    • Other
      • Retrofit2
      • RestHub Client
      • Feign
  • Kotlin
    • Retrofit
  • Other
    • Python
      • Urllib, Urllib2, Urllib3
      • Httplib, Httplib2,
      • aiohttp, Flask
  • Node.js (with JavaScript or TypeScript)
    • Express Service (Express)
    • Http Service (Http)
    • Loopback
    • Hapi.js
    • Sails.js
    • Restify
    • AWS Lambda
  • JEE
    • JAX-RS
      • Client Builder
      • WebTarget
      • Invocation
      • Reasteasy
      • WebResource
    • SpringMVC (@Request/Put/Post/Get/Mapping)
  • .NET
    • WCF Operation (OperationMethod)
    • Web API
  • ASP.NET
    • SOAP Operation (WebServiceAttribute)
  • Python
    • aiohttp, Flask

Intra-layers

Some calls stay within the same layer/language but still cross a framework boundary that the Universal Linker resolves:

  • Bean (EL expressions): a JSF/Spring Expression Language access such as #{myBean.myProperty} is linked to the Java bean method it resolves to (myProperty, getMyProperty, or isMyProperty), including nested/chained property access (e.g. #{myBean.other.myProperty}).
  • Servlet: the Universal Linker derives the servlet operation (GET/POST/PUT/DELETE/ANY) serviced by an HttpServlet subclass, whether declared in web.xml or via a Servlet 3.0+ @WebServlet annotation - unless the dedicated com.castsoftware.java.servlet extension is active, in which case it defers to it.
  • Razor to MVC Controller Action (.NET): a Razor view’s service access is resolved to the ASP.NET MVC controller action it targets by parsing the accessed path into controller/action/parameters, then narrowing ambiguous matches using the MVC area, HTTP verb, parameter count, action aliases, and finally the closest folder proximity between the view and the candidate controllers.

Messaging Protocol

The connection is made via two “root” objects:

Icon Description
Queue call
Queue receive

RabbitMQ / ActiveMQ / IBM MQ

Object creation for these technologies is documented in com.castsoftware.mqe; the Universal Linker then links the corresponding call/receive objects using rules adapted to each broker’s semantics:

  • ActiveMQ (and the generic case): a queue call is linked to a queue receive when the queue name matches and the declared messaging system is compatible - an empty/unspecified system on either side is treated as compatible with any system.
  • RabbitMQ: exchange declarations, publishers, consumers, queue bindings, and exchange bindings are combined to resolve, for each publish, the actual set of destination queues, honouring the exchange type - default-exchange (routing key = queue name), direct-exchange (routing key = binding key), fanout-exchange (any binding), topic-exchange (*/# wildcard pattern match on the binding key), and headers-exchange (x-match: any|all header matching) - including exchange-to-exchange bindings resolved recursively.
  • IBM MQ: a publisher is linked to every subscriber sharing the same queue name, when topics and queue managers are also compatible (point-to-point when neither side declares a topic, publish/subscribe otherwise).

MSMQ

A sender is linked to a receiver when both declare the same, non-empty, queue name.

Cloud messaging & eventing

Cloud Service Matching rule
AWS SQS queue name, including queues only known through a Lambda’s environment variables - see AWS SQS
AWS SNS topic name, publisher linked to every subscriber of that topic - see AWS SNS
AWS Kinesis stream name, producer linked to every consumer of that stream
AWS Data Firehose delivery stream name, producer linked to every consuming delivery
Azure Event Hub Event Hub name, publisher linked to every subscriber
Azure Service Bus topic/queue name, publisher linked to every subscriber
Azure SignalR hub + hub method name, including the implicit connected/disconnected triggers matched to OnConnected(Async)/OnDisconnected(Async)
GCP Pub/Sub a publisher’s topic name must appear in the subscription’s topic list, and the subscription name must match the receiver

Executable Call

Program Call

The connection is made via two “root” objects:

Icon Description
Program Call
Program Call to Java

For the following technologies see Program Calls for Java:

  • Shell script
  • Cobol Program
  • Java Application

Java Method Call

The connection is made via two “root” objects:

Icon Description
Java Method Call

For the following technologies:

  • Cobol Program
  • SQL Function / Procedure

C/C++ Function Call

The connection is made via two “root” objects:

Icon Description
C/C++ Function Call

For the following technologies:

  • SQL Function / Procedure

Commands running SQL script

The connection is made via two “root” objects:

Icon Description
Call to a SQL file query
SQL Script

See also the documentation for com.castsoftware.rpg.

Remote Code Execution

gRPC / Generic RPC

  • gRPC: see gRPC-java. A call is linked to the gRPC method it invokes by service and method name, normalizing the first letter of each part to lower-case (so CalculatorService.findSquare matches calculatorService.FindSquare); when the call name is prefixed with reactor (reactive stubs), it is also tried against the same name with that prefix stripped.
  • Generic RPC: for RPC protocols not otherwise covered by a dedicated extension, a call is linked to the method it invokes when both the name and the declared protocol match.

Raw sockets (planned): the metamodel already defines client/server Socket objects (protocol, vendor, and port), but no linking rule between them has shipped yet - matching generic client/server sockets is on the roadmap but not part of this release.

Direct Web Remoting - Function Call

The connection is made via two “root” objects:

Icon Description
Call to a DWR service method
A DWR service method

For more details about DWR technology see Direct Web Remoting.

WebSockets

The following table shows the interoperability between RAW WebSocket libraries.

Front-End/Service Entry Point Back-end/Service Exit Point
  • Web Technologies
    • HTML5/Javascript or TypeScript
      • Native WebSocket API (WebSocket)
  • Node.js
    • WebSocket-Node
    • ws
  • .NET
    • .NET WebSockets (client)
    • WebSocket4Net
  • Java
    • Java EE WebSocket
    • Jakarta WebSocket
    • Spring WebSocket
    • Spring WebFlux WebSocket
    • Jetty WebSocket Client
    • Netty
    • Vert.x
    • Undertow
    • Tyrus Client
    • Okhttp3
    • Tomcat Client
  • Web Technologies
    • HTML5/Javascript or TypeScript
      • Native WebSocket API (WebSocket)
  • Node.js
    • WebSocket-Node
    • ws
  • .NET
    • .NET WebSockets (server via HttpListener)
    • ASP.NET
    • System.Web
  • Java
    • Java EE WebSocket
    • Jakarta WebSocket
    • Spring WebSocket
    • Spring WebFlux WebSocket
    • Jetty WebSocket Server
    • Netty
    • Vert.x
    • Undertow
    • Tyrus Server
    • Tomcat Server

The following table shows the interoperability between SockJS libraries

Front-End/Service Entry Point Back-end/Service Exit Point
  • Web Technologies
    • HTML5/Javascript or TypeScript
      • sockjs-client
  • Node.js
    • sockjs-client
  • Java
    • Spring Client SockJS
  • Web Technologies
    • HTML5/Javascript or TypeScript
      • @stomp/stompjs
      • @stomp/rx-stomp
  • Node.js
    • sockjs
  • Java
    • Vert.x SockJS

See also the documentation for:

Mainframe Transaction Processing (CICS / IMS)

CICS

CICS commands are linked to the CICS elements they operate on:

Command CICS element Link type
WRITEQ / READQ / DELETEQ TD Transient Data Queue accessWriteLink / accessReadLink
READ / BROWSE FILE Dataset accessReadLink
WRITE / REWRITE / DELETE FILE Dataset accessWriteLink
START / RETURN / CANCEL TRANSID Transaction callLink
SEND MAP Map accessWriteLink
RECEIVE MAP Map accessReadLink

Matching is done by name for queues, datasets, and transactions. For maps, both the map name and its mapset (parsed from the map’s fullname, of the form xxx.<mapset>.<map>) are used together, so that maps sharing the same name in different mapsets are not confused with one another.

IMS
  • DL/I calls (GU/GN/GNP/GHU/GHN/GHNP for reads, ISRT/REPL/DLET for writes) are linked to the Program Control Block (PCB) they operate on, matched by PSB name and PCB position within the program’s PCB list - accounting for an implicit I/O PCB occupying the first slot when present, which shifts every DB PCB position by one.
  • CHNG calls are linked to the target IMS Transaction by the resolved 8-character destination code.

Both models mirror the underlying COBOL/PL/I call graph: links point to Program Control Blocks (not to individual segments) for IMS/DB, and to CICS elements (queues, datasets, transactions, maps) rather than to raw file names for CICS.

Serverless

AWS Lambda

See AWS Lambda for more information. In addition to explicit invocations, the Universal Linker also connects a Lambda to the events that trigger it:

  • an S3 bucket insert/update is linked to a CAST_AWS_S3_Event_Handler, or to a Lambda whose s3_events property lists that bucket, when the event type (ObjectCreated/ObjectRemoved/ObjectDeleted) is compatible with the access type (insert/update vs delete);
  • a DynamoDB table insert/update/delete is linked to any Lambda listed in the table’s dynamodb_events;
  • when a bucket, queue, topic, or table is only known through Infrastructure-as-Code (its concrete name does not appear in the source code), the Universal Linker resolves it from the Lambda’s environment variables (CAST_AWS_Lambda.env_vars) so that “Unknown” AWS resources can still be linked to the Lambda that produces or consumes them.

Azure Functions & WebJobs

A call to an Azure Function or WebJobs is linked by name to the Function/WebJobs it invokes. The Universal Linker also connects a Function/WebJobs to its Blob Storage or Cosmos DB trigger: an insert/update on a Blob Container or a Cosmos DB Collection is linked to any Function/WebJobs whose blob_triggers/cosmosDB_triggers property lists that container/collection.

Log Messages

Note that errors and warnings that may potentially be returned during an analysis are as follows:

Message ID Message Type Logged during Impact Remediation Action
WBSLINKER-001 Warning Post analyses An internal issue occurred when reading a web.xml file. Transactions could be truncated because of missing http links between clients and servers. - Contact CAST Technical Support external link