View previous topic :: View next topic
|
Author |
Message |
Uday Kumar R
New User
Joined: 07 Nov 2007 Posts: 27 Location: Mumbai
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
John Poulakos
Active User
Joined: 13 Jun 2012 Posts: 178 Location: United States
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
John Poulakos
Active User
Joined: 13 Jun 2012 Posts: 178 Location: United States
|
|
|
|
Yes... I forgot to mention channels. Thank you. |
|
Back to top |
|
|
Uday Kumar R
New User
Joined: 07 Nov 2007 Posts: 27 Location: Mumbai
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
|