× 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.



Larry,

I don't work with that particular product, but I do work with a C-based product from Vertex... My rpg prototypes for these C functions follow a pattern more like this...

Connection handles are usually just pointers, as it appears is the session handle... Session handle is expected to be I/O, so you cannot use Const or Value... I have had some odd issues with CWIDEN, so my prototypes do not use this feature. I believe Vertex typically write their APIs to use FIXED STORAGE LENGTHS for character data, so it's imperative to declare your local storage for passing Character data to be of the length specified in the Vertex C include member. They typically have some constants defined for the "storage length" used for character data fields. Check your C prototypes in the product's H file. If the field is expected to pass 30 bytes, the C prototype typically defines the storage length to be 31. I presume this is one extra byte initialized to null character (x'00) so that their functions will accept fixed length OR varying length C Character strings...

Here's my take on your prototype...

D VprtXML PR EXTPROC('VprtXML')

D pConn * value

D pSession *

D pXmlBuf 65500a

D pXmlResult 65500a

D pResultSize 10I 0


The sizing of the xml fields is unknown, so those may need to be sized differently depending on the C includes specifying a storage length for these.

Hope I didn't get this too wrong, but without seeing the H includes, it's nearly impossible to clarify...

Hth,
-Eric DeLong

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Larry Moore
Sent: Monday, September 16, 2013 2:20 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Convert C Prototype to RPG

I need to interface our payroll program with Vertex Q Series payroll tax
software. The Vertex functions are written in C and our payroll programs
are in RPG. I am not proficient in the C language and Vertex support
doesn't know RPG so I'm struggling to prototype their functions in my
program. Has anyone integrated with Vertex using their Enhance
Integration XML api's?



Here's the definition of one of their functions:



Parameter Use Description


---------- ----
-----------------------------------------

lConnHdl I The connection
handle returned from VprtOpenPRT

Session I/O Pointer to the
session handle, which will hold the context for this session. Should be
initialized to NULL before the first call.

XmlBuf I Character string
containing XML request

XmlResult O Pointer to character
string where the result will be stored


pResultSize I On input, the size of
the XmlResult buffer


PREFIX int POSTFIX VprtXML(tVprtConn lConnHdl, void **pSession, char
*XmlBuf, char *XmlResult, long *pResultSize);




Here's an example of what I tried but it doesn't appear to be correct
because nothing happens when I execute. Any suggestions? I am able to
open a connection to the database and create the connection handle using
another api.



D VprtXML PR EXTPROC(*CWIDEN: 'VprtXML')

D pConn * value options(*string)

D pSession * value options(*string)

D pXmlBuf * value options(*string)

D pXmlResult * value options(*string)

D pResultSize 10I 0



xml = '<QUERY> ' +

'<PAYDATE>20130901</PAYDATE> ' +

'<GEOSTATE>39</GEOSTATE> ' +

'<GEOCNTY>129</GEOCNTY> ' +

'<GEOCITY>2560</GEOCITY> ' +

'<TAXID>537</TAXID> ' +

'<GET> ' +

'<TAXNAMES/> ' +

'</GET> ' +

'</QUERY>' + NULL;



xml = cvtCCSID( xml: 819: NULL);

pConnection = %addr(lConHnd);

pSession = %addr(session);

pXmlBuf = %addr(xml);





VprtXML(pConnection: pSession: pXmlBuf: pXmlResult:
pResultSize);



Thanks,



Larry Moore * Covenant Transportation Group * Systems Analyst *
423.463.3374




______________________________________________________________________
This communication and the information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender immediately and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. Covenant Transportation Group, Inc. and it's subsidiary Covenant Transport, Inc. accept no liability for any damages caused by any virus transmitted by this email.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.