Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
CICS Web client request

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: CICS Web client request
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.

When i try to understand from the Webconverse command explanation [url](https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.5.0/reference/commands-api/dfhp4_webconverse.html)[/url] not able to find out (may be i am wrong).

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

Senior Member


Joined: 21 Sep 2010
Posts: 2165
Location: NY,USA

PostPosted: Wed May 29, 2019 8:59 pm    Post subject:
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: 126
Location: United States

PostPosted: Tue Jun 04, 2019 7:46 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2165
Location: NY,USA

PostPosted: Tue Jun 04, 2019 9:46 pm    Post subject:
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: 126
Location: United States

PostPosted: Tue Jun 04, 2019 10:17 pm    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2165
Location: NY,USA

PostPosted: Wed Jun 05, 2019 2:35 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Identify who, from where, sign on CIC... Weilin Wen CICS 1 Thu May 09, 2019 1:23 pm
No new posts Need suggestion on CICS READ UPDATE subratarec CICS 8 Fri May 03, 2019 2:23 pm
No new posts logically splitting a CICS region - help jzhardy CICS 3 Tue Mar 26, 2019 4:52 am
No new posts Suggestion on KSDS VSAM READ in CICS subratarec CICS 5 Wed Feb 13, 2019 4:42 pm
No new posts Convert CICS Modules to AMODE ANY CICSWOLF PL/I & Assembler 6 Fri Feb 08, 2019 7:10 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us