1 2 Previous Next 17 Replies Latest reply on Aug 13, 2017 8:43 AM by user29748

    XML API randomly throwing <error code="1"/>

    user29748

      I'm currently testing a solution that uses the XML interface, but I randomly get the error in the title as a response when performing HTTP requests. The weird thing is that it randomly starts working after a while, with the same script. I already checked the server logs, here I can read that the server complains about every script step, like "Set Variable" or "Perform Script". If I remove every step from the script it works.

       

      Additional info: after restarting the whole server it *seems* to be working again, probably it has to do with some bad queries. I will test again it after I find a way to solve another problem of IWP.

       

      Will post more informations when I have them, and sorry for the confusing post.

       

      Message was edited by: John White

        • 1. Re: XML API randomly throwing <error code="1"></error>
          nicolai

          To help you with your problem we will need more information. I suggest you post the screenshot of your error with some details of your setup. The Edit note made your post even more confusing.

           

          FileMaker error code 1 is "User canceled action".

          • 2. Re: XML API randomly throwing <error code="1"></error>
            fmpdude

            Does your XML/Schema parse correctly using an XML tool like Oxygen or similar?

             

            What I would do is make sure I could parse the XML using a separate (outside FMP) means to verify that's OK. If the separate XML tool shows now issues with schema, etc., and I can parse the XML using separate means (JDOM, in my case, probably), I would consider this issue a probable bug.

            • 3. Re: XML API randomly throwing <error code="1"></error>
              nicolai

              good point, fmpdude

               

              it's just, the error does not look to me as a parser exception.

              • 4. Re: XML API randomly throwing <error code="1"/>
                beverly

                Agreed. Will check off phone if any images or code has already been posted.

                Because it's an XML request to FMS, I wonder the FMS logs and OS logs for the event.

                Beverly

                Sent from miPhone

                • 5. Re: XML API randomly throwing <error code="1"></error>
                  fmpdude

                  Agreed, but other than a bug, I am not sure what else to look at.

                   

                  Thanks nicolai.

                  • 6. Re: XML API randomly throwing <error code="1"></error>
                    user29748

                    I'm sorry it made the post confusing, and actually after restarting the whole server the problem has disappeared. It has probably to do with the IWP backend that goes into an inconsistent state after some test queries.

                     

                    I know that the error states that "the user canceled the action", but that's pretty meaningless to me. The server logs actually tell a bit more, but not the exact line.

                     

                    Now I'm unable to perform request because I have another problem that blocks me from using the API, I already made a post here... GetFieldName not working with CWP XML let's see how this goes on first. I can't continue testing this until the problem with GetFieldName is solved.

                     

                    Thanks

                    • 7. Re: XML API randomly throwing <error code="1"></error>
                      user29748

                      What schema? The XML generated by the database report?

                      • 8. Re: XML API randomly throwing <error code="1"/>
                        beverly

                        The XML API is web publishing. No connection to the XML generated by the DDR.

                        The "grammar" is what you specify in the request URL (or form post) to the web service (XML API). DDR is another "grammar" / schema / format of XML. The two have no relationship other than 'XML'.

                        Beverly

                        Sent from miPhone

                        • 9. Re: XML API randomly throwing <error code="1"></error>
                          wimdecorte

                          user29748 wrote:

                           

                          I'm sorry it made the post confusing, and actually after restarting the whole server the problem has disappeared. It has probably to do with the IWP backend that goes into an inconsistent state after some test queries.

                           

                          Lingo is important   IWP has nothing to do wth the XML API...  What version of FMS are you using?

                           

                          Sounds like you are using the XML APi to run scripts so the obvious thing is to make sure that all scripts called (including the OnOpen script if there is one) only contains web compatible script steps or that you detect execution by the web publishing engine and branch your code around incompatible steps.

                           

                          If the error happens again, see if you can get the WPE to respond to an XML query that does not contain a script request, something simple like asking for the list of hosted files (-dbnames).  If that works but not the query that also runs a script then perhaps the FMS script engine has given up.  That would be consistent with it working again after a complete machine reboot.

                          You don't need a full reboot to try to get it back, this command line will do:

                           

                          fmsadmin start fmse

                          2 of 2 people found this helpful
                          • 10. Re: XML API randomly throwing <error code="1"></error>
                            user29748

                            That's how I know it then. I was puzzled by @fmpdude answer, which required me to check some xml parsing (?).

                            The FMS version is the latest, 16.0.2, I updated it before asking. I checked the script steps, they are all compatible (except buggy ones). I remember that not including the script request worked. The problem was generated by calling any script, and after some time it started working again, and then it broke again. I wasted almost three hours of debugging on this.

                             

                            I wanted to reboot everything, as there is also IIS here, and I wanted to make sure that any stalled process would be killed permanently.

                             

                            Again, I will start testing it again once I solve the other function problem.

                            Thanks

                            • 11. Re: XML API randomly throwing <error code="1"></error>
                              nicolai

                              Aha, turn it off and on again....

                               

                              Well, that bug report is as confusing as your current post. You are talking about WebDirect, CWP, XML publishing and may be Data API and all with no contents or what are you trying to achieve or a code sample. GetFieldName is a fairly odd function, I never use it, to be honest. Might be you can't use it with web publishing.

                              • 12. Re: XML API randomly throwing <error code="1"></error>
                                user29748

                                Never talked about WebDirect (did I..?), it's all about the XML API. No Data API, I try to stay away from that, as it will probably cost a lot.

                                I use GetFieldName to compose SQL queries that can adapt to field renaming operations, using the SQLRef custom function. So.. it's pretty important, I don't want to change a field and then break who-knows-which-calculations.

                                 

                                And... the problem is confusing for me too. Maybe my post reflected this. I'll try to solve the other problem and if this doesn't happen again I'll just delete it.

                                • 13. Re: XML API randomly throwing <error code="1"></error>
                                  wimdecorte

                                  user29748 wrote:

                                   

                                   

                                  And... the problem is confusing for me too. Maybe my post reflected this. I'll try to solve the other problem and if this doesn't happen again I'll just delete it.

                                   

                                  No need to delete it, just provide more info so that we can test ourselves and see if we can reproduce it or point you to a solution.

                                  • 14. Re: XML API randomly throwing <error code="1"></error>
                                    nicolai

                                    Sorry, you mentioned WebDirect in your other post.

                                     

                                    This is a better description of the problem. Looks like wimdecorte got it right in his answer - FIleMaker script run through FMS XML Publishing

                                     

                                    Try to post an extract of your code. Generally, GetFieldName() need to be evaluated in context, as fa as I remember. So if you are evaluating fieldName (tableName::fieldName), you have to be in the layout based on tableName - based on the correct table occurrence for the a layout.

                                     

                                    Try to add to the script a script step to change to the layout based on the field table context

                                    1 2 Previous Next