We help IT Professionals succeed at work.

RPG-source with WSDL2RPG.SH

Theo Kouwenhoven
on
Hi Experts,

After generating a RPG-source with WSDL2RPG.SH, I have an unknown element.
I like to know why the generator added this and what to do with it.

Simplified Example:
<xsd:element name="Lines" minOccurs="0" maxOccurs="unbounded">
      <xsd:complexType>
            <xsd:sequence>
                  <xsd:element name="Line" type="xsd:string"/>
            </xsd:sequence>
      </xsd:complexType>
</xsd:element>

The program generates the variables:
Lines.Array.Line
Lines.Size
Lines.Type


I realy don't know what the .Type field is (it's a Int(10) field), its not part of the wsdl
And I don't know what to do with it (not in the manual)
On this moment I can fill the .Size field with the required repeats, but its excluded from the XML with:

<ns1:Lines xsi:nil="true"></ns1:Lines>

While debuging I see that the elements are filled and the size is set to the required value.
In the logging I checked and  its not part of the XML.
Comment
Watch Question

VP Technology / Senior Consultant
CERTIFIED EXPERT
Commented:
Page 187 of the Web Services Client for ILE Programming Guide explains the type element

ftp://public.dhe.ibm.com/systems/support/i/iws/systems_i_software_iws_pdf_WebServicesClient_new.pdf

type field, which is an indication of the type of element (for example, array of integers, or an array of user-defined complex structures). Constants for the possible types are defined in the generated <portType>_xsdtypes.rpgleinc file. There are constants for all the simple types. For example,  XSDC_STRING and XSDC_INT. For complex types, the field should be set to XSDC_USER_TYPE.

So it is a value that you can query to determine the underlying data type of the Lines elements in your array.  In your case, this is a string, so it would be set to the value of the XSDC_STRING constant.
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Author

Commented:
Hi Gary,

I already generated several webservices, and never used this .Type value.
So I checked and until now all XML's where String only fields, so value zero seems to work.
In my example it was ony string information, in the real program there also Date and Time types :-(

So using XSDC_USER_TYPE was the solution.
So why making all these types when XSDC_USER_TYPE is working for all alements?

Thanks !!!!
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Author

Commented:
Thanks !!!!!!