NetTalk Central

Author Topic: XML format in raw data connecting to someone else's webservice  (Read 3642 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
XML format in raw data connecting to someone else's webservice
« on: February 25, 2016, 07:07:57 AM »
The webservice that I need to connect to has fields like this but the fields are not required fields
      <Initials>string</Initials>
      <SurName>string</SurName>
      <IDNo>string</IDNo>
      <CompanyName>string</CompanyName>

If I capture fields the raw data looks like this
    <Initials>TP</Initials>
    <SurName>Davidson</SurName>
    <IDNo/>
    <CompanyName/>

Is the format of the IDNo and CompnayName OK, or should it be created as <IDNo></IDNo> ?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: XML format in raw data connecting to someone else's webservice
« Reply #1 on: February 25, 2016, 10:50:35 PM »
those are ok. It's an XML short-hand for empty fields.
In theory, all the following are equivalent;

[leave the tag out completely]

<tag></tag>
<tag/>

Not all systems support all 3 forms (xFiles does obviously) but all 3 are legal xml.

cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: XML format in raw data connecting to someone else's webservice
« Reply #2 on: February 26, 2016, 02:28:24 AM »
Thanks.
I knew they were valid I just wasn't sure if the client would require  <tag></tag> instaed of <tag/>
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186