Results 1 to 5 of 5

Thread: Name Meta-Data Tag

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    1,533

    Question Name Meta-Data Tag

    Hi DAW,

    Reading the help, you can use the Name Meta-Data Tag to rename a struct member used within a WebService.

    Can it be also used to rename a struct ? Or how can I ?

    Sample code

    Code:
    { Name='InventoryInfo' }
    Struct tInventory
      String ItemID
      String Description
      Number OnHandQty
    End_Struct
    
    { Published=True }
    Function InventoryInfo String sItemID Returns tInventory  
      tInventory aInfo
       ...
      Function_Return aInfo
    End_Function

    Based on the example above, the XML webservice returns the following:

    Code:
    <tInventory>
      <ItemID>STARTREK</ItemID>
      <Description>Star Trek Collector Gold Plate</Description>
      <OnHandQty>685</OnHandQty>
    </tInventory>
    Using the new NAME meta-tag, how can I return a structure as follows:

    Code:
    <InventoryInfo>
      <ItemID>STARTREK</ItemID>
      <Description>Star Trek Collector Gold Plate</Description>
      <OnHandQty>685</OnHandQty>
    </InventoryInfo>
    The reasoning behind this is that we WANT to use a standard prefix (t) for all structs, but this does NOT translate well into a webservice xml structure output, as it requires a more "user oriented" naming convention. Having the webservice function InventoryInfo return the struct tInventory as InventoryInfo would be ideal. Instead of being forced to rename the struct from tInventory to InventoryInfo.

    Thanks
    Last edited by raveens; 29-Apr-2020 at 09:25 PM. Reason: more information
    Regards,
    Raveen Sundram

    Software Development Manager
    Excellent Software Ltd
    Auckland, New Zealand
    www.xls.co.nz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •