× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Jim,

I'm consuming a web service which happens to be provided by a Microsoft
BizTalk Server so this may not be of any help with your DB2 LUW server.

I'm simply converting the timestamp to char and putting quotes around it.
Below is only part of the code to show you what I did.

// CREATE OR REPLACE VARIABLE
// <library>.hrerrmgmt_post_response CHAR(1000)
// LABEL ON VARIABLE <library>.hrerrmgmt_post_response
// IS 'Error management web service response'

/free

Monitor;

// Set SQL options.
Exec SQL
SET OPTION CloSqlCsr = *ENDMOD,
Commit = *NONE,
DatFmt = *ISO,
Naming = *SYS;

D currentTimeStamp...
D s z inz(*sys)
D sqlStmt s 32000a
D postResponse s 1000a
D statusTagPosition...
D s 10i 0

D WEBSERVICENAMESPACE...
D c const('http://schemas.microsoft.bizt-
D alk.practices.esb.com/exceptionhandl-
D ing')

Cmd = 'CHGJOB CCSID(37)';
SysCmd(Cmd: %len(Cmd));

// The Web Service Endpoint URL is stored in a data area, which is
retrieved at run time into DtaAraRcv.Value.
//
https://bizappqaclstr.companyname.ca/HR.ECommerce.EMG/ErrorManagement.svc/SubmitFault

sqlStmt =
'SET hrerrmgmt_post_response = +
systools.httppostclob (' +
QUOTE + %trim(DtaAraRcv.Value) + QUOTE + ',' +
QUOTE + '<httpHeader> +
<header name="Content-Type" value="application/xml"/> +
</httpHeader>' + QUOTE + ', +
( SELECT XMLSERIALIZE ( +
XMLELEMENT(NAME "ns0:FaultMessage", +
XMLNAMESPACES(' + QUOTE + WEBSERVICENAMESPACE + QUOTE + ' AS "ns0"), +
XMLROW(' +
QUOTE + %trim(pApplication) + QUOTE + ' AS "Application",' +

<snip>

QUOTE + %char(currentTimestamp: *iso) + QUOTE + ' AS "DateTime",' +
OPTION ROW "Header") +
) AS CLOB(1M) +
) AS xml_document +
FROM SYSIBM.SYSDUMMY1 ))';

Exec SQL
EXECUTE IMMEDIATE :sqlStmt;

// Check SQL State.
if sqlState <> SQLNORMAL;
// error logic
endIf;

Exec SQL
VALUES hrerrmgmt_post_response INTO :postResponse;

// Check SQL State.
if sqlState <> SQLNORMAL;
// error logic
endIf;

// Examine Status in response variable.
statusTagPosition = %scan('<Status>': postResponse);

if %subst(postResponse: statusTagPosition + 8: 7) <> SUCCESS;
// error logic
endIf;

On-Error;
// error logic
EndMon;

Yours truly,

Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Work: (416) 675-9200 ext. 89224
Cell: (416) 317-3144


On 19 January 2016 at 14:42, Jim Franz <franz9000@xxxxxxxxx> wrote:

(Posting to RPG list due to RPGLE web service program to pass timestamp as
parm)
I have a requirement to pass timestamp in a format where I don't see RPGLE
has an option other than generating a text field.
This is the sample provided and through SOAPUI it works
<uws:StartDate>2015-12-08T14:26:46</uws:StartDate>

Every variation I try fails, and I have verified on the target system it is
a "TIMESTAMP".
2015-12-08-14.26.46 fails - (nothing selected)
2015-12-08-14.26.46.000 and .000000 both fail

Am I missing some understanding of timestamps between DB2 for i and DB2 LUW
(and this is either Linux or unix running Websphere with DB2 9.7.x)
or is there some edit possible in a timestamp?
ILE RPG Reference V7R1 says a Timestamp Data Type is always length of 26
and format is
yyyy-mm-dd-hh.mm.ss.mmmmmm

Jim
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.