1 / 79

HTTP Support Upgrade

HTTP Support Upgrade. Takahiro Ishiwatari ishwtari@jp.ibm.com. Acknowledgements.

Download Presentation

HTTP Support Upgrade

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTTP Support Upgrade Takahiro Ishiwatari ishwtari@jp.ibm.com

  2. Acknowledgements • The following are trademarks of International Business Machines Corporation in the United States, other countries, or both: IBM, CICS, CICS/ESA, CICS TS, CICS Transaction Server, DB2, MQSeries, OS/390, S/390, WebSphere, z/OS, zSeries, Parallel Sysplex. • Java, and all Java-based trademarks and logos, are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. • Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. • Other company, product, and service names and logos may be trademarks or service marks of others.

  3. Agenda • HTTP fundamentals • New features in CICS TS V3.1 • HTTP 1.1 compliance • HTTP processing in CICS • CICS as an HTTP server • CICS as an HTTP client • Code conversion • Other changes

  4. HTTP fundamentals • URI and URL • HTTP request and response • CICS Web Support processing in CICS TS V2 • Information for HTTP specifications can be found at • HTTP/1.0 RFC 1945 ( http://www.w3.org/Protocols/rfc1945/rfc1945 ) • HTTP/1.1 RFC 2616 (http://www.w3.org/Protocols/rfc2616/rfc2616 )

  5. URI and URL • URL (Uniform Resource Locator) • identifies a resource available on the internet • format specified in RFC1738 (http://www.ietf.org/rfc/rfc1738.txt) • URI (Uniform Resource Identifier) • identifies an abstract or physical resource • format specified in RFC2396 (http://www.ietf.org/rfc/rfc2396.txt) • URL is a subset of URI • URL is a representation of a primary access mechanism (a network location) • another form of URI is URN (Uniform Resource Name) URI urn: ftp: isbn: http: oasis: telnet: news: URN URL

  6. URI and URL • Components of URI and URL • scheme • such as http, https • scheme specific part • an HTTP scheme will have • host • port • path • query-string scheme host port path query-string http : / / www.ibm.com : 80 / Scripts / Global / nph-cc ? cc=at

  7. HTTP request and response • HTTP request contains • request line • method • GET, POST, HEAD, etc. • document path • /Scripts/Global/npb-cc?cc=at • HTTP version number • HTTP/1.0, HTTP/1.1 • (optional) header section • HTTP headers • Host, Content-type, etc. • ends with a blank line • (optional) entity body • user data • e.g. name value pairs request line POST /Scripts/Global/nph-cc?cc=at HTTP/1.1 Accept: image/gif, image/jpeg, */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0, Windows NT 5.0) Host: www.sample.ibm.com:80 Content-type: text/plain; charset=ISO-8859-1 Content-length: 80 (blank line) aa=zzzzz&bb=yyyyy&cc=xxxxxx... header section entity body

  8. HTTP request and response • HTTP response contains • response line • HTTP version number • HTTP/1.0, HTTP/1.1 • status code • 200, 404, 500, etc. • text describing the status code • (optional) header section • HTTP headers • Connection, Content-type, etc • ends with a blank line • (optional) entity body • user data • e.g. HTML document response line HTTP/1.1 200 OK Date: Fri, 13 Aug 2004 19:02:57 GMT Connection: close Content-Type: text/html; charset=ISO-8859-1 Content-length: 00003255 (blank line) <HTML> <HEAD>…</HEAD> <BODY>…</BODY> </HTML> header section entity body

  9. CICS Web Support processing in CICS TS V2 • Inbound HTTP requests • Can invoke COMMAREA based applications or 3270 transactions • APIs supplied for web aware programs • EXEC CICS WEB API, EXEC CICS DOCUMENT API • Supports HTTP/1.0 • non-HTTP requests can also be processed CICS DFHCCNV (Header) Socket Listener (CSOL) Web Attach transaction (CWXN) Analyzer DFHCCNV (User Data) Converter (Decode) Alias transaction (CWBA) Business Logic Interface (DFHWBBLI) Application or 3270 transaction via DFHWBTTA Converter (Encode) DFHCCNV

  10. CICS Web Support processing in CICS TS V2… • example URL for the supplied analyzer • for commarea applications • for 3270 applications • HTTP requests can be processed via Web server • Web server will invoke the Business Logic Interface (DFHWBBLI) via EXCI http://hostname:80/CNV1/CWBA/USRPGM1 Converter program Alias tranid Target program http://hostname:80/CICS/CWBA/DFHWBTTA/AMNU Converter program Alias tranid Web Bridge program Target tranid

  11. CICS Web Support processing in CICS TS V2… • Outbound HTTP requests • Linkable interface provided in CICS TS V2.2 and above • EXEC CICS LINK PROGRAM(DFHWBCLI) • All information and data specified in COMMAREA • Functions: Inquire proxy, Send, Receive, Converse, Close • target URL information • pointer to header area and body area • response and reason codes • Used in SOAP for CICS feature CICS HTTP request DFHWBCLI LINK for Send HTTP response DFHWBCLI LINK for Receive DFHWBCLI LINK for Close

  12. What’s new in CICS TS V3.1 • HTTP/1.1 compliance • HTTP processing in CICS • CICS as an HTTP server • URIMAP resource definition • CICS as an HTTP client • EXEC CICS commands for outbound support • Code page conversion • Other changes

  13. HTTP/1.1 compliance • CICS is conditionally compliant with HTTP/1.1 specification • ‘Conditionally compliant’ means… • for the requirements that are relevant to the functions provided by CICS, • CICS satisfies all the MUST level requirements • but not all the SHOULD level requirements • responsibility for compliance • User applications also share responsibility • may fail to meet the SHOULD requirements, depending on actions performed by the application • CICS provides facilities and documentation to help make applications compliant with HTTP/1.1

  14. HTTP/1.1 compliance… • New features that CICS provides for HTTP/1.1 compliance • Supported methods • HTTP date and time formats • Persistent connections • Pipelining • Chunking

  15. Supported Methods • Methods supported • For HTTP/1.0 in CICS • GET, HEAD, POST, PUT, DELETE, LINK, UNLINK, REQUEUE • RFC1945(HTTP/1.0) lists GET, HEAD, POST as supported methods • For HTTP/1.1 • GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE • LINK, UNLINK, REQUEUE methods are not supported • CICS actions for status codes also made compliant • Message body handling • should be no body for GET, HEAD, DELETE, TRACE methods • ignore on input • INVREQ on output

  16. Supported Methods and CICS handling

  17. HTTP date and time stamp formats • Date and time stamps used in HTTP headers • HTTP/1.1 clients and servers must accept • Tue, 01 Apr 2003 10:01:02 GMT : RFC 1123 format • Tuesday, 01-Apr-03 10:01:02 GMT : RFC 1036 format • Tue Apr 01 10:01:02 GMT : ANSI C’s asctime() format • only generate the RFC 1123 format • Tue, 01 Apr 2003 10:01:02 GMT : RFC 1123 format • Uses of HTTP date and time stamps in CICS • On receive, • Applications can read the HTTP headers and convert the time into absolute time • On send, • CICS will automatically produce the Date header in the required format • For other HTTP headers that need date & time stamps, application needs to convert absolute time (ABSTIME) to RFC 1123 format

  18. HTTP date and time stamp formats… • CICS will supply APIs to handle conversion • EXEC CICS CONVERTTIME • converts HTTP formats to ABSTIME • EXEC CICS FORMATTIME • converts ABSTIME to HTTP format • new options DATESTRING and STRINGFORMAT • STRINGFORMAT specifies the type of format in cvda • currently only 646 (RFC1123) is supported • if DATESTRING present and STRINGFORMAT not specified, RFC1123 is used EXEC CICS CONVERTTIME DATESTRING (‘Tue, 01 Apr 2003 10:01:02 GMT’)  ABSTIME (+003258180062000) EXEC CICS FORMATTIME ABSTIME (+003258180062000) STRINGFORMAT (RFC1123)  DATESTRING (‘Tue, 01 Apr 2003 10:01:02 GMT’)

  19. Persistent connections • In previous CICS releases • Compliant with HTTP/1.0 • by default, CICS would close the connection when data received • Web client would send “Connection: Keep-Alive” header to keep connection open • Can be ultimately controlled by SOCKETCLOSE on TCPIPSERVICE • normally would specify SOCKETCLOSE(0) unless SSL • CWXN will remain in system until socket closed • System may get flooded with inactive CWXN tasks CWXN CWBA CWBA CWBA socket connection Socketclose CICS

  20. Persistent connections… • In CICS TS V3.1 • Compliant with HTTP/1.1 persistent connection • CICS will keep the session open by default • Session closed when requested (e.g. in header, client termination, timeout, etc.) • SOCKETCLOSE(0) will fail to meet the requirements for HTTP/1.1 • Asynchronous sockets support for CWXN • CWXN terminates but socket still open (“pseudo conversational”) • Eliminates CWXN tasks suspending in the system CWXN CWBA CWXN CWBA CWXN CWBA socket connection Socketclose CICS

  21. Pipelining • Send multiple request without waiting for response • responses are returned in the same sequence that the request was received • requests should be idempotent • i.e. same result is always obtained when the requests are repeated • requires persistent connection RECEIVE request A SEND RECEIVE request B SEND RECEIVE request C SEND RECEIVE SEND request D RECEIVE SEND response A RECEIVE SEND response B RECEIVE SEND response C RECEIVE SEND response D Client Server

  22. Pipelining… • CICS support for pipelining • CICS acting as a server • CICS will process the requests serially as separate transactions • remaining requests in the pipelined message will be held until the response is sent • CICS acting as a client • Application will connect to a remote server and issue a series of send requests • each request is sent immediately • Application should receive the pipelined responses in the order the request was sent RECEIVE request A SEND request B SEND SEND request C SEND RECEIVE SEND RECEIVE response A RECEIVE response B RECEIVE RECEIVE response C SEND

  23. Chunking • Chunked transfer-coding • transfer data in convenient segments • dynamically produced contents • large amount of content • Sends the body of a message in chunks • each chunk has its own size indicator • may be followed by optional trailer headers • end-of-message is indicated by a chunk with zero length and an empty line • empty line signified by <CRLF><CRLF> • recipient will receive the message as a whole • recipient can verify that it received the complete message SEND SEND SEND SEND … … RECEIVE

  24. Chunking… • CICS support for chunking • On inbound, • wait until all the chunks are received • application can receive the data with a single WEB RECEIVE command • If CICS is acting as a server, • timeout value set by SOCKETCLOSE in TCPIPSERVICE • total amount of data is limited by the MAXDATALEN attribute in TCPIPSERVICE • If CICS is acting as a client • RTIMOUT value for the executing transaction applied • On outbound, • Application specifies chunking by CHUNKING(CHUNKYES) on each WEB SEND command • CICS will create the “Transfer-Encoding: chunked” and “chunk-size” header • CICS DOCTEMPLATEs cannot be used directly in chunking • to end chunking, send a CHUNKING(CHUNKEND)

  25. TCPIPSERVICE change • PROTOCOL ( ECI | HTTP | IIOP | USER ) • HTTP 1.1 states an error response to be returned for non-HTTP methods • previously customers will default to PROTOCOL(HTTP) for request other than HTTP, ECI, IIOP and use CICS Web Support to handle the request. • non-HTTP request on a PROTOCOL(HTTP) port will return 501 error • New USER option • used for non-HTTP methods • CICS Web Support will still be invoked but under a different tranid. • CWXU - but same program used as CWXN • non-HTTP processing is exactly the same as today. - no code conversion prior to analyzer - Invokes the analyzer - Invokes the converter program if required - Invokes the target application • may need to change port for migration

  26. TCPIPSERVICE change … • MAXDATALEN ( 32KB | number KB ) • Maximum data that can be received on the port for the service • limit amount of data received by chunking • to prevent denial of service • minimum of 32KB (default) • maximum is 0.5GB • SOCKETCLOSE • Recommendation change • Formerly, SOCKETCLOSE(0) was recommended • In CICS TS V3.1, recommendation is to not specify SOCKETCLOSE(0) • SOCKETCLOSE(0) will fail to meet the requirements for HTTP/1.1

  27. HTTP processing in CICS • CICS as an HTTP server • Web client sends an HTTP request to CICS • CICS as an HTTP client • CICS sends an HTTP request to a remote server HTTP request CICS CICS Web Support CICS Application HTTP response CICS HTTP request Outbound HTTP Support CICS Application HTTP response

  28. CICS as an HTTP server • Processing changes in CICS TS V3.1 • New URIMAP resource to determine the processing for the request • Types of processing • Redirection • Static response • Application response • API changes • WEB API changes • Support for chunking • HTTP date and time stamp format handling • CONVERTTIME, FORMATTIME • Code conversion changes • Support for UTF-8, UTF-16 code page conversions

  29. URIMAP for CICS as an HTTP server • A URIMAP will • match the incoming URI and… • invoke a CICS application, or • directly • using analyzer and converter programs • supply a static response, or • specify code conversion characteristics • redirect HTTP requests to a specified URL, or • invoke a CICS Web service • Analyzer is invoked if no URIMAP matches URIMAP definition URIMAP ==> SAMPURI USAGE ==> Server Universal Resource Identifier SCHEME ==> HTTP HOST ==> www.ibm.com PATH ==> Scripts/Global/* Associated CICS resource …. Static Document Properties …. Redirection …. scheme host port path query-string http : / / www.ibm.com : 80 / Scripts / Global / nph-cc ? cc=at

  30. CICS Web Support processing in CICS TS V3.1 • New URIMAP resource to determine the processing for the request • analyzer programs are now optional • more flexible URI path • remove CICS specific resource names from path CICS DFHCCNV (Header) Socket Listener (CSOL) Web Attach transaction (CWXN) URIMAP matching Analyzer DFHCCNV (User Data) Converter (Decode) Alias transaction (CWBA) Business Logic Interface (DFHWBBLI) Application or 3270 transaction via DFHWBTTA Converter (Encode) DFHCCNV

  31. Application response • An application program is executed to service the request • program can be specified by • PROGRAM attribute in URIMAP definition • Analyzer program • Converter program • program can be • “Web-aware” using EXEC CICS WEB and DOCUMENT APIs • COMMAREA program • 3270 application HTTP request CICS CICS Web Support CICS Application HTTP response

  32. Application response… • URIMAP for Web aware programs • essentially, you only need to specify PROGRAM attribute • let the other parameters default • if you want to use an analyzer program • specify ANALYZER(YES) and TCPIPSERVICE • analyzer program on TCPIPSERVICE will be used • the following may be overridden by analyzer • CONVERTER, TRANSACTION, USERID, PROGRAM • if ANALYZER(NO) • CONVERTER or PROGRAM or both must be present • if you want to use a converter program • specify CONVERTER • PROGRAM may be overridden by converter • optionally specify.. • TRANSACTION • default is CWBA, always run DFHWBA program • USERID • may be overridden by AUTHENTICATE in TCPIPSERVICE

  33. Application response… • URIMAP for COMMAREA applications • Specify the target program in PROGRAM attribute • Specify CONVERTER to do the decode and encode functions • if not specified by analyzer program • URIMAP for 3270 applications • Specify Web Terminal Translation Application in PROGRAM attribute • DFHWBTTA, DFHWBTTB or DFHWBTTC • PATH should be generic • e.g. /terminal/* • Format for the rest of the path • /[transaction name]+[input parameters]?[token] • e.g. /cemt+inq+task

  34. Static response • Responses without the need to invoke an application program • from a CICS DOCTEMPLATE resource or a file on HFS • HFS file can also be specified in DOCTEMPLATE • if DOCTEMPLATE • can use query strings to substitute symbols • query string must not be included in the PATH attribute of URIMAP • passes the content as a symbol string HTTP request CICS CICS Web Support doc template HTTP response HFS

  35. Static response… • In URIMAP definition • specify the location of the document • TEMPLATENAME used for CICS DOCTEMPLATEs • HFSFILE used for HFS files • path matching can be used • wild card character specified in the PATH, and TEMPLATENAME / HFSFILE • specify MEDIATYPE • i.e. text/html, text/xml, etc. • if text type document specify • CHARACTERSET: default is ISO-8859-1 • HOSTCODEPAGE: default is LOCALCCSID on SIT • ANALYZER(NO) is required /findout/pictures/bluefish.jpg PATH ==> findout/pictures/* HFSFILE ==> /u/facts/image/* /u/facts/image/bluefish.jpg

  36. Redirection • Redirect to another location on the web • permanently or temporarily • can be changed by SET URIMAP command for redirection • In URIMAP definition • specify LOCATION attribute • with REDIRECTTYPE( NONE | TEMPORARY | PERMANENT ) • the following will be inactivated by setting redirection • ANALYZER, CONVERTER, HFSFILE, PIPELINE, PROGRAM, TEMPLATENAME, TRANSACTION, USERID • can reactivate by setting REDIRECTTYPE(NONE) HTTP request CICS CWS 301/302 response Redirected HTTP request

  37. URIMAP definition Urimap ==> Group ==> DEscription ==> STatus ==> Enabled Enabled | Disabled USAge ==> Server Server | Client | Pipeline UNIVERSAL RESOURCE IDENTIFIER SCheme ==> HTTP HTTP | HTTPS HOST ==> (Mixed Case) ==> PAth ==> (Mixed Case) ==> ==> ==> ==> ASSOCIATED CICS RESOURCES TCpipservice ==> Analyzer ==> No No | Yes COnverter ==> TRansaction ==> PRogram ==> PIpeline ==> Webservice ==> (Mixed Case)

  38. URIMAP definition… • STATUS({ENABLED| DISABLED}) For all USAGE options. Specifies whether the URIMAP definition is to be installed in an enabled or disabled state. • USAGE({SERVER| CLIENT| PIPELINE}) Specifies whether this URIMAP definition is for CICS as an HTTP server (SERVER), CICS as an HTTP client (CLIENT), or an XML service (PIPELINE). The USAGE attribute governs which other attributes in the URIMAP definition can be used • SCHEME({HTTP| HTTPS}) For all USAGE options. Specifies the scheme component of the URI to which the URIMAP definition applies, which is either HTTP (HTTP without SSL) or HTTPS (HTTP with SSL). • HOST(hostname) For all USAGE options. Specifies the host component of the URI to which the URIMAP definition applies, which can be up to 116 characters. An example of a host name is www.research.ibm.com. • PATH(path) For all USAGE options. Specifies the path component of the URI to which the URIMAP definition applies, which can be up to 255 characters. An example of a path is software/htp/cics/index.html. • TCPIPSERVICE(data-area) For USAGE(SERVER) and USAGE(PIPELINE). Specifies the 1- to 8-character name of a TCPIPSERVICE resource definition that defines an inbound port to which this URIMAP definition relates. • ANALYZER For USAGE(SERVER), where an application-determined response is to be provided. Specifies whether an analyzer program is to be used in processing the HTTP request from the Web client. • CONVERTER(data-area) For USAGE(SERVER), where an application-determined response is to be provided. Specifies the 1-8 character name of a converter program that is to be run to perform conversion or other processing on the content of the request. • TRANSACTION(data-area) For USAGE(SERVER), where an application-determined response is to be provided and USAGE(PIPELINE). Specifies the 1-4 character name of an alias transaction that is to be used to run the user application that composes a response to the HTTP request from the Web client • PROGRAM(data-area) For USAGE(SERVER), where an application-determined response is to be provided. Specifies the 1-8 character name of the user application program that composes a response to the HTTP request from the Web client. • PIPELINE(data-area) For USAGE(PIPELINE). Specifies the 1-8 character name of the Pipeline Resource definition that defines the application that processes the request. • WEBSERVICE(data-area) For USAGE(PIPELINE). Specifies the name of the Web Service Resource definition that defines the application that processes the request.

  39. URIMAP definition (continued) SECURITY ATTRIBUTES USErid ==> CIphers ==> CErtificate ==> (Mixed Case) STATIC DOCUMENT PROPERTIES Mediatype ==> (Mixed Case) CHaracterset ==> (Mixed Case) HOSTCodepage ==> TEmplatename ==> (Mixed Case) HFsfile ==> (Mixed Case) ==> ==> ==> ==> REDIRECTION Redirecttype ==> None None | Temporary | Permanent Location ==> (Mixed Case) ==> ==> ==> ==> ==>

  40. URIMAP definition (continued)… • USERID(data-area) For USAGE(SERVER), where an application-determined response is to be provided, and USAGE(PIPELINE). Specifies the 1-8 character user ID under which the alias transaction will be attached. • CIPHERS=value For USAGE(SERVER). The CIPHERS list is only used when the sockets connection established for the resource uses SSL or TLS. • CERTIFICATE(data-area) For USAGE(CLIENT). Specifies the label of the X.509 certificate that is to be used as the SSL client certificate during the SSL handshake. • MEDIATYPE(name) For USAGE(SERVER) , where a static response is to be provided. Specifies the data content of the response that CICS provides to the HTTP request from the Web client, for example image/jpg, text/html or text/xml. Up to 40 characters can be used. • CHARACTERSET(data-area) For USAGE(SERVER) , where a static response is to be provided. Specifies the 1-40 character name of the character set into which CICS converts the entity body of the response that is sent to the Web client. ISO-8859-1, the default character set for the Web, is used as the default if this attribute is not specified. • HOSTCODEPAGE(data-area) For USAGE(SERVER) , where a static response is to be provided. Specifies the 1-10 character name of the IBM code page (EBCDIC) that is used in the CICS system when handling this request. This attribute only applies where a text document is used to provide a response to the request, or where the request includes an entity body in a text format. • TEMPLATENAME(data-area) For USAGE(SERVER), where a static response is to be provided. Specifies the 1-48 character name of a CICS document template that will form the static response which is sent to the HTTP request from the Web client. • HFSFILE(data-area) For USAGE(SERVER), where a static response is to be provided. Specifies the fully qualified name of a UNIX System Services HFS file that will form the static response which is sent to the HTTP request from the Web client. • REDIRECTTYPE(NONE|TEMPORARY|PERMANENT) For USAGE(SERVER) and USAGE(PIPELINE). Specifies the type of redirection for requests that match this URIMAP definition. The URL specified by the LOCATION attribute is used for redirection when required. • LOCATION(data-area) For USAGE(SERVER) and USAGE(PIPELINE). Specifies a URI of up to 255 characters to which the HTTP request should be redirected.

  41. URIMAP valid attributes

  42. Managing URIMAP resource • URIMAP resource • Can be managed via CEMT or SPI commands • INQUIRE URIMAP • Inquire on the current URIMAP settings • SET URIMAP • Enable or disable the status • when disabled, HTTP requests will get a 503 (Service Unavailable) • Temporarily redirect to a remote server

  43. Virtual hosting • Having multiple host names for the same IP address • DNS host name resolution returns same IP address for different host names • HTTP/1.1 specification allows the host name to be stored in a “Host” header • In HTTP/1.0, host name was lost after resolution • Can treat requests with different host names as different resources http://www-1.ibm.com http://www-2.ibm.com DNS resolution DNS server DNS resolution http://204.146.81.99 http://204.146.81.99 GET /htp/cics/index.html HTTP/1.1 GET /htp/cics/index.html HTTP/1.1 Host: www-1.ibm.com Host: www-2.ibm.com 204.146.81.99

  44. Virtual hosting… • CICS will form a group of virtual hosts from URIMAP definition • HTTP requests are mapped to the virtual host • virtual hosts can be managed by INQUIRE and SET commands • to inquire the host name and status of the virtual host • enable or disable the status of the virtual host • when disabled, CICS will return an HTTP 503 response to the Web client host name used CICS URIMAP1 Host: www-1.ibm.com www-1.ibm.com Enabled URIMAP2 URIMAP3 Host: www-2.ibm.com www-2.ibm.com URIMAP4 Enabled TCP/IP PORT URIMAP5 Host: www-3.ibm.com www-3.ibm.com Disabled URIMAP6 URIMAP7 www-4.ibm.com Host: www-4.ibm.com URIMAP8 Enabled

  45. Managing HTTP requests • Accepting or rejecting HTTP requests • Requests can be managed in different levels • On a specific URI level • SET URIMAP ENABLE/DISABLE • On a particular (virtual) host name level • SET HOST ENABLE/DISABLE • On a port level • SET TCPIPSERVICE OPEN/CLOSE • On a region level • SET TCPIP OPEN/CLOSE

  46. Receiving an HTTP request • EXEC CICS WEB RECEIVE • MAXLENGTH to specify the amount passed to the application • NOTRUNCATE option used for data exceeding MAXLENGTH • with NOTRUNCATE • remaining data retained and LENGERR raised • original data length is returned in LENGTH • must issue subsequent WEB RECEIVE to receive data • without NOTRUNCATE • data truncated and LENGERR raised • when the receiving data is chunked • same rule applies with MAXLENGTH and NOTRUNCATE • applies to the total length of the chunked message • to specify conversion of the entity body • SERVERCONV(SRVCONVERT) • Optionally, CHARACTERSET and HOSTCODEPAGE

  47. Sending an HTTP response • EXEC CICS WEB SEND • STATUSCODE • specify an HTTP status code to be inserted for the response • STATUSTEXT, STATUSLENGTH • specify a text to describe the reason for the status code • ACTION option • ACTION(IMMEDIATE); send a response immediately • ACTION(EVENTUAL); send a response at end of task (default) • to specify conversion of the entity body • SERVERCONV(SRVCONVERT) • Optionally, CHARACTERSET and HOSTCODEPAGE

  48. Sending an HTTP response… • EXEC CICS WEB SEND • Chunking is specified by CHUNKING(CHUNKYES) option • Sending chunked responses are always IMMEDIATE • CICS will create the headers for chunking • “transfer-encoding: chunked” on first send • “chunk-size” on each send • Data must be supplied by FROM option • DOCTOKEN cannot be used • To include Trailer headers for chunking • “Trailer” header must be sent with the first chunk • Headers written after the first chunk will be sent as trailer headers • Trailer headers are sent out with the final empty chunk • CHUNKING(CHUNKEND) will end the chunking • omitting CHUNKLENGTH key word will also end chunking

  49. Decision points for CICS as an HTTP server • HTTP/1.0 or HTTP/1.1 • or non-HTTP request • Use URIMAP to do… • Redirection / Static response / Application determined response • Will I use an analyzer? • Analyzer needs to be specified in TCPIPSERVICE • Will I use a converter? • What type of application? • Web-aware, non Web-aware (commarea based), 3270 application • Header handling, date and time stamp handling • Chunking, pipelining • Can a static response be used instead of application processing? • When and how will I do code conversion? • Security?

  50. CICS as an HTTP client • Processing changes • API changes to replace the LINKable interface • New & changed WEB APIs • Support outbound requests • Support for chunking, pipelining • HTTP date and time format handling • CONVERTTIME, FORMATTIME • URIMAP resource for client processing • Code conversion changes • Support for UTF-8, UTF-16 code page conversions

More Related