1 2 Previous Next 17 Replies Latest reply on Apr 25, 2013 12:23 AM by dasc

    Problem using webviewer to display working URL - encoding problem?

    dasc

      Hi all,

       

      I have a problem using this URL in webviewer, I keep getting error 404 file or directory not found, it works ok in IE or Chrome, I guess I am having an encoding problem but I do not know how to solve it, I left out the actual login and password info.

      http://149.5.17.108/fmi/iwp/cgi?dbpath=%2Ffmi%2Fiwp%2Fcgi%3F-db%3DHelp_topics%26-startsession&acct=account&name=username&password=password&login=Login&-authdb

       

      Thanks,

       

      Danny

        • 1. Re: Problem using webviewer to display working URL - encoding problem?
          mikebeargie

          Why are you trying to load an IWP window inside of filemaker???

           

          I'd imagine that's causing a conflict or some sort of identity issues with the webviewer.

          • 2. Re: Problem using webviewer to display working URL - encoding problem?
            dasc

            Hi Mike,

             

             

             

            The reason is, this is a helpdesk database located on a server outside the customer site (helpdesk is on our own server, the customer solution is on their server), the customer has to able to see the helpdesk article I am directing them to, the helpdesk article is an mp4 file.

             

            The customer is using our solution using Filemaker via terminalserver, we want the customer to see the helpdesk article without leaving the database solution.

             

             

             

            Kind regards,

             

             

             

            Danny

            • 3. Re: Problem using webviewer to display working URL - encoding problem?
              mikebeargie

              I'm not sure you can load IWP pages inside of filemaker, but I've never tried or seen a use for it before.

               

              But given your error messages and description above, if it IS possible, you would most likely be getting 404 errors from some problem with the terminal / network configuration not respecting the address of your web server ( http://149.5.17.108 ) from it's location context.

               

              If they're on the local network (even if connecting from outside) when trying to access the file, you need to use the local IP of the web server (IE 192.168.1.50 or something like that). The above IP appears to be from the outside, or a front-facing public IP, which might only work from outside the network (hence why I can load the login page in my browser, or a standard web browser might respect the public IP on a local network, where filemaker does not).

               

              I would try finding the local IP of the web server and seeing if that corrects the problem.

               

              BUT, I would also seriously recommend that you just grant access to the help database from the solution they are using, and bypass IWP and the webviewer all-together. If they are already using filemaker, then there's no reason I know of that you couldn't just add the help database as a reference, restrict what you need via privelege sets, and make layouts that allow for "read only" access.

              • 4. Re: Problem using webviewer to display working URL - encoding problem?
                dasc

                Hi Mike,

                 

                 

                 

                The reason for IWP was that the helpdesk had to be accessible from the outside world also but you are right in stating that it is better to make the link from within their Filemaker to the external server containing the helpfiles.

                 

                 

                 

                Thanks for the quick response,

                 

                 

                 

                Danny

                • 5. Re: Problem using webviewer to display working URL - encoding problem?
                  mikebeargie

                  There's no reason you can't have both.

                   

                  IWP for people that are not on a filemaker client to access the help records from the outside world.

                   

                  Then direct filemaker access for people accessing the records via filemaker.

                  • 6. Re: Problem using webviewer to display working URL - encoding problem?
                    dasc

                    Hello Mike,

                     

                     

                     

                    I forgot to mention that the helpdesk database is a FMP12 database and the client database is FMP11 so opening the database remotely is not possible.

                     

                     

                     

                    Kind regards,

                     

                     

                     

                    Danny

                    • 7. Re: Problem using webviewer to display working URL - encoding problem?
                      mikebeargie

                      You can bypass that by using FM11 as an ODBC data source in FM12, but that requires server advanced and a lot of extra work.

                       

                      And launching the application to a browser through Open URL is unacceptable?

                      • 8. Re: Problem using webviewer to display working URL - encoding problem?
                        dasc

                        We do use Filemaker server advanced at the client site and even for the helpdesk host.

                         

                        I just want to state my goal clear, the FM11 is client to the FM12 server (advanced) and has to be able to see and hear an mp4 file that explains certain things to the user.

                         

                        I already enabled a feature on the client’s terminalserver (Windows2008R2) to have “enhanced user experience” so that video and audio playback are possible via TS client.

                         

                        Is your suggested ODBC solution going to work with the above mentioned, I ‘m afraid I don’ have much (if any) experience with ODBC use.

                         

                         

                         

                        Kind regards,

                         

                         

                         

                        Danny

                        • 9. Re: Problem using webviewer to display working URL - encoding problem?
                          steve_ssh

                          Hi Danny and Mike,

                           

                          Without weighing in on the topic of what the best way to go about this would be, I'll just throw out an observation as to what I think is happening to cause (or at least contribute to) the 404 error.

                           

                          Assuming you've taken into consideration Mike's apt point about whether or not the target IP address is reachable from the Terminal Server, there is one other obstacle that I believe I'm seeing:

                           

                            The webviewer in the FM11 client is URL-encoding characters in the URL that you specify.

                           

                            Though you specify a URL of:

                           

                                  http://149.5.17.108/fmi/iwp/cgi?dbpath=%2Ffmi%2Fiwp%2Fcgi%3F-db%3DHelp_topics%26-startsession&acct=account&name=username&password=password&login=Login&-authdb

                           

                            By the time FMP encodes part of it and it goes to the server, I believe that the server receives a request such as:

                           

                                  /fmi/iwp/cgi?dbpath=%252Ffmi%252Fiwp%252Fcgi%253F-db%253DHelp_topics%2526-startsession&acct=account&name=username&password=password&login=Login&-authdb

                           

                            Note that in the URL that the server receives, characters in the query string have been escaped, for example:

                           

                                  %2F  became:   %252F   i.e.  the % char was encoded

                           

                           

                          With this in mind, I'd suggest that you try loading the following URL into your webviewer:

                           

                                 http://149.5.17.108/fmi/iwp/cgi?dbpath=/fmi/iwp/cgi?-db=Help_topics&-startsession&acct=account&name=username&password=password&login=Login&-authdb

                           

                             (Note that all I have done is remove the URL-encoding that your original URL contained.)

                           

                           

                          To me, this goes against the grain of my natural sensibilities (or lack thereof), but I just tried putting the above URL into an FM11 webviewer, and, though it complained about bad credentials, it did take me to what is presumably the target IWP page (whereas when I tried the URL you originally posted, I hit the 404 page).

                           

                          If you fix up the credentials, and address the issue that Mike raised about using an accessible IP address, you might be in business...

                           

                          Hope this helps, and best regards,

                           

                          -steve

                           

                          Message was edited by: steve_ssh  24 April 2013:    Nixed the part where I offered a faulty proposal for a workaround.  See post later in this thread for a workaround that was more well-conceived. 

                          • 10. Re: Problem using webviewer to display working URL - encoding problem?
                            dasc

                            Hi Steve,

                             

                             

                             

                            I appreciate your input, I tried to put the code you sent in a webviewer (of course with the username and password filled in), I keep getting the error message “the server could not process your request due to conflicting commands”, then a second error with a longer message, I click OK both times, then I get the IWP login screen, the one I was trying to avoid with my URL containing the username and password, the link that works fine in IE or Chrome.

                             

                            Of course when I fill in the username and password in the IWP login screen, everything works just fine.

                             

                            If you can give me some more feedback, it would be much appreciated.

                             

                             

                             

                            Thanks,

                             

                             

                             

                            Danny

                            • 11. Re: Problem using webviewer to display working URL - encoding problem?
                              steve_ssh

                              Hi Danny,

                               

                              My apologies:  I've checked my work, and it looks as though I had the right idea for a diagnosis, but that I was sloppy in my proposal for a solution.

                               

                              The webviewer does appear to url-encode characters that we don't want url-encoded, but my proposal for a workaround was not correct -- I hadn't thought the issue through well enough.

                               

                              I'll have a little more time this evening to look at this again and see if I can propose something that works.  I'm not sure that I will be able to do so, but I will take a look and give it a go.

                               

                              My apologies for the bad lead,

                               

                              -steve

                              • 12. Re: Problem using webviewer to display working URL - encoding problem?
                                dasc

                                Hi Steve,

                                 

                                 

                                 

                                Looking forward to your suggestions, I have been trying in the meanwhile also, this is the closest thing to getting it work, it gives me an error “the server could not process your request due to a missing command : “” “ and then a longer message, then it shows me the databasename that is being hosted, I can then click it to enter the database, something is missing here or as you suggest some encoding being misunderstood

                                 

                                http://149.5.17.108/fmi/iwp/cgi?dbpath=/fmi/iwp/cgi?-db=Help_topics%26-startsession&acct=account&name=username&password=password&login=Login&-authdb

                                 

                                 

                                Thanks in advance

                                 

                                 

                                 

                                Danny

                                • 13. Re: Problem using webviewer to display working URL - encoding problem?
                                  steve_ssh

                                  Hi Danny,

                                   

                                  I see good new and bad news..

                                   

                                   

                                  The Good News:

                                   

                                    I did manage to rig up an example that seems to do what you need it to do, i.e. take the webviewer directly to your Help Module hosted on IWP, without going through the login.

                                   

                                   

                                  The Methodology:

                                   

                                    To be able to do this, I needed to get around the encoding problem alluded to in the posts above.  The way that I did this was I set up an interim html file ( that you would need to host on a regular webserver ).

                                   

                                    The webviewer first calculates the URL that it really would like to go to.

                                   

                                    It then URL-encodes this URL and includes it as a query string which gets sent to the static interim page.

                                   

                                    (At this point, the webviewer encodes it another time.)

                                   

                                    The interim page is served from a regular webserver, and loads in the webviewer.

                                   

                                    Once loaded in the webviewer, Javascript on the interim page reads the page location, and obtains the query string payload from the location URL.

                                   

                                    The Javascript then url-decodes the query string twice, thus obtaining the true URL that we really wanted to go to.

                                   

                                    The Javascript then sets this URL as the action URL of a dummy form in the interim page.  It then submits the form.

                                   

                                    When the form submits, the webviewer then uses the correct URL to contact the IWP server, and from there, things seem to work as desired.

                                   

                                   

                                  Note:  I don't have a Windows FM client, so I could not do a true test for the Windows case, but I did test the Javascript code in various emulated versions of IE, and the code performed as expected, so there is a decent chance that this will do the trick.

                                   

                                   

                                   

                                  The Bad News:

                                   

                                  Having to first direct the user to the interim page is a security risk, in that you are sending login credentials to a server which may or may not be treating the data with proper security measures.  In particular, the concern that comes to mind is that if the webserver that serves the interim page does logging, then the log files will probably be filling up with username and password information, which would be very bad.

                                   

                                   

                                  Sample Code Attached:

                                   

                                  Attached to this post should be an archive which contains some files so that you can see this in action, understand it, and hopefully improve upon it:

                                   

                                    - A sample FP7 file to run in your FM11 client.  You will need to configure the calculation in the web viewer with the appropriate information; that should be a straightforward task.

                                   

                                    - The interim html file that needs to be hosted somewhere.  I configured the webviewer to look for this file at the document root of your webserver, but it doesn't have to be in that location.

                                   

                                  Please let me know if you have any questions or if you come up with something better (I'd like to know...)

                                   

                                  Very best,

                                   

                                  -steve

                                  • 14. Re: Problem using webviewer to display working URL - encoding problem?
                                    dasc

                                    Hi Steve,

                                     

                                     

                                     

                                    I will try this as soon as possible, it takes some time to prep everything, I will let you know what the result is but judging on what I read it should work as you describe.

                                     

                                    The server hosting the help_topics database is secure, the user can only see the topics, no changes, deletes etc…

                                     

                                    The fact that the login and password info are being sent is no big issue, the accounts used are only for redirecting to the appropriate help_topics record(s)

                                     

                                     

                                     

                                    Thanks,

                                     

                                     

                                     

                                    Danny

                                    1 2 Previous Next