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

Re: WSDL2RPG : Empty tag for decimal variables



The problem you have is a common problem with RPG because RPG does not 
really support NULL values.

Leaving an XML element empty is one option to specify a NULL value in an 
XML document. But since RPG does not support NULL values, WSDL2RPG does not 
have a chance to properly recognize NULL values. For strings you may say 
that a string value with length=0 is equal to NULL. Although that is not 
really true it should work in most cases. Fine.

But for all other field types it is not that easy to define a substitution 
value for NULL. For example you may say that for numeric fields the 
substitute for NULL is 0. But is that really a good idea? I do not think 
so. But what other value should we consider to be equal to NULL? *LOVAL or 
*HIVAL? Bad.

I wished RPG had true NULL support. All you can do now is to say: "For me, 
0 is equal to NULL" and then modify the generated stub accordingly.

I have been thinking about how to support NULL values since the day 
WSDL2RPG was born. If it wasn't that ugly I would add a NULL indicator 
field for each nillable field. If the NULL indicator is TRUE the field 
would be treated as NULL regardless of its actual value. Honestly I do not 
like that solution because you always have to set two fields for one value, 
for example:

    request.myNillableField.value = 123;
    request.myNillableField.isNull = *OFF;

Or in case of a NULL value:

    request.myNillableField.isNull = *ON;

Any other ideas how to solve that problem?

Thomas.


Am 24.08.2011 18:41, schrieb Dhanushka Manjula:
>
>     Hi All,
>     In my RPG code, I have leave out 5 line due to I dont have values to
>     send, I need closed/empty tag for those
>
>     //newZualBapiacap09_A2.BlineDate =;
>     //newZualBapiacap09_A2.DsctDays1 = 0;
>     //newZualBapiacap09_A2.DsctDays2 = 0;
>     //newZualBapiacap09_A2.Netterms = 0;
>       newZualBapiacap09_A2.PymtMeth  = PYMDDL      ;
>     //newZualBapiacap09_A2.Pmtmthsupl = ;
>
>     Following is the part of SOAP message
>
>     <BlineDate/>
>     <DsctDays1>0.00</DsctDays1>
>     <DsctDays2>0.00</DsctDays2>
>     <Netterms>0.00</Netterms>
>     <PymtMeth>  NP</PymtMeth>
>     <Pmtmthsupl/>
>
>     For String variables, it generates closed tag accordingly but for the
>     decimal variables it assigns 0.00 Which were not expected
>     How to have a closed/empty tag for decimal variables?
>     Thanks
>
>
>
>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------