[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Need help adjusting a WSDL2RPG stub program - revised test caller attached
Oops. I think the attached test caller on the previous email may have been an old copy? This one is current. Sorry.
-- Michael
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Koester, Michael
Sent: Thursday, August 02, 2012 10:03 AM
To: HTTPAPI and FTPAPI Projects
Subject: RE: Need help adjusting a WSDL2RPG stub program
Thomas,
Thanks again. The big obstacle now is that the code adjustments you supplied were based on WSDL2RPG 1.15 / 31.05.2012, where the version I have here is WSDL2RPG 1.15beta7 / 25.01.2012. As a result, I'm lacking some pieces that were apparently added since beta7. I have no "unmarhaller_setFieldIdentifier", no "StaticArray_checkIndex", and no copy source for QWSDL2RPG,PWSDL2R79 -- possibly missing other critical elements, but those keep the my adjusted method stub module from compiling.
I could bring in the new (31.05.2012) version if I was comfortable that it was backward-compatible with work I've already moved to Production. Should I be?
Open to your suggestions...
-- Michael Koester
~~~~~~~~~~~~~~~~~~~~
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Thomas Raddatz
Sent: Tuesday, July 31, 2012 3:47 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Need help adjusting a WSDL2RPG stub program - missing zip file
Sorry, I forgot to attach the zip file. Here it is.
Thomas.
Am 30.07.2012 18:59, schrieb Koester, Michael:
> Sorry I misunderstood. Thanks for clarifying for me.
> -- Michael
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Thomas
> Raddatz
> Sent: Monday, July 30, 2012 12:38 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: Need help adjusting a WSDL2RPG stub program
>
> Michael,
>
> The wsdl file is the contract of the web service. Please enter the URL of the wsdl file into your preferred web browser and then use "Save as" to create a local copy of that file and send it to me.
>
> I need the wsdl file to generate the stub and to set up a soapUI mock web service which I can use to return the data of your debug log. This way I can test the stub with the very same data that you received from your web service.
>
> The URL of the wsdl file is what you entered at keyword URL of command WSDL2RPG, e.g.:
>
> WSDL2RPG
> URL('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL')
> ...
>
> Thomas.
>
> Am 30.07.2012 14:08, schrieb Koester, Michael:
>> Hey Thomas -- welcome back. Hope you had a great vacation!
>> If I understand what you're asking for, I've cut the resulting xml from an interface I'll be trying to mimic. That same data comes through in the debug log I attached to an earlier post, but I'll attach that here as well.
>> If you haven't yet seen the other attachments, they are on my first post on July 26. If you need me to resend those, I will be happy to.
>>
>> Thanks for your time, Thomas.
>> -- Michael
>>
>> -----Original Message-----
>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Thomas
>> Raddatz
>> Sent: Sunday, July 29, 2012 12:38 PM
>> To: HTTPAPI and FTPAPI Projects
>> Subject: Re: Need help adjusting a WSDL2RPG stub program
>>
>> Michael,
>>
>> Sorry for the late reply. I was on vacation and returned this weekend.
>> Please post the wsdl file to help me to set up a soapUI mock service. For whatever reasons the stub does not notice the multiref element "id1". I need to debug that.
>>
>> Thomas.
>>
>>> ________________________________________
>>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>>> [ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Koester,
>>> Michael [mkoester@xxxxxxxxxxxxx]
>>> Sent: Thursday, July 26, 2012 9:43 AM
>>> To: HTTPAPI and FTPAPI Projects
>>> Subject: RE: Need help adjusting a WSDL2RPG stub program
>>>
>>> Got no responses from my plea for help last week, but I've continued and got just a bit closer, I think. Still stuck, though. I had some help from Thomas for something similar several months ago, so I re-jiggered the stubs (both base and method) to be more like the one I have in production that deals with the multi-ref layer.
>>> Still seeing the data returned from the web service in the debug log, but parsing blows up when called from procedure,"HTTP_receiveResponse":
>>> "if (XMLSAXParser_parse(g_hSAXParser: i_data: i_length) = cTrue);" [returns FALSE] Possibly because of one or more of the following:
>>> 1) The web service is returning something non-standard, or
>>> 2) I messed up the stub programs when I tried to adapt for multi-ref
>>> handling, or
>>> 3) Additional tweaks are needed (which I would need assistance with,
>>> because I'm quite over my head as it is.)
>>>
>>> Attached .txt files are BaseStub (RPG source WS2PRVSN), MethodStub (RPG source WS2PRVSN03), TestCaller (RPG source WS2GETDEVC), and the debug log. Note that these are a bit different than those I attached to earlier posts.
>>>
>>> Many thanks.
>>> -- Michael Koester
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> -----Original Message-----
>>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Koester,
>>> Michael
>>> Sent: Thursday, July 19, 2012 11:48 AM
>>> To: HTTPAPI and FTPAPI Projects
>>> Subject: Need help adjusting a WSDL2RPG stub program
>>>
>>> I used WSDL2RPG (the Thomas Raddatz tool) to generate a base stub WS_PRVSN, a method stub WS_PRVSN03, and a test caller program, WS_GETDEVC. My test caller program WS_GETDEVC, sends two inputs to the webservice. For those values sent I expect to get 24 key/value pairs returned. The debug log shows that all key/value pairs were returned by the webservice -- the stub just isn't parsing them out correctly.
>>>
>>> The webservice appears to be sending back 24 key/value pairs, but they appear to be within a <multiRef ... </multiRef> set. The method stub does not appear to have the routines for parsing out the "MultiRef" layer.
>>>
>>> Is there an easy way to fix the stub so that it ignores the outer group and just loads the data structure from the inner group of key/value pairs?
>>>
>>> I can't directly share the access to the webservice (it's all on the private side of the firewall, and it pertains to customer-proprietary data), but hopefully the attachments should provide what you may need.
>>>
>>> Thanks much.
>>> Michael Koester
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
* =====================================================================
* Generated by WSDL2RPG 1.15beta7 / 25.01.2012
* Built on Aug 2, 2012 (13:52:50)
* Built for V7R1M0
* Based on WS_PGM v1.15
* =====================================================================
* Sample program to show how to call the
* Provision_getDeviceInterfaces()
* 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);
* >>END-COMPILE<<
* >>EXECUTE<<
* >>CMD<< CRTPGM PGM(&LI/&OB) +
* MODULE(*PGM) +
* BNDSRVPGM(*LIBL/WSXPRV +
* ) +
* DETAIL(*BASIC) +
* ACTGRP(*NEW);
* >>END-PRE-COMPILER<<
* =====================================================================
H DEBUG
H OPTION(*SRCSTMT : *NODEBUGIO)
H EXTBININT(*YES)
*
* 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_WSXPRVSN01
CPY /COPY MKOESTER/QRPGLESRC,WSXPRVSN01
/UNDEFINE PROTOTYPE_WSXPRVSN01
*
2557 /DEFINE DEVICE_INTERFACES
2557 /COPY MKOESTER/TFSCOPYSRC,NMS_PROTOS
2557 /UNDEFINE DEVICE_INTERFACES
* Program entry point
D* TESTWSX_01...
D* PR
*
* Sends a message to the command line.
D sndMsg...
D PR extproc('sndMsg')
D i_text 128A value varying
*
* =====================================================================
* Program entry point
* =====================================================================
D TESTWSX_01...
D PI
*
* Web service error message text
D errText S like(wsdl_errText_t ) inz
*
* Request message
* These fields needs to be filled with reasonable values
* right before calling the web service.
D in0 S like(impl_in0_t)
D inz('192.168.10.42')
D in1 S like(impl_in1_t)
D inz('0.0')
*
* Response message
* This structure contains the result values returned by
* the web service.
D getDeviceInterfacesRpc...
D DS likeds(impl_getDeviceInterfacesRpc_t)
D inz
*
* Text of messages sent to the command line
D text S 128A varying inz
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/free
// Enable/disable http api debug log
// (Enable the http api debug log in case of problems with the web service)
Provision_Port_setHttpDebug(
*ON: '/tmp/httpapi_debug.txt'); // Default path of http api
// Specify a proxy server if your network requires it.
// Provision_Port_setHttpProxy(
// 'your.proxy.server': 8080);
// Set the paramater values of the request message
// of the web service.
// assign values here
//in0 = 'string';
//in1 = 'string';
// Now let's call the web service.
getDeviceInterfacesRpc =
Provision_getDeviceInterfaces(
in0:
in1:
errText);
// If the Web service finished successfully ...
if (not Provision_Port_isError());
// ... get response data from response data structure
// get the number of Key/Value pairs
DeviceInterfaces_ds.PairCount = getDeviceInterfacesRpc
.getDeviceInterfacesReturn
.item
.x;
// ... and load the attributes into the PairData array
DeviceInterfaces_ds.PairData = getDeviceInterfacesRpc
.getDeviceInterfacesReturn
.item;
else;
// ... else show error messages ordered by priority:
// 1. HTTP error information
text = %char(
Provision_HttpError_getCode()
) + ': ' +
Provision_HttpError_getText()
;
sndMsg(text);
// 2. SOAP error information
if (Provision_SoapError_getCode()
<> '');
text = Provision_SoapError_getCode()
+ ': ' +
Provision_SoapError_getText()
;
sndMsg(text);
endif;
// 3. XML parser error information
if (Provision_XmlError_getCode()
<> 0);
text = %char(Provision_XmlError_getCode())
+ ': ' +
Provision_XmlError_getText()
;
sndMsg(text);
endif;
endif;
*inlr = *on;
/end-free
*
* =====================================================================
* *** private ***
* Sends a message to the command line.
* =====================================================================
P sndMsg...
P B
*
D sndMsg...
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 sndMsg...
P E
*
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------