Servis-Rhino 4211B Betriebsanweisung Seite 72

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 298
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 71
commonly interacting with the back-end server through some other protocol.
When we define the adapter, we define one or more procedures that can be called by the client. For
each procedure, we need to create a corresponding function definition in the JavaScript. For
example, if we define that an adapter will expose a procedure called "getGreeting" then we need to
build a function definition in the JavaScript source file also called "getGreeting". This means that
when the client invokes the adapter's procedure the correspondingly named function will be
invoked.
A procedure function must return a JavaScript object. It is that object that is returned to the client
caller. The object is augmented with a property called "isSuccesful".
Adapter Types
An adapter used by a client app must be of one of the following types:
HTTP Adapter
The HTTP Adapter provides the ability for a Worklight client app to connect to a back-end system
via the HTTP protocol. Calling back-end systems via HTTP outside of the scope of Worklight is a
very common activity. Typically, this concept is called "REST programming" or "AJAX
programming". There is nothing to prevent the client application from calling a target back-end
directly using a JavaScript framework's REST calling APIs directly, however, doing so will not take
advantage of the Worklight adapter architecture and all its relative values.
The high-level architectural overview of using the HTTP Adapter is shown in the following
diagram:
An instance of an HTTP Adapter is created and deployed to the Worklight Server. The Client app
uses the Worklight Client API to invoke a procedure exposed by the adapter. This procedure then
makes the actual request to the back-end server using HTTP.
When an instance of an HTTP Adapter is defined in Worklight Studio, the Connection Policy
options look as follows:
Page 72
Seitenansicht 71
1 2 ... 67 68 69 70 71 72 73 74 75 76 77 ... 297 298

Kommentare zu diesen Handbüchern

Keine Kommentare