Wendy; Here is the code that I am work with:
0001:SUBROUTINE CALLHTTP(MSG.PARAM,DATA.SEND,DATA.RTN,STATUS,HTTP.STATUS,ERRMSG) 0002: 0003: * Program Name : CALLHTTP 0004: * Program Date : 04/11/2003 0005: * Program Written By : Jeff Weitkamp 0006: * Program Description : Handle communications with MARSHA using HTTP 0007: * protocol. 0008: * Program Source File : RES.BP 0009: 0010: * Overview: 0011: * ====================================================================== 0012: * This routine will handle the functions to execute the messaging 0013: * to a URL utilizing CallHTTP universe functionality. 0014: * Passed Variable Description 0015: * MSG.PARAM - Contains data required to transmit the message 0016: * DATA.SEND - Message to be sent. 0017: * DATA.RTN - Message recieved from external source 0018: * STATUS - Result of function call. Non zero indicated an Error 0019: * HTTP.STATUS - Result code from HTTP transsion. 0020: * ERRMSG - Any error message to be returned to the calling 0021: * program 0022: * ====================================================================== 0023: * Includes 0024: * ====================================================================== 0025: * [Item] [Description] 0026: * ------------------- -------------------------------------------- 0027: * 0028: * ====================================================================== 0029: * External Routines: 0030: * ====================================================================== 0031: * [Item] [Description] 0032: * ------------------- -------------------------------------------- 0033: * COMMUNICATION.CONTROL.CLASS Access to items in the 0034: * COMMUNICATIONS.CONTROL file. 0035: * ====================================================================== 0036: * Version 1.0 0037: * Modification History: 0038: * ====================================================================== 0039: * [Date] [Resource] [Description] 0040: * ---------- ----------- --------------------------------------------- 0041: * 04/11/2003 JEFWEI Created 0042: * 10/14/2003 MARLAU Added Debuging tool 0043: * 10/16/2003 MARLAU Added set Default vaules 0044: * 01/26/2004 MARLAU Added Secure Handle and Secure Request 0045: * ====================================================================== 0046: * 0047: * 0048: * Initialize variables 0049: * 0050: PROMPT CHAR(0) 0051: URL = MSG.PARAM<2> 0052: TIMEOUT = MSG.PARAM<3> 0053: RETRY.MAX = MSG.PARAM<4> 0054: HDR.NAME = MSG.PARAM<5> 0055: HDR.VALUE = MSG.PARAM<6> 0056: MSG.TYPE = MSG.PARAM<7> 0057: DEF.NAME = MSG.PARAM<10> ; * Default Setup 0058: DEF.VALUE = MSG.PARAM<11> ; * Default Values 0059: * 0060: CONFIG.INFO='' ; * Used for Show 0061: HANDLE = '' 0062: SECUREHANDLE='' ; * Secure Handle for Https 0063: STATUS = '' ; * Result of function call 0064: HTTP.STATUS = '' ; * HTTP status code recieved 0065: LF = CHAR(10) 0066: EQU MCU TO 'MCU' 0067: 0068:* 0069: IF MSG.TYPE = '' THEN 0070: MSG.TYPE = 'POST:text/xml' ; * Default Type 0071: END 0072: * 0073: * Set Debug Flag 0074: * 0075: IF ERRMSG#'' THEN 0076: DEBUG.FLAG=1 0077: ERRMSG='' 0078: END ELSE 0079: DEBUG.FLAG=0 0080: END 0081: 0082: ************************ 0083: * 0084: * set HTTP Defaults 0085: * 0086: IF DEF.NAME#'' THEN 0087: DCNT=DCOUNT(DEF.NAME<1>,@VM) 0088: FOR I=1 TO DCNT 0089: NAME=DEF.NAME<1,I> 0090: VALUE=DEF.VALUE<1,I> 0091: STATUS=setHTTPDefault(NAME,VALUE) 0092: IF STATUS THEN 0093: ERRMSG="CallHTTP function 'setHTTPDefault' failed." 0094: ERRMSG:=' Status = ':STATUS 0095: RETURN 0096: END 0097: NEXT I 0098: END 0099: 0100: * Create CallHTTP request 0101: * 0102: * Nexus - Start 0103: * 0104: 0105: URL.TEST=OCONV(URL,MCU) 0106: IF INDEX(URL.TEST,'HTTPS',1) THEN 0107: STATUS=createSecurityContext(SECUREHANDLE,'') 0108: IF STATUS THEN 0109: ERRMSG="CallHTTP function 'createSecurityContext' " 0110: ERRMSG:='failed. Status = ':STATUS 0111: RETURN 0112: END 0113: DEPTH=0 ; * Depth of Authenication 0114: USEDBY=2 ; * Clinet 0115: STATUS=setAuthenticationDepth(SECUREHANDLE,DEPTH,USEDBY) 0116: IF STATUS THEN 0117: ERRMSG="CallHTTP function 'setAuthenticationDepth' " 0118: ERRMSG:=' failed. Status = ':STATUS 0119: RETURN 0120: END 0121: STATUS=showSecurityContext(SECUREHANDLE,CONFIG.INFO) 0122: STATUS = createSecureRequest(URL,MSG.TYPE,HANDLE,SECUREHANDLE) 0123: IF STATUS THEN 0124: ERRMSG="CallHTTP function 'createSecureRequest' " 0125: ERRMSG:=' failed. Status = ':STATUS 0126: RETURN 0127: END 0128: END ELSE 0129: STATUS=createRequest(URL,MSG.TYPE,HANDLE) 0130: IF STATUS THEN 0131: ERRMSG = "CallHTTP function 'createRequest'failed. " 0132: ERRMSG:=" Status = ":STATUS 0133: RETURN 0134: END 0135: END 0136: * 0137: * Nexus - End 0138: * 0139: 0140: *********************** 0141: 0142: * Set Header 0143: * 0144: * Nexus - Start 0145: * 0146: IF HDR.VALUE # "" THEN 0147: STATUS = setRequestHeader(HANDLE,HDR.NAME,HDR.VALUE) 0148: IF STATUS THEN 0149: ERRMSG = "CallHTTP function 'setRequestHeader' failed." 0150: ERRMSG:= 'Status = ':STATUS 0151: RETURN 0152: END 0153: END 0154: * 0155: * Nexus - End 0156: * 0157: 0158: ********************* 0159: 0160: * Submit request 0161: 0162: TRY.CNT = 0 0163: STATUS = 999 0164: LOOP 0165: TRY.CNT += 1 0166: STATUS = submitRequest(HANDLE,TIMEOUT,DATA.SEND,XML.RESULT.HDR,DATA.RTN,HTTP.STATUS) 0167: IF STATUS THEN 0168: ERROR.KEY = 'HTTP*ERROR*':STATUS 0169: CC.PARAM = '' 0170: HTTP.ERR.MSG = '' 0171: CALL COMMUNICATION.CONTROL.CLASS(ERROR.KEY,'GET',HTTP.ERR.MSG,CC.PARAM) 0172: IF CC.PARAM<4> THEN 0173: HTTP.ERR.MSG = CC.PARAM<5> 0174: END 0175: ERRMSG = "CallHTTP function 'submitRequest' failed. Status " 0176: ERRMSG:='=':STATUS:" ":HTTP.ERR.MSG:" - ":HTTP.STATUS 0177: END 0178: IF DEBUG.FLAG THEN 0179: CRT 'Errmsg : ':ERRMSG 0180: CRT 'Try.Cnt : ':TRY.CNT 0181: CRT 'Status : ':STATUS 0182: END 0183: UNTIL STATUS = 0 OR TRY.CNT GE RETRY.MAX DO 0184: REPEAT 0185: 0186: RETURN The submitRequest is returning a 3, network error. Thanks Mark Laursen Marriott Vacation Club International (863) 688-7700 Ext. 4339 [EMAIL PROTECTED] This communication contains information from Marriott International, Inc. that may be confidential. Except for personal use by the intended recipient or as expressly authorized by the sender, any person who receives this information is prohibited from disclosing, copying, distributing, and/or using it. If you have received this communication in error, please immediately delete it and all copies, and promptly notify the sender. Nothing in this communication is intended to operate as an electronic signature under applicable law. -----Original Message----- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 9:50 AM To: U2 Users Discussion List Subject: RE: Using CALLHTTP with a Secure site > From: [EMAIL PROTECTED] > I am trying to do a CALLHTTP to a secure site. I used the > createSecureRequest and that returned a 0 for status. I then > did the submitRequest to the site with data that I needed to > send. I receive a status of 2 back, which is a timeout error. > I must of missed something. In the createSecureRequest, the > security_context I am sending null, does this need to be something? Does this example help at all? http://www.pickwiki.com/cgi-bin/wiki.pl?CallHTTPWithSSL If not, please post a small example that doesn't work and someone can take a look. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management _______________________________________________ u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users _______________________________________________ u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users
