NetTalk Central

Author Topic: Time and date format in webservicemethod  (Read 2924 times)

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Time and date format in webservicemethod
« on: November 26, 2016, 01:32:27 AM »
Hello

I still have problems with the time and date formats.
Webservicemethod does not correspond to the correct format.

Jari

<?xml version="1.0"  encoding="utf-8"?>
<syncAuto_matkat_response xmlns="sync">
  <Tilausosoitteet>
      <autm_aika_date>78722</autm_aika_date>
      <autm_aika_time>3060001</autm_aika_time>
   </Tilausosoitteet>
</syncAuto_matkat_response>

osquiabro

  • Hero Member
  • *****
  • Posts: 677
    • View Profile
    • Email
Re: Time and date format in webservicemethod
« Reply #1 on: November 26, 2016, 11:34:34 AM »
go to embeds, capsesoft objects, and find SaveCurrentFieldToXml(SaveCurrentFieldToXML   PROCEDURE (Long p_x,Long p_DimCounter,String p_name) and then

if p_name = 'autm_aika_date'
    self.FormatCurrentField('@d02')   <--- your format
END

if p_name = 'autm_aika_time'
    self.FormatCurrentField('@t06')   <--- your format
END

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Re: Time and date format in webservicemethod
« Reply #2 on: November 27, 2016, 11:44:19 PM »
Thanks Osquiabro

Problem is in Netwebservisemethod and there is no need to use xFiles object extension.
I added it anyway, but it did not help.

The same problem is with json

Jari



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Time and date format in webservicemethod
« Reply #3 on: November 30, 2016, 04:31:59 AM »
>>  there is no need to use xFiles object extension.

there is if you intend to override a method.

>> I added it anyway, but it did not help.

add it as an extension, make sure the object name is XML, and on the web services method property _untick_ the option to "generate the xml".

cheers
Bruce


jari@softmade.fi

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Re: Time and date format in webservicemethod
« Reply #4 on: November 30, 2016, 06:45:10 AM »
Thanks Bruce and Osquiabro

Now it works fine with XML
How can I fix JSON?

Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Time and date format in webservicemethod
« Reply #5 on: December 12, 2016, 06:43:56 AM »
It's the same approach with json - except it's jFiles not xFiles.
see http://www.capesoft.com/docs/jfiles/jfiles.htm