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

Re: Marshaller_toDateTime parameters options



Maria,

As far as I can see, your changes are right. Are you sure that:

a) you compiled the module?

   crtrpgmod raddatz/wsdl2r98
     srcfile(raddatz/qwsdl2rpg) srcmbr(wsdl2r98)
     truncnbr(*no) dbgview(*list)

b) updated service program WSDL2RPGRT?

   updsrvpgm raddatz/wsdl2rpgrt module(raddatz/wsdl2r98)

c) your web service stub uses the updated service program?

d) Did you double check c) with the debugger?

I just applied the described changes that I did for 1.16.0 to WSDL2RPG
1.15.9.a and the result is fine, as expected.

The format of my test request message changed as shown  below:

Before:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:impl="http://wsdl.webservice.wsdl2rpg.tools400.de";
xmlns:tns1="http://core.webservice.wsdl2rpg.tools400.de";>
   <soapenv:Body>
      <impl:echoDateTime>
         <impl:aDateTimeStructure>
            <tns1:date>2014-11-29+01:00</tns1:date>
            <tns1:time>10:49:08+01:00</tns1:time>
            <tns1:timestamp>2014-11-29T11:49:08.505+01:00</tns1:timestamp>
         </impl:aDateTimeStructure>
      </impl:echoDateTime>
   </soapenv:Body>
</soapenv:Envelope>

After:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:impl="http://wsdl.webservice.wsdl2rpg.tools400.de";
xmlns:tns1="http://core.webservice.wsdl2rpg.tools400.de";>
   <soapenv:Body>
      <impl:echoDateTime>
         <impl:aDateTimeStructure>
            <tns1:date>2014-11-29</tns1:date>
            <tns1:time>10:57:29</tns1:time>
            <tns1:timestamp>2014-11-29T11:57:29.664</tns1:timestamp>
         </impl:aDateTimeStructure>
      </impl:echoDateTime>
   </soapenv:Body>
</soapenv:Envelope>

As expected, the timezone portion has been dropped:

  <tns1:date>2014-11-29+01:00</tns1:date>
  <tns1:time>10:49:08+01:00</tns1:time>
  <tns1:timestamp>2014-11-29T11:49:08.505+01:00</tns1:timestamp>

  <tns1:date>2014-11-29</tns1:date>
  <tns1:time>10:57:29</tns1:time>
  <tns1:timestamp>2014-11-29T11:57:29.664</tns1:timestamp>

Please use the debugger to ensure that your web service stub calls the
changed getXmlTimezone() procedure and that you call the marshaller with
parameter WSDL_NO_TIMEZONE like this:

  '<tns1:timestamp>' +
  Marshaller_toDateTime(
     i_impl_echoDateTime.aDateTimeStructure.timestamp
     : WSDL_NO_TIMEZONE
     ) +
  '</tns1:timestamp>' +


You find the changes that I applied to 1.15.9.a in the attached zip file.

Regards,

Thomas.

