IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CICS Web client request


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Uday Kumar R

New User


Joined: 07 Nov 2007
Posts: 27
Location: Mumbai

PostPosted: Fri May 17, 2019 9:13 pm
Reply with quote

Hi.

Looking for suggestion on the below request.

I am using CICS as web client and requesting an HTTP Server through CICS Web Converse Command. The request has performed using Cobol program (no URImap Involved) and in text/xml format. The CICS request is as follows.

Code:


EXEC CICS WEB OPEN           
     SESSTOKEN(WS-SESSONTOKEN)
     HOST     (MY-HOST)     
     HTTP                   
     RESP     (WS-RESP)     
     RESP2    (WS-RESP2)     
END-EXEC.                   

EXEC CICS WEB CONVERSE                     
    GET                                     
    SESSTOKEN   (ws-sesstoken)             
    PATH        (MY-PATH)                   
    PATHLENGTH  (MY-PATH-LENGTH)           
    MEDIATYPE   (MY-MEDIATYPE)             
    QUERYSTRING (MY-QUERY-STRING)           
    QUERYSTRLEN (LENGTH OF MY-QUERY-STRING)
    STATUSCODE  (WC-HTTP-RESP-CODE)         
    STATUSTEXT  (WC-HTTP-RESP-REAS)         
    STATUSLEN   (WC-HTTP-RESP-REAS-LGTH)   
    INTO        (WS-HTTP-RESP)             
    TOLENGTH    (WS-HTTP-RESP-LGTH)         
    CLICONVERT                             
    CLOSE                                   
    RESP        (WS-RESP)                   
    RESP2       (WS-RESP2)                 
END-EXEC.                                   

EXEC CICS WEB CLOSE
      SESSTOKEN(WS-SESSONTOKEN)
END-EXEC.                                 



HOST: is the URL address used.

I received the response for the above request from the HTTP Server at the variable WS-HTTP-RESP. The details are as follows.

WC-HTTP-RESP : <?xml version="1.0" encoding="utf-8"?><response success="true""true"><people> .... (message follows) ........</Person></people></response>

The query is, may i know what would be first 3 bytes represents. While i am trying to parse the xml system throwing an error message stating unacceptable characters at the xml string.

The first 3 characters are :

Code:

<?xml version
58A46A994A89A899
7BBCF74305592965


Any suggestions please.

Note: (By removing first 3 bytes, system successfully parse the xml which received at the field WS-HTTP-RESP)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed May 29, 2019 8:59 pm
Reply with quote

How about trying with NOCLICONVERT ? or do you have same issue when you do SEND and RECEIVE? Also did you explore BODYCHARSET option?
Back to top
View user's profile Send private message
John Poulakos

Active User


Joined: 13 Jun 2012
Posts: 178
Location: United States

PostPosted: Tue Jun 04, 2019 7:46 pm
Reply with quote

For a web client or provider, I use CICS container support and SOAP or REST to handle the XML. IBM has message handlers for the client pipelines. It's much easier to support and maintain.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Jun 04, 2019 9:46 pm
Reply with quote

Quote:
I use CICS container support and SOAP or REST to handle the XML. IBM has message handlers for the client pipelines. It's much easier to support and maintain.
CHANNELS and CONTAINERS , You can use it here as well for HTTP service but its optional hence in INTO we don't see that in this case and specify xml type in MEDIATYPE. I hope that's what you meant to say when you said about CONTAINER support.
Back to top
View user's profile Send private message
John Poulakos

Active User


Joined: 13 Jun 2012
Posts: 178
Location: United States

PostPosted: Tue Jun 04, 2019 10:17 pm
Reply with quote

Yes... I forgot to mention channels. Thank you.
Back to top
View user's profile Send private message
Uday Kumar R

New User


Joined: 07 Nov 2007
Posts: 27
Location: Mumbai

PostPosted: Wed Jun 05, 2019 12:59 am
Reply with quote

Hi Rohit,

Rohit Umarjikar wrote:
How about trying with NOCLICONVERT ? or do you have same issue when you do SEND and RECEIVE? Also did you explore BODYCHARSET option?


I was already tried with the option NOCLICONVERT, the result is same. I noticed the same three characters with or without using NOCLICONVERT option.

I did tried with the SEND and receive, but it got failed. Looks to me CICS created some inbuilt headers while sending the request to HTTP server during the process. I think i need to use HTTPHEADER command to include them properly and format them before i sent the request.

I will explore the BODYCHARSET option and post the results.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Jun 05, 2019 2:35 am
Reply with quote

Code:
MEDIATYPE(data-value)
Specifies the data content of any message body provided, for example text/xml. You must specify a 56-byte area for MEDIATYPE. The media type is up to 56 alphanumeric characters, including appropriate punctuation, but not spaces. For more information on media types, see IANA media types and character sets . CICS checks that the format of the media type is correct, but does not check the validity of the media type against the data content. CICS uses this information to produce the Content-Type header for the message.
For requests that require a body, you must specify the MEDIATYPE option. There is no default. However, if the required Content-Type header must contain spaces or more than 56 characters, the application can provide it using the WEB WRITE HTTPHEADER command. In this case, do not specify the MEDIATYPE option.
The supplied media type is used to determine whether code page conversion is required under the following circumstances:
If you are sending a message from a buffer, using the FROM option, and the CLIENTCONV and CHARACTERSET options are not specified.
If you are sending a message from a document, using the DOCTOKEN option, and the CLIENTCONV and CHARACTERSET options are not specified.
If you are sending a message from a named container, using the CONTAINER option, and either CLICONVERT is specified, or the CLIENTCONV and CHARACTERSET options are not specified.
If the supplied media type is text, the message is converted. If the supplied media type is nontext, the message is not converted.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts How to avoid duplicating a CICS Web S... CICS 0
Search our Forums:

Back to Top