NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: jari@softmade.fi on November 26, 2016, 01:32:27 AM

Title: Time and date format in webservicemethod
Post by: jari@softmade.fi 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>
Title: Re: Time and date format in webservicemethod
Post by: osquiabro 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
Title: Re: Time and date format in webservicemethod
Post by: jari@softmade.fi 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


Title: Re: Time and date format in webservicemethod
Post by: Bruce 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

Title: Re: Time and date format in webservicemethod
Post by: jari@softmade.fi on November 30, 2016, 06:45:10 AM
Thanks Bruce and Osquiabro

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

Jari
Title: Re: Time and date format in webservicemethod
Post by: Bruce 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