[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Base64 Encoder



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Solved by private email:

If I correctly understand your program, then you want to use
Marshaller_toBase64Binary() outside of the generated modules. Also I
assume that 'a_tns_submit.Payload' is of type "string" and not "base64",
because if it was "base64", then WSDL2RPG would have selected
Marshaller_toBase64Binary() instead of Marshaller_toString().

So actually the easiest way to get things working is to change the
generated WS_OPER (= VRA10001) module by hand where "*.Payload" is
marshalled to XML. (I wonder why the wsdl file does not specify base64.)

But in case you want to keep things as they are, then you need to add
copy book PWSDL2R98 to your VRA200 by hand.

The way you did it does not work, because the generated operation module
is the copy book and the executable code all in one. The following
statement selects the copy book part of VRA10001:

/DEFINE PROTOTYPE_VRA10001
/COPY QRPGLESRC,VRA10001
/UNDEFINE PROTOTYPE_VRA10001

But this part does not include the /copy statement of PWSDL2R98.

Things are easy to understand by looking at example WS0001. Module
WS000101 is the generated operation module. The first part of the module
defines the prototype of the actual web service procedure
"ZipCodeSoap_CityStateToZipCode":

*
D ZipCodeSoap_CityStateToZipCode...
D                 PR                  likeds(s0_CityStateToZipCodeRespon...
D                                     se_t)
D                                     extproc('ZipCodeSoap_CityStateToZipC+
D                                     ode')
D  i_s0_CityStateToZipCode...
D                                     likeds(s0_CityStateToZipCode_t)
/IF NOT DEFINED(NO_CONST_ON_INPUT_PARAMETERS)
D                                     const
/ENDIF
D  o_msg                              like(wsdl_errText_t )

This part of the module ends at the /EOF statement:

/ENDIF
/IF DEFINED(PROTOTYPE_WS000101)
/EOF
/ENDIF

But copy book PWSDL2R98 is defined after the /EOF and hence cannot be
found when "PROTOTYPE_WS000101" is defined.

On the other hand PWSDL2R98 is found when you disable
"PROTOTYPE_WS000101". But then WS000101T (aka your VRA200) does not
compile because WS000101 (aka your VRA10001) is not include as a copy
book but as the source member to be compiled. Remember, the first part of
WS000101 is the copy book and the second part contains the executable
statements. Which part of the module is used, is controlled by the
compiler condition "PROTOTYPE_WS000101".

Sounds somewhat crazy, doesn't it? But it should be easy to follow when
you study WS000101T and WS000101.

It might have been better if I had decided to generate separate copy
books for the generated modules.


Am 11.09.2014 16:30, schrieb Kjartan Þór Guðmundsson:
> I'm using WSDL2RPG to contact web services. ? I generated a code,
> that I can connect to the web service with no problem. ? I also made
> an XML-string that I want to send to the web service. ? But I got an 
> error, and was told by the web service admin that I have to encode
> the BASE64 before I send the XML-string to the web service. ? I tried
> to use the Marshall_toBinary64 prototype to encode the text. ? The
> problem is that ? I always get an error when I compile the program,
> and when I look through the error list, I can't see the copy member
> for the encoding. In my program I have ?  ?  ?  /DEFINE
> PROTOTYPE_VRA10001 ?  ?  ?  /COPY lag40_dev/qrpglesrc,VRA10001 ?  ?  ?
> /UNDEFINE PROTOTYPE_VRA10001 and in the VRA10001 I have ? CPY ? /COPY
> WSDL2RPG/QBASICS1,PBASICS1 ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?  ?  ?
> Tools/400 Runtime Library ? CPY ? /COPY WSDL2RPG/QMIME,PMIME ?  ?  ?
> ?  ?  ?  ?  ?  ?  ?  ?  ? ?  ?  ?  ?  ?  ?  ? Tools/400 MIME Parser ?
> CPY ? /COPY WSDL2RPG/QMIME,HTTPMIME_H ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
> ?  ?  ? Tools/400 MIME Parser to HTTP API adapter ? CPY ? /COPY
> LIBHTTP/QRPGLESRC,HTTPAPI_H ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?  ?  ?  ?
> HTTP-API Service Program ? CPY ? /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R70 ?
> ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG: HTTP API Header Extensions ? CPY ?
> /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R71 ?  ?  ?  ?  ?  ?  ?  ?  ? ?
> WSDL2RPG: HTTP Debug Log ? CPY ? /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R79 ?
> ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG: Static Array ? CPY ? /COPY
> WSDL2RPG/QWSDL2RPG,PWSDL2R86 ?  ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG:
> Stream ? CPY ? /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R87 ?  ?  ?  ?  ?  ?  ?
> ?  ? ? WSDL2RPG: ManagedMemoryDataSource ? CPY ? /COPY
> WSDL2RPG/QWSDL2RPG,PWSDL2R88 ?  ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG:
> Public Helper Procedures ? CPY ? /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R90 ?
> ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG: AppMsg ? CPY ? /COPY
> WSDL2RPG/QWSDL2RPG,PWSDL2R94 ?  ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG:
> MultiRef ? CPY ? /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R97 ?  ?  ?  ?  ?  ?
> ?  ?  ? ? WSDL2RPG: eXpat Adapter ? CPY ? /COPY
> WSDL2RPG/QWSDL2RPG,PWSDL2R98 ?  ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG:
> UnMarshaller/Marshaller ? CPY ? /COPY WSDL2RPG/QWSDL2RPG,PWSDL2R42 ?
> ?  ?  ?  ?  ?  ?  ?  ? ? WSDL2RPG: User name and password and the
> Marshall_toBinary64 is in the PWSDL2R98 copy member. ? XmlData64Enc =
> Marshaller_toBinary64(xmlData); XmlData is the XML-string. And I get
> Marshaller_toB...... is not defined. And another strange thing is that
> if I don't have WSDL2RPG/QWSDL2RPG,PWDL2R98 instead
> QWSDL2RPG,PWDL2R98, I can't browse the copy member. Kjartan ?ór
> Guðmundsson
> 
> 
> 
> -----------------------------------------------------------------------
>
> 
This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi 
> -----------------------------------------------------------------------
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUIyuuAAoJELxuAUPiYRU8gxAH/RQRnVFf3gpRs2Damd+gIOZw
Vw0ArLWvzPQg3GsbelaNa+H6ZioN639a4MkMjcx4Uci8+Ob6piw1rDriTPPZG6oj
ftAmwnCA/P0kWeL9ixm6nwMNwXbn5fLPVWVydNvkN9lKwhklTrP+tJfRhXOKTDsa
/UGfi3R1xqvc32mqvOJgnsOqxxU7mtjIhnR1v3V7arbIggT7uJtDpVkLXLjZpZ0l
eJ4Smm220dwL/xSnnDp7r2JAJ3QIL+ZT4/BnNCjdBHcfIzXxGWoEjKTgiMoKUTsi
h1cBHRKqyOUi4++J9FiVtiffIW2izpK+plHPykxQIHefrxT4u9AZKiTSZGcdhhY=
=lBzD
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------