[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: WSDL2RPG : Empty tag for decimal variables
Hi Thomas,
Thank you in advance for your input.
I have only 3 fields to be omitted & those 3 variables can be
permanently removed from client end and host service cannot be changed
as well.
So I changed STUB with search & replace function
correct me if I'm wrong..
I search '<DsctDays1>0.00</DsctDays1>' string in request variable &
replace it with '<DsctDays1/>'
'<Pmtmthsupl>' +
Marshaller_toString(
curZualBapiacap09_A2.Pmtmthsupl
) +
'</Pmtmthsupl>' +
'</item>' +
'';
Search_word = '<DsctDays1>0.00</DsctDays1>';
replace_word = '<DsctDays1/>' ;
request = SearchR(request:search_word:replace_word);
Looks like everything is OK for me..... (temporarily of cause)
btw, I think this method is much smarter than 1st one, cause once we
need to omit a variable, Just only have to turn *On the indicator.
[cid:330@goomoji.gmail]
request.myNillableField.isNull = *ON;
Thanks again.
On Thu, Aug 25, 2011 at 1:17 AM, Thomas Raddatz
<[1]thomas.raddatz@xxxxxxxxxxx> wrote:
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 [2]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:
> [3]http://www.scottklement.com/mailman/listinfo/ftpapi
>
-------------------------------------------------------------------
----
-------------------------------------------------------------------
----
This is the FTPAPI mailing list. To unsubscribe, please go to:
[4]http://www.scottklement.com/mailman/listinfo/ftpapi
-------------------------------------------------------------------
----
References
1. mailto:thomas.raddatz@xxxxxxxxxxx
2. tel:24.08.2011%2018
3. http://www.scottklement.com/mailman/listinfo/ftpapi
4. 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
-----------------------------------------------------------------------