Am 28.11.2014 19:25, schrieb Maria Orcy Rosar:
> Thomas;
> Thank you for your reply;
> These are the changes we added
> 
> TYPES_H
> 0182.01 tm01  *  Modification to NOT Return Time Zone            
> 0182.02 tm01 D WSDL_NO_TIMEZONE...                               
> 0182.03 tm01 D                 C                   '*NONE'       
> 
> WSDL2R98
> 
> 7443.00       *================================================================
> 7444.00       *  Returns the time zone value based on the input time zone.     
> 7445.00       *================================================================
> 7446.00      P getXmlTimeZone...                                               
> 7447.00      P                 B                                               
> 7448.00       *                                                                
> 7449.00      D getXmlTimeZone...                                               
> 7450.00      D                 PI                         likeds(xmlTimeZone_t 
> 7451.00      D  i_timeZone                    6A   const  options(*nopass)     
> 7452.00       *                                                                
> 7453.00       *  Return value                                                  
> 7454.00      D xmlTimeZone     DS                  likeds(xmlTimeZone_t ) inz  
> 7455.00       *                                                                
> 7456.00       *  Helper fields                                                 
> 7457.00      D char            S              1A   inz                         
> 7458.00      D char2           S              2A   inz                         
> 7459.00      D timeZone        S                   like(i_timeZone ) inz       
> 7460.00       *                                                                 
> 7461.00      D NUMERIC         C                   '0123456789'                 
> 7462.00       *                                                                 
> 7463.00  CPY  /COPY QWSDL2RPG,USR5005                      Time zone indicator  
> 7464.00  CPY  /COPY QWSDL2RPG,USR5006                      Invalid time zone ho 
> 7465.00  CPY  /COPY QWSDL2RPG,USR5007                      Invalid time zone mi 
> 7466.00       * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   
> 7467.00       /FREE                                                          
> 7468.00                                                                      
> 7469.00  B01     select;                                                     
> 7470.00  X01     when (i_timeZone = WSDL_NO_TIMEZONE);                       
> 7471.00             return'';                                                
> 7472.00  X01     when (i_timeZone = WSDL_LOCAL_TIMEZONE);                    
> 7473.00             timeZone = f_rtvSysval_char('QUTCOFFSET');               
> 7474.00  X01     other;                                                      
> 7475.00             timeZone = i_timeZone;                                   
> 7476.00  E01     endsl;                                                      
> 7477.00                                                                      
> 7478.00          // Get and verify time zone indicator                       
> 7479.00          char = %subst(timeZone: 1: 1);                              
> 7480.00  B01     if (not isStartOfTimezone(char));                           
> 7481.00             clear USR5005;                                           
> 7482.00             USR50051 = char;                                         
> 7483.00             AppMsg_sendEscMsgAndDump(AppMsg_new('USR5005': USR5005));
> 7484.00  E01     endif;                                                         
> 7485.00                                                                         
> 7486.00          xmlTimeZone.ID = char;                                         
> 7487.00                                                                         
> 7488.00  B01     if (xmlTimeZone.ID = 'Z');                                     
> 7489.00             return xmlTimeZone;   // UTC time                           
> 7490.00  E01     endif;                                                         
> 7491.00                                                                         
> 7492.00          // The next two bytes are supposed to be the hours and must be 
> 7493.00          char2 = %subst(timeZone: 2: 2);                                
> 7494.00  B01     if (%check(NUMERIC: char2) <> 0);                              
> 7495.00             clear USR5006;                                              
> 7496.00             USR50061 = char2;                                           
> 7497.00             AppMsg_sendEscMsgAndDump(AppMsg_new('USR5006': USR5006));   
> 7498.00  E01     endif;                                                         
> 7499.00                                                                         
> 7500.00          xmlTimeZone.hours = char2;                                     
> 7501.00                                                                         
> 7502.00          // Distinguish between the iSeries system value format and the 
> 7503.00          char = %subst(timeZone: 4: 1);                                 
> 7504.00  B01     if (char = ':');                                               
> 7505.00             xmlTimeZone.delimiter = char;        // XML time zone forma 
> 7506.00             char2 = %subst(timeZone: 5: 2);                             
> 7507.00  X01     else;                                                          
> 7508.00             xmlTimeZone.delimiter = ':';         // iSeries system valu 
> 7509.00             char2 = %subst(timeZone: 4: 2);                             
> 7510.00  E01     endif;                                                         
> 7511.00                                                                         
> 7512.00  B01     if (%check(NUMERIC: char2) <> 0);                              
> 7513.00             clear USR5007;                                              
> 7514.00             USR50071 = char2;                                           
> 7515.00             AppMsg_sendEscMsgAndDump(AppMsg_new('USR5007': USR5007));   
> 7516.00  E01     endif;                                                         
> 7517.00                                                                         
> 7518.00          xmlTimeZone.minutes = char2;                                   
> 7519.00                                                                         
> 7520.00          return xmlTimeZone;                                            
> 7521.00                                                                         
> 7522.00       /END-FREE                                                         
> 7523.00       *                                                                 
> 7524.00      P getXmlTimeZone...                                                
> 7525.00      P                 E                                                
> 
> Thank you,
> Maria Orcy Rosar
> City Furniture - IT Department
>  
> 
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Thomas Raddatz
> Sent: Friday, November 28, 2014 11:33 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: Marshaller_toDateTime parameters options
> 
> Maria,
> 
> Are you sure that the start of your getXmlTimeZone() procedure matches the following one?
> 
>  /FREE
> 
>     select;
>     when (i_timeZone = WSDL_NO_TIMEZONE);
>        return '';
>     when (i_timeZone = WSDL_LOCAL_TIMEZONE);
>        timeZone = f_rtvSysval_char('QUTCOFFSET');
>     other;
>        timeZone = i_timeZone;
>     endsl;
> 
>     // Get and verify time zone indicator
>     char = %subst(timeZone: 1: 1);
>     if (not isStartOfTimezone(char));
>        clear USR5005;
>        USR50051 = char;
>        AppMsg_sendEscMsgAndDump(AppMsg_new('USR5005': USR5005));
>     endif;
> 
> USR5023 is a generic escape message that is sent from an error handler for unexpected errors. But the second level text "The following error message prevented ..." implies message USR5005 was send from getXmlTimeZone().
> 
> As far as I can see that can happen only when the "when" statement for "WSDL_NO_TIMEZONE" is missing. Actually getXmlTimezone() started like this:
> 
>  /FREE
> 
>     if (i_timeZone = WSDL_LOCAL_TIMEZONE);
>        timeZone = f_rtvSysval_char('QUTCOFFSET');
>     else;
>        timeZone = i_timeZone;
>     endif;
> 
> But I asked you change to what is shown above when I mentioned:
> 
> Changed getXmlTimeZone(), replaced first if/endif block:
>  B01     select;
>  X01     when (i_timeZone = WSDL_NO_TIMEZONE);
>             return '';
>  X01     when (i_timeZone = WSDL_LOCAL_TIMEZONE);
>             timeZone = f_rtvSysval_char('QUTCOFFSET');
>  X01     other;
>             timeZone = i_timeZone;
>  E01     endsl;
> 
> Maybe that you missed that?
> 
> But I also should change message USR0023, because "Failed unmarshalling"
> pointed me to the wrong direction.
> 
> Regards,
> 
> Thomas.
> 
> Am 28.11.2014 14:34, schrieb Maria Orcy Rosar:
>> Good Morning, On behalf of Tomas I ran again the request, below are 
>> the job log details.
>>
>> 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.15.9.a released 2013-09-27 (V7R1M0)
>>
>> ** 2014-11-28-08.27.22.095000: Entering 
>> BasicHttpBinding_IApplication_SubmitPartialCreditCardApplication(),
>> compiled for V7R1M0 New iconv() objects set, PostRem=1208. PostLoc=0.
>> ProtRem=819. ProtLoc=0
>>
>> WSDL2RPG: call stack frames: Program      Library      Act.Group
>> Statement    Procedure QCMD         QSYS         *DFTACTGRP
>> /0519 QUICMENU     QSYS         *DFTACTGRP        /00C1 QUIMNDRV
>> QSYS         *DFTACTGRP        /0610 QUIMGFLW     QSYS
>> *DFTACTGRP        /04D7 QUICMD       QSYS         *DFTACTGRP
>> /056F QUOCPP       QPDA         *DFTACTGRP        /0E4C QUOCMD
>> QSYS         *DFTACTGRP        /01EA QUOCPP       QPDA
>> *DFTACTGRP        /0E4C QUOCMD       QSYS         *DFTACTGRP
>> /01EA FIPROAPP     MARIAOLIB    *DFTACTGRP
>> _QRNP_PEP_FIPROAPP FIPROAPP     MARIAOLIB    *DFTACTGRP   49000
>> FIPROAPP FIPRO10T     MARIAOLIB    *NEW
>> _QRNP_PEP_FIPRO10T FIPRO10T     MARIAOLIB    *NEW         41300
>> FIPRO10T FIPRO        MARIAOLIB    *NEW         91400
>> BasicHttpBinding_IApplication_SubmitPartialCreditCardApplication 
>> WSDL2RPGRT   WSDL2RPG     *NEW         445800
>> WSDL2R98_Marshaller_toDateTime WSDL2RPGRT   WSDL2RPG     *NEW
>> 747700       WSDL2R98_getXmlTimeZone WSDL2RPGRT   WSDL2RPG     *NEW
>> 35200        WSDL2R90_AppMsg_sendEscMsgAndDump WSDL2RPGRT   WSDL2RPG
>> *NEW         39300        WSDL2R71_http_DebugLog_dumpCallStack 
>> WSDL2RPGRT   WSDL2RPG     *NEW         20200
>> WSDL2R80_CallStack_dump
>>
>>
>>
>> WSDL2RPG: call stack frames: Program      Library      Act.Group
>> Statement    Procedure QCMD         QSYS         *DFTACTGRP
>> /0519 QUICMENU     QSYS         *DFTACTGRP        /00C1 QUIMNDRV
>> QSYS         *DFTACTGRP        /0610 QUIMGFLW     QSYS
>> *DFTACTGRP        /04D7 QUICMD       QSYS         *DFTACTGRP
>> /056F QUOCPP       QPDA         *DFTACTGRP        /0E4C QUOCMD
>> QSYS         *DFTACTGRP        /01EA QUOCPP       QPDA
>> *DFTACTGRP        /0E4C QUOCMD       QSYS         *DFTACTGRP
>> /01EA FIPROAPP     MARIAOLIB    *DFTACTGRP
>> _QRNP_PEP_FIPROAPP FIPROAPP     MARIAOLIB    *DFTACTGRP   49000
>> FIPROAPP FIPRO10T     MARIAOLIB    *NEW
>> _QRNP_PEP_FIPRO10T FIPRO10T     MARIAOLIB    *NEW         41300
>> FIPRO10T FIPRO        MARIAOLIB    *NEW         91400
>> BasicHttpBinding_IApplication_SubmitPartialCreditCardApplication 
>> WSDL2RPGRT   WSDL2RPG     *NEW         446800
>> WSDL2R98_Marshaller_toDateTime WSDL2RPGRT   WSDL2RPG     *NEW
>> 35200        WSDL2R90_AppMsg_sendEscMsgAndDump WSDL2RPGRT   WSDL2RPG
>> *NEW         39300        WSDL2R71_http_DebugLog_dumpCallStack 
>> WSDL2RPGRT   WSDL2RPG     *NEW         20200
>> WSDL2R80_CallStack_dump
>>
>>
>> WSDL2RPG: USR5023: Failed unmarshalling value '*N' of field '*N'. 
>> Cause . . . . . :   The following error message prevented the value of
>> field '*N' from being retrieved from XPath '*N/*N'. Message text  . :
>> Time zone indicator * does not match one of the expected value of: Z,
>> - or + received from procedure: BASICS1R1_f_sndPgmMsg and statement:
>> 54400 ** 2014-11-28-08.30.13.861000: Leaving
>> BasicHttpBinding_IApplication_SubmitPartialCreditCardApplication()
>>
>> Thank you, Maria Orcy Rosar City Furniture - IT Department
>>
>> -----Original Message----- From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
>> thomas.raddatz@xxxxxxxxxxx Sent: Thursday, November 27, 2014 2:41 AM
>> To: HTTPAPI and FTPAPI Projects Subject: RE: Marshaller_toDateTime 
>> parameters options
>>
>> Tomas,
>>
>> At least we are one step further, because now you got an error when 
>> unmarshalling a value. That means, that you received a response from 
>> the server!
>>
>> Please enable the debug log, call the web service again and eventually 
>> send the log to me. For now I have no idea how to make my test web 
>> service not to add the timezone portion, which makes it difficult to 
>> test. Also I need to know the exact data type that you received from 
>> the server.
>>
>> At the moment I assume that it is a time value that causes the error, 
>> because the XML time format (e.g. 16:29:59) does not match the ISO 
>> format, that %time() expects. Hence it might be the
>> UnMarshaller_toTime() that fails working when no timezone information 
>> is available:
>>
>> other; time = %time(inTimeShort.value);     // no time zone inf.
>> available endsl;
>>
>> On the other hand that cannot be the truth, because the unmarshaller 
>> calls parseXmlTime() to convert the time to ISO format.
>>
>> The UnMarshaller_toDate() unmarshaller should work just fine, because 
>> the XML date format (e.g. 2014-11-29) equals the ISO format:
>>
>> other; date = %date(inDate.value);    // no time zone inf. available 
>> endsl;
>>
>> The same should be true for UnMarshaller_toDateTime(), because it 
>> calls adjustTimestamp(), if no timezone is present:
>>
>> other; timestamp = adjustTimestamp(inTimestamp); // no time zone inf.
>> available endsl;
>>
>> I am stuck. I cannot reproduce the problem with the debugger, but the 
>> debug log should tell us the truth.
>>
>> Regards,
>>
>> Thomas.
>>
>>
>>> Tomas Martinez <Tomasm@xxxxxxxxxxxxxxxxxx> hat am 26. November 2014 
>>> um 22:28 geschrieben:
>>>
>>>
>>> Thomas, Thanks for the detail instructions. I made the changes and 
>>> everything compiled properly. But it looks like there is still 
>>> something missing because it doesn't like the fact the that TimeZone 
>>> is not there.
>>>
>>> We keep getting this error:
>>>
>>> WSDL2RPG: USR5023: Failed unmarshalling value '*N' of field '*N'. 
>>> Cause . . . . . : The following error message prevented the value of  
>>> field '*N' from being retrieved from XPath '*N/*N'. Message text .
>>> : Time zone indicator * does not match one of the expected value of:
>>> Z, - or +
>>>
>>> Thanks,
>>>
>>> Tomas Martinez -----Original Message----- From:
>>> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Thomas 
>>> Raddatz Sent: Tuesday, November 25, 2014 8:44 AM To: HTTPAPI and 
>>> FTPAPI Projects Subject: Re: Marshaller_toDateTime parameters options
>>>
>>> Tomas,
>>>
>>> Today there is no option to restrict the time zone portion from being 
>>> added to date and time values. But it is not that difficult to add 
>>> it.
>>>
>>> On my development system I changed the following source members:
>>>
>>> TYPES_H: --------
>>>
>>> Added: D WSDL_NO_TIMEZONE... D C '*NONE'
>>>
>>> WSDL2R98: ---------
>>>
>>> Changed Marshaller_toDate(), added %trimR): B01 if (%parms() >= 
>>> p_timeZone); value = value + %trimR(getXmlTimeZone(i_timeZone)); X01 
>>> else; value = value + %trimR(getXmlTimeZone(WSDL_LOCAL_TIMEZONE));
>>> E01 endif;
>>>
>>> Changed Marshaller_toTime(), added %trimR): B01 if (%parms() >= 
>>> p_timeZone); value = value + %trimR(getXmlTimeZone(i_timeZone)); X01 
>>> else; value = value + %trimR(getXmlTimeZone(WSDL_LOCAL_TIMEZONE));
>>> E01 endif;
>>>
>>> Changed getXmlTimeZone(), replaced first if/endif block: B01 select; 
>>> X01 when (i_timeZone = WSDL_NO_TIMEZONE); return ''; X01 when 
>>> (i_timeZone = WSDL_LOCAL_TIMEZONE); timeZone = 
>>> f_rtvSysval_char('QUTCOFFSET'); X01 other; timeZone = i_timeZone;
>>> E01 endsl;
>>>
>>>
>>> With these changes in place you can add WSDL_NO_TIMEZONE to the 
>>> procedure calls of your marshaller procedures like this:
>>>
>>> Before:
>>>
>>> '<tns1:date>' + Marshaller_toDate(
>>> i_impl_echoDateTime.aDateTimeStructure.date ) + '</tns1:date>' +
>>>
>>> After:
>>>
>>> '<tns1:date>' + Marshaller_toDate(
>>> i_impl_echoDateTime.aDateTimeStructure.date : WSDL_NO_TIMEZONE ) + 
>>> '</tns1:date>' +
>>>
>>> I am going to make my changes available with 1.16beta7 soon. But of  
>>> course you can modify your copy of WSDL2RPG right now.
>>>
>>> Regards,
>>>
>>> Thomas.
>>>
>>> Am 25.11.2014 01:45, schrieb Tomas Martinez:
>>>> Hi,
>>>>
>>>> Marshaller_toDateTime() returns the Time zone if not provided, is  
>>>> there a way have it NOT return the time zone?
>>>>
>>>>
>>>> The web service we are connecting to is having problems processing  
>>>> the time stamp that contains the Time Zone for certain fields and  
>>>> have asked us to stop sending it.
>>>>
>>>>
>>>> Thanks you in advance for your help.
>>>>
>>>> Tomas T. Martinez | IT Department |Senior Systems Analyst City 
>>>> Furniture | 6701 N Hiatus Road | Tamarac, FL 33321 | 
>>>> [1]www.cityfurniture.com
>>>>
>>>> References
>>>>
>>>> 1. http://www.cityfurniture.com/
>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>>
>>>>
> --
>>>> - 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
> -----------------------------------------------------------------------
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
> 

Attachment: wsdl2r98_changes.zip
Description: Zip archive

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------