RXS_PutStdOut()
This subprocedure is used to output (to standard out) data. Typically, this would be used in a scenario where you are providing a webservice, and would be used to output XML retrieved via RXS_GetComposeBuffer().
Subprocedure Prototype
|
|
|
Data to be written to "standard out", i.e. to a web browser or to a web service which initiated the incoming request as a client. |
|
Optional RXS_PutStdOutDS_t to allow for CCSID conversion during output. |
Example Code
*--------------------------------------------------------------
* This example code writes the content of the field gXml to STDOUT.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D gXML S Like(RXS_Var1Kv_t)
/free
gXml = '<element>Example XML</element>';
RXS_PutStdOut( gXml );
*INLR = *ON;
/end-free
*--------------------------------------------------------------
* This example code specifies the header content type as XML,
* then sends the data to STDOUT.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D PutStdOutDS DS LikeDS(RXS_PutStdOutDS_t)
D gXML S Like(RXS_Var1Kv_t)
/free
RXS_ResetDS( PutStdOutDS : RXS_DS_TYPE_PUTSTDOUT );
gXml = '<element>Example XML</element>';
PutStdOutDS.HeaderContentType = 'text/xml';
RXS_PutStdOut( gXml : PutStdOutDS );
*INLR = *ON;
/end-free
*--------------------------------------------------------------
* This example code specifies the header content type as XML, and
* specifies the IFS file from which data will be read to STDOUT.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D PutStdOutDS DS LikeDS(RXS_PutStdOutDS_t)
/free
RXS_ResetDS( PutStdOutDS : RXS_DS_TYPE_PUTSTDOUT );
PutStdOutDS.HeaderContentType = 'text/xml';
PutStdOutDS.Stmf = '/tmp/over16mb.xml';
RXS_PutStdOut( *Omit : PutStdOutDS );
*INLR = *ON;
/end-free
*--------------------------------------------------------------
* This example code specifies the header content type as XML, and
* sets a header status code and text to communicate an HTTP error,
* then sends the XML to STDOUT.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D PutStdOutDS DS LikeDS(RXS_PutStdOutDS_t)
D gXML S Like(RXS_Var1Kv_t)
/free
RXS_ResetDS( PutStdOutDS : RXS_DS_TYPE_PUTSTDOUT );
gXml = '<element>Example XML</element>';
PutStdOutDS.HeaderStatusCode = 500;
PutStdOutDS.HeaderStatusText = 'SOAP Fault';
PutStdOutDS.HeaderContentType = 'text/xml';
RXS_PutStdOut( gXml : PutStdOutDS );
*INLR = *ON;
/end-free
*--------------------------------------------------------------
* This example code specifies the header content type as XML, and
* sets a sets a custom header "Prefer", then sends the XML to STDOUT.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D PutStdOutDS DS LikeDS(RXS_PutStdOutDS_t)
D gXML S Like(RXS_Var1Kv_t)
/free
RXS_ResetDS( PutStdOutDS : RXS_DS_TYPE_PUTSTDOUT );
gXml = '<element>Example XML</element>';
PutStdOutDS.HeaderContentType = 'text/xml';
PutStdOutDS.CustomHeaderName(1) = 'Prefer';
PutStdOutDS.CustomHeaderValue(1) = 'Return=representation';
RXS_PutStdOut( gXml : PutStdOutDS );
*INLR = *ON;
/end-free
Data Structures
|
|
|
|
|
|
|
|
|
The contents of the Input parameter are converted from the job CCSID to this CCSID before being sent to standard out. |
|
Specifies IFS path to a stream file whose contents are to be sent to STDOUT. |
|
The HTTP Status code to be sent in the response. A sucessful reponse is typically "200". |
|
The HTTP Status text to be sent in the response. This is also known as the reason phrase. A sucessful reponse is typically "OK". |
|
The HTTP content type to be sent with the response. The most common content type for web services is "text/xml". There is no assumed default value and if this value is not supplied via this data structure, then the content type is usually required to be supplied in the Input parameter and it must be followed by two line control characters. |
|
Specifies the name of up to 50 custom HTTP headers sent with the response. |
|
Specifies the value of up to 50 corresponding CustomHeaderName's. |