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



Hello,

I've just loaded and installed the program WSDL2RPG. Now I try to generate a little test-program for the web-service WriteBizMessage described in the wsdl:

http://igh2.exigo.ch/DataExpert2/DE_WebService.svc?singleWsdl

The generated program comes here:

* =====================================================================
* Generated by WSDL2RPG 1.16.5 / 08.03.2017
* Built on Mai 19, 2017 (13:59:27)
* Built for V7R2M0
* Based on WS_PGM 1.16.5 - 08.03.2017
* =====================================================================
* Sample program to show how to call the
* BasicHttpBinding_IDE_WebService_WriteBizMessage()
* Web service.
* =====================================================================
* Pre-Compiler tags used by STRPREPRC to retrieve creation
* commands from the source member.
* ---------------------------------------------------------------------
* >>PRE-COMPILER<<
* >>CRTCMD<< CRTRPGMOD MODULE(&LI/&OB) +
* SRCFILE(&SL/&SF) +
* SRCMBR(&SM);
* >>COMPILE<<
* >>PARM<< TRUNCNBR(*NO);
* >>PARM<< DBGVIEW(*LIST);
* >>PARM<< OPTION(*EVENTF);
* >>END-COMPILE<<
* >>EXECUTE<<
* >>CMD<< CRTPGM PGM(&LI/&OB) +
* MODULE(*PGM) +
* BNDSRVPGM(*LIBL/WS000 +
* *LIBL/WSDL2RPGRT +
* ) +
* DETAIL(*BASIC) +
* ACTGRP(*NEW);
* >>END-PRE-COMPILER<<
* =====================================================================
H DEBUG
H OPTION(*SRCSTMT : *NODEBUGIO)
H EXTBININT(*YES)
*
FQSYSPRT O F 80 PRINTER OFLIND(*in70)
*
* Include generated web service stub module to
* define the prototype of the web service procedure
* and the required type definitions (aka reference fields).
/DEFINE PROTOTYPE_WS000101
CPY /COPY JGVWSDL/QWSDL2RPG,WS000101
/UNDEFINE PROTOTYPE_WS000101
*
* Program entry point
D WSKWC001...
D PR
*
* Prints a given message to QSYSPRT.
D printMsg...
D PR extproc('print')
D i_text 128A value varying options(*nopass)
*
* Sends a message to the command line.
D sndMsg...
D PR extproc('sndMsg')
D i_text 128A value varying
*
* =====================================================================
* Program entry point
* =====================================================================
D WSKWC001...
D PI
*
* Web service error message text
D errText S like(wsdl_errText_t ) inz
*
* Request SOAP headers and message
* These fields needs to be filled with reasonable values
* right before calling the web service.
D parameters DS likeds(tns_WriteBizMessage_t)
D inz
* Response SOAP headers and message
* This structure contains the result values returned by
* the web service.
D WriteBizMessageResponse...
D DS likeds(tns_WriteBizMessageResponse_t)
D inz
*
* Text of messages sent to the command line
D text S 128A varying inz
*
* Dynamic array index fields
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/free

// Enable/disable http api debug log
// (Enable the http api debug log in case of problems with the web service)
// BasicHttpBinding_IDE_WebService_Port_setHttpDebug(
// *ON: '/tmp/httpapi_debug.txt'); // Default path of http api

// Specify a proxy server if your network requires it.
// BasicHttpBinding_IDE_WebService_Port_setHttpProxy(
// 'your.proxy.server': 8080);

// Set the parameter values of the request message
// of the web service.
// assign values here
parameters.username = 'string';
parameters.password = 'string';
parameters.bizMsg = 'string';
parameters.attachment.Content = 'base64';
parameters.attachment.FileExtension = 'string';

// Enable preemptive authetication
// 1. parameter: WSDL_AUTH_BASIC or WSDL_AUTH_MD5_DIGEST
// 2. parameter: (optional) cTrue for proxy authentication
// cFalse for server authentication (default)
// BasicHttpBinding_IDE_WebService_Port_setPreemptiveAuthentica...
// tion(
// WSDL_AUTH_BASIC);

// Now let's call the web service.
WriteBizMessageResponse =
BasicHttpBinding_IDE_WebService_WriteBizMessage(
parameters:
errText);

// If the Web service finished successfully ...
B01 if (not BasicHttpBinding_IDE_WebService_Port_isError());
// ... get response data from response data structure

sndMsg('*** Success ***');
X01 else;
// ... else show error messages ordered by priority:
// 1. HTTP error information
text = %char(
BasicHttpBinding_IDE_WebService_HttpError_getCode()
) + ': ' +
BasicHttpBinding_IDE_WebService_HttpError_getText()
;
sndMsg(text);
// 2. SOAP error information
B02 if (BasicHttpBinding_IDE_WebService_SoapError_getCode()
<> '');
text = BasicHttpBinding_IDE_WebService_SoapError_getCode()
+ ': ' +
BasicHttpBinding_IDE_WebService_SoapError_getText()
;
sndMsg(text);
E02 endif;
// 3. XML parser error information
B02 if (BasicHttpBinding_IDE_WebService_XmlError_getCode()
<> 0);
text = %char(BasicHttpBinding_IDE_WebService_XmlError_get...
Code())
+ ': ' +
BasicHttpBinding_IDE_WebService_XmlError_getText()
;
sndMsg(text);
E02 endif;
E01 endif;

B01 if (%open(QSYSPRT));
close QSYSPRT;
E01 endif;

*inlr = *on;

/end-free
*
* =====================================================================
* *** private ***
* Prints a given message to QSYSPRT.
* =====================================================================
P printMsg...
P B
D PI
D i_text 128A value varying options(*nopass)
*
* Local fields
D lineOutput DS 80 inz
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/free
B01 if (not %open(QSYSPRT));
open QSYSPRT;
E01 endif;
B01 if (%parms() >= 1);
lineOutput = i_text;
E01 endif;
write QSYSPRT lineOutput;
/end-free
P E
*
* =====================================================================
* *** private ***
* Sends a message to the command line.
* =====================================================================
P sndMsg...
P B
D PI
D i_text 128A value varying
*
* Local fields
D msgKey S 4A inz
*
* Qualified message file name
D qMsgF DS qualified inz
D name 10A
D lib 10A
*
* API error code
D errCode DS qualified inz
D bytPrv 10I 0
D bytAvl 10I 0
D excID 7A
D reserved 1A
D excDta 256A
*
* Send Program Message (QMHSNDPM) API
D QMHSNDPM PR extpgm('QMHSNDPM')
D i_msgID 7A const
D i_qMsgF 20A const
D i_msgData 32767A const options(*varsize )
D i_length 10I 0 const
D i_msgType 10A const
D i_callStkE 32767A const options(*varsize )
D i_callStkC 10I 0 const
D o_msgKey 4A
D io_ErrCode 32767A options(*varsize )
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/free
clear qMsgF;
qMsgF.name = 'QCPFMSG';
qMsgF.lib = '*LIBL';
clear errCode;
errCode.bytPrv = %size(errCode);
QMHSNDPM('CPF9897': qMsgF: i_text: %len(i_text): '*INFO'
: '*CTLBDY': 1: msgKey: errCode);
return;
/end-free
P E
*
If I compile it I receive the messages RNF0256, RNF0257 and RNF7023. I can't find the reasons for these messages. What do I do wrong?

Best regards

Jan




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

This mailing list archive is Copyright 1997-2022 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.