NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd on February 25, 2016, 07:07:57 AM

Title: XML format in raw data connecting to someone else's webservice
Post by: terryd 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> ?
Title: Re: XML format in raw data connecting to someone else's webservice
Post by: Bruce 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
Title: Re: XML format in raw data connecting to someone else's webservice
Post by: terryd 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/>