PV-WAVE Advantage > JWAVE User Guide > JWAVE Server Development > Returning Graphical Data to the Client
Returning Graphical Data to the Client
 
warning
JWAVE uses an insecure protocol without authentication. This makes JWAVE insecure to use in an Internet facing configuration and would allow an attacker to execute arbitrary code on the server. If you choose to implement JWAVE in this way, you are responsible for the security of those applications that leverage JWAVE.
The following example shows a simple JWAVE wrapper that calls the PV‑WAVE PLOT command to generate a 2D plot of the array received from the client. Graphics are automatically created on the server and sent back to the client for display.
 
note
The client developer uses the JWaveView class to request that the server return graphical data in addition to numerical data. Whenever JWaveView is used to execute a client request to the server, the server automatically creates a Viewable object. This object is then packaged and streamed back to the client where it can be displayed. If the client calls the wrapper with the JWaveExecute class, the graphics are discarded, and only the data are returned. For more information on JWaveView and graphics, see Chapter 4: JWAVE Graphics.
Simple JWAVE wrapper that returns a 2D plot 
FUNCTION APLOT, client_data
; Unpack the parameters and data from the client. 
   arr =    GETPARAM(client_data, 'ARRAY', /Value)
   PLOT, arr
RETURN, 0
END
 
note
You must make sure that all coordinate system information is correct before you return a plot to the client. Also, note that the SURFACE and AXIS procedures create a temporary axis transformation that is not automatically saved by the PV‑WAVE session. To ensure that the correct transformation and coordinate system information is sent back to the client, use the Save keyword with these procedures. This causes the correct transformation information to be sent automatically to the client. For more information on coordinate transformations, see "Coordinate System Transformations" on page 47.