NetTalk Central

Author Topic: Webservice Method Date Format  (Read 4616 times)

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Webservice Method Date Format
« on: December 29, 2014, 07:04:13 AM »
Hi:
  I am trying to return a view from a file using NetWebServiceMethod and one of the fields has a date. When i see the return, i just see the Clarion date not formatted.

  I know i am missing something, but how can i format that field to return the formatted date in the XML?

  Thanks for your help!

HTTP/1.1 200 OK
Date: Mon, 29 Dec 2014 14:58:35 GMT
Server: NetTalk-WebServer/8.32
Content-Length: 1486
Content-Type: text/xml
Set-Cookie: SESSIONID=t2g8ZKh2s83Hv36Ksa6g7BoV11vjUm; path=/; HttpOnly
Connection: close
X-Frame-Options: sameorigin

<?xml version="1.0"  encoding="utf-8"?>
<RequistionsByPatient_response>
  <Results>
    <RRH_ACCOUNTNUMBER>1</RRH_ACCOUNTNUMBER>
    <RRH_REQUESTNUMBER>1</RRH_REQUESTNUMBER>
    <RRH_DATEORDER>76392</RRH_DATEORDER>
    <RRH_PATIENT1STLASTNAME>LASTNAME</RRH_PATIENT1STLASTNAME>
    <RRH_PATIENT2NDLASTNAME/>
    <RRH_PATIENTNAME>NAME</RRH_PATIENTNAME>
    <RRH_PATIENTINITIAL/>
  </Results>
  <Results>
 </RequistionsByPatient_response>

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Webservice Method Date Format
« Reply #1 on: December 30, 2014, 11:52:38 PM »
Hi Ura,

It seems to me that this is perhaps slightly harder than it needs to be, but this is the mechanism for now;

a) add an xFiles object to the method procedure. Set the Object Name to
xml
(This is important.)

b) you can set the settings for this object any way you like, but assuming you want it to "be the same" - on the Options tab for the object tick on "Override Global Settings" and then tick OFF "Remove File Prefix from field labels" and "Replace Colon in field name with a dot".

c) Now you have full access to the xml object, so for formatting purposes you can follow these instructions;
http://www.capesoft.com/docs/xFiles/xfiles.htm#FormattingSaveField

Cheers
Bruce




urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Webservice Method Date Format
« Reply #2 on: December 31, 2014, 05:34:49 AM »
It works Bruce. I have a warning of Label duplicated, using second xml, but it is expected.

Thank you!

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Webservice Method Date Format
« Reply #3 on: December 31, 2014, 06:41:50 AM »
Sorry Ura, I forgot to add in that you need to turn _off_ the option;

"Generate XML Object" on the General tab.

cheers
Bruce


urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Webservice Method Date Format
« Reply #4 on: January 02, 2015, 05:54:07 AM »
Hi Bruce:
  The only option i found similar to the one you mention is this.

If i disable that option, i do not have the object that have the p_name in the parameters to format the field.

Thank you for your help!



[attachment deleted by admin]

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Webservice Method Date Format
« Reply #5 on: January 02, 2015, 05:56:45 AM »
Ok Bruce forget it. I found it  ;D

To share the knowledge



[attachment deleted by admin]