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

RE: Need help adjusting a WSDL2RPG stub program



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.

Am 26.07.2012 20:02, schrieb Koester, Michael:
> Mike, your instincts of where to look are pretty impressive.  I did find that I had limited the definition of the ds, "item" (nested in ds, "impl_item_of_anyType_t" in the Base stub) to DIM_A2 instead of DIM_A3.  Fixed that, recreated the module and the *srvpgm, recreated the test caller *pgm, ended and restarted my test session, and tried it.  Crashed at the same place as before: "failed to retrieve multi-reference information of ID 'id1'" in the parsing routines.
>
> Good catch, though.  That would have bitten me shortly after I get past the parsing issue.  Other than initializing, that is the only reference to DIM_A3 I'm aware of.
>
> -- Michael Koester
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
> Sent: Thursday, July 26, 2012 1:16 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: RE: Need help adjusting a WSDL2RPG stub program
>
> Okay, sounds reasonable. Should the stub or the method have a reference to DIM(DIM_A3) someplace? Or does that magic happen someplace else?
>
> ________________________________________
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 
> [ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Koester, Michael 
> [mkoester@xxxxxxxxxxxxx]
> Sent: Thursday, July 26, 2012 11:03 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: RE: Need help adjusting a WSDL2RPG stub program
>
> Hi Mike.  In this particular case there are 24 key/value pairs.  The stubs are soft-coded to permit that flexibility, and the arrays are dimensioned to handle whatever was entered on the WSDL2RPG prompt.  For handling the multi-ref stuff, I was advised to manually set DIM_A3 to 256, so that there could be up to that many key/value pairs.  This is in the Base Stub.  That way, other methods (operations) that use that same web service can also have up to that many.
>
> -- Michael Koester
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
> Sent: Thursday, July 26, 2012 11:44 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: RE: Need help adjusting a WSDL2RPG stub program
>
> I don't know WSDL2RPG at all...
> You have 24 key/value pairs...shouldn't you have a dim for 24 someplace?
>
> ________________________________________
> 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
> ----------------------------------------------------------------------
> -
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
HTTPAPI Ver 1.24 released 2012-01-23
OS/400 Ver V7R1M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0

WSDL2RPG Ver 1.15beta7 released 2012-01-25

** 2012-07-26-17.16.49.458000: Entering Provision_getDeviceInterfaces()
New iconv() objects set, PostRem=1208. PostLoc=0. ProtRem=819. ProtLoc=0
** 2012-07-26-17.16.49.650000: Sending request to server
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: GSTNETWORKS.NET
DNS server found: 12.6.236.126
DNS server found: 12.160.200.5
http_persist_post(): entered
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_setauth(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /axis/services/Provision HTTP/1.1
Host: 192.168.41.252:9090
User-Agent: http-api/1.24
Content-Length: 553
Authorization: Basic cm9vdDpwdWJsaWM=
Content-Type: text/xml
SOAPAction: 


sendraw(): entered
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="urn:Provision" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><impl:getDeviceInterfaces soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><in0>192.168.10.42</in0><in1>0.0</in1></impl:getDeviceInterfaces></soapenv:Body></soapenv:Envelope>
recvresp(): entered
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=5FFBB7278214507772FEDD73912B29D0; Path=/axis
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 26 Jul 2012 21:17:34 GMT


SetError() #13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: chunked 0
header_load_cookies() entered
cookie_parse() entered
cookie =  JSESSIONID=5FFBB7278214507772FEDD73912B29D0; Path=/axis
cookie attr JSESSIONID=5FFBB7278214507772FEDD73912B29D0
cookie attr Path=/axis
recvchunk(): entered
get_chunk_size(): entered
e4e

chunk size = 3662
get_chunk_size returned 3662
calling comm_blockread
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><ns1:getDeviceInterfacesResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="urn:Provision"><getDeviceInterfacesReturn href="#id0"/></ns1:getDeviceInterfacesResponse><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns2:Map" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns2="http://xml.apache.org/xml-soap";><item><key xsi:type="soapenc:string">0.0</key><value href="#id1"/></item></multiRef><multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";><item><key xsi:type="soapenc:string">PORT_SPEED</key><value xsi:type="soapenc:string">100M</value></item><item><key xsi:type="soapenc:string">EGRESSLIMITER</key><value xsi:type="soapenc:string">NONE</value></item><item><key xsi:type="soapenc:string">FLOW_CONTROL</key><value xsi:type="soapenc:string">ON</value></item><item><key xsi:type="soapenc:string">DHCP_FILTERING</key><value xsi:type="soapenc:string">OFF</value></item><item><key xsi:type="soapenc:string">SUB_TYPE</key><value xsi:type="soapenc:string">Optical Fast Ethernet</value></item><item><key xsi:type="soapenc:string">DHCP_AGEING</key><value xsi:type="soapenc:string">OFF</value></item><item><key xsi:type="soapenc:string">PORT_DIRECTION</key><value xsi:type="soapenc:string">Customer</value></item><item><key xsi:type="soapenc:string">atnInterfaceExternalProfileName</key><value xsi:type="soapenc:string">WSA4_FIBER</value></item><item><key xsi:type="soapenc:string">TAGGED_VLANS</key><value xsi:type="soapenc:string">800,3001,3201</value></item><item><key xsi:type="soapenc:string">CardType</key><value xsi:type="soapenc:string">FX20</value></item><item><key xsi:type="soapenc:string">AVAILABILITY_STATUS</key><value xsi:type="soapenc:string">Failed</value></item><item><key xsi:type="soapenc:string">TaggedHVlans</key><value xsi:type="soapenc:string"></value></item><item><key xsi:type="soapenc:string">DUPLEX_STATE</key><value xsi:type="soapenc:string">FULL</value></item><item><key xsi:type="soapenc:string">OPERATIONAL_STATE</key><value xsi:type="soapenc:string">Down</value></item><item><key xsi:type="soapenc:string">DESCRIPTION</key><value xsi:type="soapenc:string">529-9980 SVCCTR TST </value></item><item><key xsi:type="soapenc:string">MAX_LEARNED_MAC_ADDRS</key><value xsi:type="soapenc:string">OFF</value></item><item><key xsi:type="soapenc:string">Profile_Name</key><value xsi:type="soapenc:string">WSA4_FIBER</value></item><item><key xsi:type="soapenc:string">UNTAGGED_VLAN</key><value xsi:type="soapenc:string"></value></item><item><key xsi:type="soapenc:string">ADMIN_STATE</key><value xsi:type="soapenc:string">Up</value></item><item><key xsi:type="soapenc:string">Port</key><value xsi:type="soapenc:string">0.0</value></item><item><key xsi:type="soapenc:string">PORT_TYPE</key><value xsi:type="soapenc:string">Ether-like</value></item><item><key xsi:type="soapenc:string">ENABLED_DHCP_INSTANCES</key><value xsi:type="soapenc:string">BOOT,RGMGMT,WSA4VOIP</value></item><item><key xsi:type="soapenc:string">AUTONEGOTIATE</key><value xsi:type="soapenc:string">OFF</value></item><item><key xsi:type="soapenc:string">UntaggedHVlan</key><value xsi:type="soapenc:string"></value></item></multiRef></soapenv:Body></soapenv:Envelope>
comm_blockread returned 3662
** 2012-07-26-17.16.53.227000: Entering HTTP_receiveResponse()
WSDL2RPG: USR0036: Failed to retrieve multi-reference information of ID 'id1'.
          received from procedure: BASICS1R1_f_sndPgmMsg
                    and statement: 54400
WSDL2RPG (eXpat error): (-1009) Failed to retrieve multi-reference information of ID 'id1'.

    received at line: 1
           at column: 732
      from procedure: WSDL2R97_XMLSAXParser_parse
       and statement: 101800
** 2012-07-26-17.22.57.368000: Failed parsing XML message
** 2012-07-26-17.23.06.008000: Leaving HTTP_receiveResponse()
SetError() #16: recvchunk: saveproc: Not all data was written!
http_close(): entered
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope\40
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\40
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"\40
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"\40
    soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"\40
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
    <getDeviceInterfaces xmlns="urn:Provision">
      <device xsi:type="soapenc:string">192.168.10.42</device>\n
      <port xsi:type="soapenc:string">0.0</port>
    </getDeviceInterfaces>
  </soap:Body>
</soap:Envelope>\n

Message Received:
=================
HTTP/1.1 200 OK
Connection: close
Date: Wed, 25 Jul 2012 18:04:31 GMT
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Client-Date: Wed, 25 Jul 2012 18:07:31 GMT
Client-Peer: 192.168.41.252:9090
Client-Response-Num: 1
Set-Cookie: JSESSIONID=F8809210C383EA3B65C4A6F3E81A591A; Path=/axis

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<soapenv:Body>
<ns1:getDeviceInterfacesResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="urn:Provision">
<getDeviceInterfacesReturn href="#id0"/>
</ns1:getDeviceInterfacesResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns2:Map" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns2="http://xml.apache.org/xml-soap";>
<item>
<key xsi:type="soapenc:string">0.0</key>
<value href="#id1"/>
</item>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
<item>
<key xsi:type="soapenc:string">PORT_SPEED</key>
<value xsi:type="soapenc:string">100M</value>
</item>
<item>
<key xsi:type="soapenc:string">EGRESSLIMITER</key>
<value xsi:type="soapenc:string">NONE</value>
</item>
<item>
<key xsi:type="soapenc:string">FLOW_CONTROL</key>
<value xsi:type="soapenc:string">ON</value>
</item>
<item>
<key xsi:type="soapenc:string">DHCP_FILTERING</key>
<value xsi:type="soapenc:string">OFF</value>
</item>
<item>
<key xsi:type="soapenc:string">SUB_TYPE</key>
<value xsi:type="soapenc:string">Optical Fast Ethernet</value>
</item>
<item>
<key xsi:type="soapenc:string">DHCP_AGEING</key>
<value xsi:type="soapenc:string">OFF</value>
</item>
<item>
<key xsi:type="soapenc:string">PORT_DIRECTION</key>
<value xsi:type="soapenc:string">Customer</value>
</item>
<item>
<key xsi:type="soapenc:string">atnInterfaceExternalProfileName</key>
<value xsi:type="soapenc:string">WSA4_FIBER</value>
</item>
<item>
<key xsi:type="soapenc:string">TAGGED_VLANS</key>
<value xsi:type="soapenc:string">800,3001,3201</value>
</item>
<item>
<key xsi:type="soapenc:string">CardType</key>
<value xsi:type="soapenc:string">FX20</value>
</item>
<item>
<key xsi:type="soapenc:string">AVAILABILITY_STATUS</key>
<value xsi:type="soapenc:string">Online</value>
</item>
<item>
<key xsi:type="soapenc:string">TaggedHVlans</key>
<value xsi:type="soapenc:string">
</value>
</item>
<item>
<key xsi:type="soapenc:string">DUPLEX_STATE</key>
<value xsi:type="soapenc:string">FULL</value>
</item>
<item>
<key xsi:type="soapenc:string">OPERATIONAL_STATE</key>
<value xsi:type="soapenc:string">Up</value>
</item>
<item>
<key xsi:type="soapenc:string">DESCRIPTION</key>
<value xsi:type="soapenc:string">529-9980 SVCCTR TST </value>
</item>
<item>
<key xsi:type="soapenc:string">MAX_LEARNED_MAC_ADDRS</key>
<value xsi:type="soapenc:string">OFF</value>
</item>
<item>
<key xsi:type="soapenc:string">Profile_Name</key>
<value xsi:type="soapenc:string">WSA4_FIBER</value>
</item>
<item>
<key xsi:type="soapenc:string">UNTAGGED_VLAN</key>
<value xsi:type="soapenc:string">
</value>
</item>
<item>
<key xsi:type="soapenc:string">ADMIN_STATE</key>
<value xsi:type="soapenc:string">Up</value>
</item>
<item>
<key xsi:type="soapenc:string">Port</key>
<value xsi:type="soapenc:string">0.0</value>
</item>
<item>
<key xsi:type="soapenc:string">PORT_TYPE</key>
<value xsi:type="soapenc:string">Ether-like</value>
</item>
<item>
<key xsi:type="soapenc:string">ENABLED_DHCP_INSTANCES</key>
<value xsi:type="soapenc:string">BOOT,RGMGMT,WSA4VOIP</value>
</item>
<item>
<key xsi:type="soapenc:string">AUTONEGOTIATE</key>
<value xsi:type="soapenc:string">OFF</value>
</item>
<item>
<key xsi:type="soapenc:string">UntaggedHVlan</key>
<value xsi:type="soapenc:string">
</value>
</item>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------