6 Replies Latest reply on Jun 5, 2012 3:22 PM by KevinFutter

    XML Web Publishing Skips Empty Portal Fields

    EarlSexton,Iv

      Summary

      XML Web Publishing Skips Empty Portal Fields

      Product

      FileMaker Server

      Version

      12 Advanced

      Operating system version

      Windows 7 64-bit

      Description of the issue

      We converted an FP7 solution to FMP12, and noticed that the XML being returned by the FMP12 WPE did not match the XML returned by the FP7 WPE, causing the XML Parsing on our website to parse the returned results incorrectly.

      Some of our Layouts have Portal Fields which reference Tables which are twice-removed from the Layout Table. If there are no related records in those twice-removed reference tables, then the FMP12 WPE does not return any value, even an empty one, for those Portal Fields in the XML it generates.

      For example, the will list six s (including the Portal Field), but the for that record will only list five s (skipping the Portal Field). In certain circumstances, this makes it impossible to determine what data is being returned for which field.

      Steps to reproduce the problem

      I have a test file which I created in FP7 and converted to FMP12 which demonstrates the problem which I could send, if that would be helpful.

      First, I created a new file with 4 tables:

      Records
      Related_Records_A
      Related_Records_B
      Related_Records_C

      I created the following fields for each of these tables:

      Records::ID
      Records::Related_Records_A_ID
      Records::Value

      Related_Records_A::ID
      Related_Records_A::Value

      Related_Records_B::ID
      Related_Records_B::Related_Records_A_ID
      Related_Records_B::Value

      Related_Records_C::ID
      Related_Records_C::Related_Records_A_ID
      Related_Records_C::Value

      Then, I linked the Table Occurrences together in the following manner:

      Related_Records_A::ID <=> Records::Related_Records_A_ID
      Related_Records_A::ID <=> Related_Records_B::Related_Records_A_ID
      Related_Records_A::ID <=> Related_Records_C::Related_Records_A_ID

      I modified the Records Layout, adding portals for Related_Records_A::Value, Related_Records_B::Value, and Related_Records_C::Value.

      Then, I created the following records:

      Records::ID = 1
      Records::Related_Records_A_ID = 1
      Records::Value = Record

      Records::ID = 2
      Records::Related_Records_A_ID = 2
      Records::Value = Record

      Related_Records_A::ID = 1
      Related_Records_A::Value = Record A

      Related_Records_A::ID = 2
      Related_Records_A::Value = Record A

      Related_Records_B::ID = 1
      Related_Records_B::Related_Records_A_ID = 1
      Related_Records_B::Value = Record B or C?

      Related_Records_C::ID = 1
      Related_Records_C::Related_Records_A_ID = 2
      Related_Records_C::Value = Records B or C?

      Finally, I make an XML WPE Find All call to the Records layout:

      /fmi/xml/FMPXMLRESULT.xml?-db=Test&-lay=Records&-findall

      Expected result

      This is the result we used to receive on FileMaker Server 11 Advanced:

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <!DOCTYPE FMPXMLRESULT PUBLIC "-//FMI//DTD FMPXMLRESULT//EN" "/fmi/xml/FMPXMLRESULT.dtd">

           0
           
           
           
                
                
                
                
                
                
           

           
                
                     
                          1
                     
                     
                          1
                     
                     
                          Record
                     
                     
                          Record A
                     
                     
                          Record B or C?
                     
                      <!-- MISSING IN FILEMAKER SERVER 12 -->
                

                
                     
                          2
                     
                     
                          2
                     
                     
                          Record
                     
                     
                          Record A
                     
                      <!-- MISSING IN FILEMAKER SERVER 12 -->
                     
                          Record B or C?
                     
                

           

      Actual result

      And this is the result we receive in FileMaker Server 12. Note six s in the , and the five s in each of the s:

      <?xml version ="1.0" encoding="UTF-8" standalone="no" ?>
      <!DOCTYPE FMPXMLRESULT PUBLIC "-//FMI//DTD FMPXMLRESULT//EN" "http://localhost:80/fmi/xml/FMPXMLRESULT.dtd">

           0
           
           
           
                
                
                
                
                
                
           

           
                
                     
                          1
                     
                     
                          1
                     
                     
                          Record
                     
                     
                          Record A
                     
                     
                          Record B or C?
                     
                

                
                     
                          2
                     
                     
                          2
                     
                     
                          Record
                     
                     
                          Record A
                     
                     
                          Record B or C?
                     
                

           

      Workaround

      There are two workarounds that I can think of.

      The first one would be to remove the Portal Fields which reference Tables which are twice-removed from the Layout Table, and pull the information we need from the FileMaker Solution using a second query to the XML WPE.

      Another solution might be to switch to the PHP WPE. However, this behavior may present itself in the PHP WPE as well.

      I have not tried either of these solutions yet.

      FileMaker_12_XML_WPE_Bug.png