Topic
2 replies Latest Post - ‏2007-11-02T13:40:56Z by SystemAdmin
ek1975
ek1975
2 Posts
ACCEPTED ANSWER

Pinned topic CICS Web Service & USPS address verification tool

‏2007-01-12T19:01:41Z |
I posted this message in the wrong forum yesterday and I was asked to post here.

I am sending this URL string to USPS and I am
codehttp://testing.shippingapis.com/ShippingAPITest.dll?
API=Verify&XML=<AddressValidateRequest%20USERID="xxxx"><Address%
20ID="0"><Address1></Address1><Address2>6406%20Ivy%
20Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5>
<Zip4></Zip4></Address></AddressValidateRequest>[/code]

I get a good response (for a valid USERID) with CICS WEB OPEN & WEB SEND
commands but I am not getting any results back, I get an OK Status with HTTP
return code 200 with WEB RECEIVE (RESP and RESP2 are zeroes).

This is how my WEB commands look:
codeExec cics web open host(ws-hostname) HTTP sesstoken(ws-sessiontoken) resp
(ws-resp-code) End-exec[/code]
where ws-hostname = "testing.shippingapis.com"

codeExec cics web send sesstoken(ws-sessiontoken) GET path(ws-path) pathlength
(20) querystring(ws-querystring) querystrlen(240) resp(ws-resp-code) End-exec
[/code]

where ws-path = "/Shippingapis.dll" and ws-querystring is set
to "API=Verify&XML=<AddressValidateRequest%20USERID="xxxx"><Address%
20ID="0"><Address1></Address1><Address2>6406%20Ivy%
20Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5>
<Zip4></Zip4></Address></AddressValidateRequest>"

My web receive command looks like:
codeExec cics web receive into(ws-receive-area) length(ws-receive-length)
maxlength(500) sesstoken(ws-sessiontoken) statuscode (ws-statuscode) statustext
(ws-statustext) statuslen (ws-statuslen) resp(ws-resp-code)End-exec[/code]

I see 200 in ws-statuscode and "OK" in ws-statustext, but ws-receive-area is
set to spaces. My TCP programmer can see the results coming back, but my
program and ws-receive-area are not getting it, although ws-statuscode and ws-
statustext are getting populated.

if you could see something I'm doing wrong or if there are alternate ways of
accomplishing this task, let me know please... I would really appreciate your
help.
Updated on 2007-11-02T13:40:56Z at 2007-11-02T13:40:56Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    260 Posts
    ACCEPTED ANSWER

    CICS as a CLIENT that connect to a WEB SERVER

    ‏2007-10-25T23:58:48Z  in response to ek1975

    I am working on a CICS program that is a screen for user to browse and update
    the correspondence info. Currently, the attachments of the correspondences are still
    stored in the file cabinet. User proposed to scan and store all the correspondence
    documents in the WEB SERVER.

    The request is to allow the user to view the document online by entering 'Y'
    into VIEW ATTACHED CORR(Y/N), then the CICS program connects to
    the WEB SERVER where store all the documents and pass the parameters
    which are the FILE NO and CORRESPONDENCE NO to retrieve the particular
    document back and display on the BROWSER for them to view.
    User can close the BROWSER and go back to the same CICS screen.
    I have never done this kind of request before.

    First, I was testing and expecting to see if the control can go from CICS to
    the WEB SITE, after the 'Y' was entered into the VIEW ATTACHED CORR(Y/N),
    however, it doesn't work.

    I am providing my coding as follows, if you could see something I'm doing wrong
    or if that's not a right way of accomplishing this task, let me know please....
    I would really appreciate your help.

    The following are my working storage and WEB commands:

    working storage look:

    01 WS-HOSTNAME PIC X(50) VALUE '10.5.64.34'.
    01 WS-PATH PIC X(50) VALUE '/INDEX.HTML'.
    01 WS-SESSIONTOKEN PIC S9(16) USAGE BINARY.
    01 WS-RESP-CODE PIC X(16).
    01 WS-RECEIVE-AREA PIC X(500).
    01 WS-RECEIVE-LENGTH PIC X(10).
    01 WS-STATUSCODE PIC X(10).
    01 WS-STATUSTEXT PIC X(50).
    01 WS-STATUSLEN PIC X(10).
    WEB commands look:

    IF VIEW-ATTACHED-CORR = 'Y'

    EXEC CICS WEB OPEN HOST(WS-HOSTNAME) HTTP
    SESSTOKEN(WS-SESSIONTOKEN) RESP(WS-RESP-CODE)
    END-EXEC

    EXEC CICS WEB SEND SESSTOKEN(WS-SESSIONTOKEN)
    GET PATH(WS-PATH) PATHLENGTH(20) RESP(WS-RESP-CODE)
    END-EXEC

    EXEC CICS WEB RECEIVE INTO(WS-RECEIVE-AREA)
    LENGTH(WS-RECEIVE-LENGTH) MAXLENGTH(500)
    SESSTOKEN(WS-SESSIONTOKEN) STATUSCODE(WS-STATUSCODE)
    STATUSTEXT(WS-STATUSTEXT) STATUSLEN (WS-STATUSLEN)
    RESP(WS-RESP-CODE)
    END-EXEC.

    The following are the some values of the program: I don't get values on both
    ws-statuscode, and ws-statustext

    01 PWC200:>WS-RECEIVE-LENGTH X'00000000000000000000'
    01 PWC200:>WS-SESSIONTOKEN +2776996935855243616
    01 PWC200:>WS-STATUSCODE X'00000000000000000000'
    01 PWC200:>WS-STATUSLEN X'00000000000000000000'
    PWC200 ---1----+----2----+----3----+----4----+----5 LINE: 748
    Shirley
    • SystemAdmin
      SystemAdmin
      260 Posts
      ACCEPTED ANSWER

      Re: CICS as a CLIENT that connect to a WEB SERVER

      ‏2007-11-02T13:40:56Z  in response to SystemAdmin
      Shirley,
      Were you expecting CICS to launch a web browser on your workstation?
      I've never used this API, but it looks to be something that simply
      passes requests to a web server and returns the web page data directly
      to your CICS program's buffer. See the doc at:

      http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHTLB03/1.3.4
      Shirley Lin wrote:
      >
      > I am working on a CICS program that is a screen for user to browse and update
      > the correspondence info. Currently, the attachments of the correspondences are still
      > stored in the file cabinet. User proposed to scan and store all the correspondence
      > documents in the WEB SERVER.
      >
      > The request is to allow the user to view the document online by entering 'Y'
      > into VIEW ATTACHED CORR(Y/N), then the CICS program connects to
      > the WEB SERVER where store all the documents and pass the parameters
      > which are the FILE NO and CORRESPONDENCE NO to retrieve the particular
      > document back and display on the BROWSER for them to view.
      > User can close the BROWSER and go back to the same CICS screen.
      > I have never done this kind of request before.
      >
      > First, I was testing and expecting to see if the control can go from CICS to
      > the WEB SITE, after the 'Y' was entered into the VIEW ATTACHED CORR(Y/N),
      > however, it doesn't work.
      >
      > I am providing my coding as follows, if you could see something I'm doing wrong
      > or if that's not a right way of accomplishing this task, let me know please....
      > I would really appreciate your help.
      >
      > The following are my working storage and WEB commands:

      Don Poitras - zSeries R & D - SAS Institute Inc. - SAS Campus Drive
      mailto:sasdtp@sas.com (919)531-5637 Fax:677-4444 Cary, NC 27513