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

Re: WSDL2RPG Trouble parsing multiple data maps from webservice



   Micheal,
   Please provide a sample response message of the web service. You may
   either post the complete debug log (without sensitive data) or you may
   take the response XML string out of the debug log and post it here.
   The problem you describe is a tricky one because we reach the
   capabilities of RPG. In Java it is not a problem to have a map and to
   assign a string or another map to a key. Actually you can assign every
   object to a key. But in RPG you are almost stuck. But first, let me see
   what we can do.
   Thomas.
   ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 26.02.2013 00:00:54:
   > Von: mkoester@xxxxxxxxxxxxx
   > An: ftpapi@xxxxxxxxxxxxxxxxxxxxxx,
   > Datum: 26.02.2013 00:11
   > Betreff: WSDL2RPG Trouble parsing multiple data maps from webservice
   > Gesendet von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   >
   > I've been using the Thomas Raddatz WSDL2RPG tool, but I'm seeing
   > some occurrences of failures.  Getting the error "-1: Length of
   > varying length variable is out of range."  If I recall correctly,
   > this error may have originated in one of the WSDL2R94 procedures.
   > After a lot of digging around, I find that on these occurrences,
   > there appears to be a couple of different data maps being returned
   > by the webservice.  The production program is handling the simple
   > type, where I receive back items defined as:
   >
   >
   >      D impl_getRGDeviceDetailsReturnMvd_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  item
   likeds(apachesoap_RpgArrayOfItem_t)
   >
   >      D apachesoap_RpgArrayOfItem_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  x                            10I 0
   >      D  mapItem
   likeds(apachesoap_mapItem_t)
   >      D                                     dim(DIM_A1)  // DIM_A1 =
   512
   >
   >      D apachesoap_mapItem_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  key                         256A   varying
   >      D  value                       256A   varying
   >
   > This works well until I encounter a nested array, where the "Value"
   > is actually a map of a number of key/value pairs.
   >
   > So I messed with it until I got a test program to accommodate those.
   > (I used patterns from another program Thomas helped me set up last
   > August.)  I also had to do a lot of trial/error to get the array
   > dimensions right so it would compile and run without error.  It now
   > runs without error (at least for my very limited test inputs), and I
   > can get the key/value pairs of the inner nested values, using the
   > following definitions in my test stubs:
   >
   >      D apachesoap_RpgArrayOfItem_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  x                            10I 0
   >      D  mapItem
   likeds(apachesoap_mapItem_t)
   >      D                                     dim(DIM_A1)  // DIM_A1 =
   > 400 for this test stub
   >
   >      D apachesoap_mapItem_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  key                          64A   varying
   >      D  value
   likeds(apachesoap_AnyMap_t)
   >
   >      D apachesoap_AnyMap_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  item                               likeds
   > (apachesoap_RpgArrayOfItem1_t)
   >
   >      D apachesoap_RpgArrayOfItem1_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  x                            10I 0
   >      D  anyMapItem
   likeds(apachesoap_anyMapItem_t)
   >      D                                     dim(DIM_A2)  // DIM_A2 =
   > 64 for this test stub
   >
   >      D apachesoap_anyMapItem_t...
   >      D                 DS                  template
   >      D                                     qualified
   >      D  key                          64A   varying
   >      D  value                        64A   varying
   >
   > All is cool except that the returned data is a mix of the nested
   > types and the simple types.  I have not found a way to resolve the
   > simple value, which my test stubs don't appear to resolve.  I get
   > the "simple" key, but the value is expected to also be a nested set
   > of key/value pairs, which for some pairs it is, but others it is not.

   >
   > I know what the result set should be from a "northbound Interface"
   > that should be using the same web service, and I see the different
   > types of data maps there.  I just can't seem to replicate those
   > results with my programs.
   >
   > Attached is the original wsdl from the web service (Provision.wsdl)
   > and a modified version that provides for the nested key/value pairs
   > (Provision4.wsdl).  The method I'm working with here is
   > getRGDeviceDetails.  I've attached my test caller as well
   (ws5test05.txt).
   >
   > If you think you can help me through this, let me know what other
   > pieces you might need.
   >
   > Many thanks,
   >   Michael
   >
   >
   >
   > [Anhang "Provision.xml" gelöscht von Thomas Raddatz/OBI/DE] [Anhang
   > "Provision4.wsdl" gelöscht von Thomas Raddatz/OBI/DE] [Anhang
   > "ws5test05.txt" gelöscht von Thomas Raddatz/OBI/DE]
   >
   -----------------------------------------------------------------------
   > This is the FTPAPI mailing list.  To unsubscribe, please go to:
   > [1]http://www.scottklement.com/mailman/listinfo/ftpapi
   >
   -----------------------------------------------------------------------

   --
   IMPORTANT NOTICE:
   This email is confidential, may be legally privileged, and is for the
   intended recipient only. Access, disclosure, copying, distribution, or
   reliance on any of it by anyone else is prohibited and may be a
   criminal
   offence. Please delete if obtained in error and email confirmation to
   the sender.

References

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