1 2 3 Previous Next 33 Replies Latest reply on Mar 28, 2014 3:45 PM by iamsloper

    Anyone Gotten FM 13 New Httppost Command to Work?

    smower

      Hello,

       

      Has anyone gotten the FileMaker 13 httppost to work on anything other than the help file example? Can it be used to post xml documents to eBay, FedEx, UPS, Amazon etc.? I have been trying to work with eBay, Amazon and FedEx webservices with it and

       

      httpspost://ws.fedex.com:443/web-services/rate/?<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://fedex.com/ws/rate/v10"><SOAP-ENV:Body><my xml data goes here></SOAP-ENV:Envelope>

       

      returns error messages like this

       

      "<?xml version="1.0" encoding="UTF-8"?>

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>Failure while unmarshalling message: Failed to parse XML text</faultstring><detail><con:fault xmlns:con="http://www.bea.com/wli/sb/context"><con:errorCode>9999</con:errorCode><con:reason>Failure while unmarshalling message: Failed to parse XML text</con:reason></con:fault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>"

       

       

      I can even take named value pair webservices that are stringed together like a get command and paste them into a browser and get results but when I try to do it as an httppost command it doesn't work. For example, the following eBay named value pair when I use the insert from url script step with the following: (putting in my app token)

       

      httppost://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=MyAppNameTokenGoesHere&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=harry%20potter%20phoenix

       

      it gives this error: <?xml version='1.0' encoding='UTF-8'?><errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services"><error><errorId>2038</errorId><domain>CoreRuntime</domain><severity>Error</severity><category>System</category><message>Missing SOA operation name header</message><subdomain>System</subdomain></error></errorMessage>

       

      The following doesn't work either:

       

      httppost://svcs.ebay.com/services/search/FindingService/v1?<findItemsByKeywordsRequest xmlns="http://www.ebay.com/marketplace/search/v1/services"><keywords>harry potter phoenix</keywords></findItemsByKeywordsRequest>

       

      Thanks in advance for your info and working examples if you have any.

       

      Thanks,

      Shawn

        • 1. Re: Anyone Gotten FM 13 New Httppost Command to Work?
          wimdecorte

          Some of the web services that you list require a key/value pair separated by an ampersand.  The HTTPPOST mechanism will try and escape / encode that which makes the request fail.

          I've had no success with anything that requires oAuth because of that.

          • 2. Re: Anyone Gotten FM 13 New Httppost Command to Work?
            smower

            Thank you for your response.  So do you know why the name value pair ebay version below doesn't work?

             

            httppost://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=MyAppNameTokenGoesHere&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=harry%20potter%20phoenix

             

            If I paste the following in a browser (with my app name token) it correctly returns xml data:

             

            http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=MyAppNameTokenGoesHere&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=harry%20potter%20phoenix

             

            Thanks,

            Shawn

            • 3. Re: Anyone Gotten FM 13 New Httppost Command to Work?
              wimdecorte

              if this is what you are feeding the "insert from url" script step: keywords=harry%20potter%20phoenix

               

              Then the script step will re-encode the % character and my guess is that is why it is failing.  Feed it the string with the spaces in it.

              • 4. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                smower

                Thanks, so I tried that and it returns the following error:

                 

                <?xml version='1.0' encoding='UTF-8'?><errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services"><error><errorId>2038</errorId><domain>CoreRuntime</domain><severity>Error</severity><category>System</category><message>Missing SOA operation name header</message><subdomain>System</subdomain></error></errorMessage>

                 

                However, you can see that the operation name is the very first parameter sent.

                • 5. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                  monkeybreadsoftware

                  Well, as some SOAP Services strickly require some HTTP headers to be right, I think you will still sometimes need a plugin (e.g. our MBS Plugin).

                  The new httppost command is more to people who wrote a service explicit for FileMaker users to call it.

                  • 6. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                    smower

                    Thanks so I understand the plugin thing and I do use plugins but they don't work on FM Go so I was hoping the new post commands would solve that problem.  I still don't understand why I can't get a name value pair post to work that doesn't ask for headers?

                     

                    Why does this not work?

                     

                    httppost://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=MyAppNameTokenGoesHere&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=harry%20potter%20phoenix

                     

                    Does anyone have a real life working example of httppost other than: httppost://httpbin.org/post?fname=Ryan&lname=Thomas

                     

                    Was FileMaker just super short sighted on the httppost command?  I have been waiting for a native FileMaker http post option for about 8 years and it appears it does not work for any real needs or is it buggy?

                     

                    Thanks,

                    Shawn

                    • 7. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                      beverly

                      because you didn't seem to understand Wim's reply?

                       

                      you cannot use "%20" in your string. The command will try to encode your encoding (not pretty). Try to use " " (space) for those 'encoded' values in your string. Let the Command do the encoding.

                       

                      Beverly

                      • 8. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                        wimdecorte

                        smower wrote:

                        I do use plugins but they don't work on FM Go so I was hoping the new post commands would solve that problem.

                         

                        As an FYI, plugins can now be used from FM Go in a roundabout way through the new "Perform Script on Server" script step.  It requires that the script is server-compatible and that the FMS config allows the use of plugins.

                        • 9. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                          smower

                          Thanks, in an earlier post today I tried it without the %20 and it still gave the same error.  I should have shown it as this:

                          httppost://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=MyAppNameTokenGoesHere&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=harry potter phoenix

                           

                          but that still gives the exact same error result:

                           

                          <?xml version='1.0' encoding='UTF-8'?><errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services"><error><errorId>2038</errorId><domain>CoreRuntime</domain><severity>Error</severity><category>System</category><message>Missing SOA operation name header</message><subdomain>System</subdomain></error></errorMessage>

                           

                          Have you gotten httppost to work with any web services?

                           

                          Thanks,

                          Shawn

                          • 10. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                            smower

                            Thanks Wim,

                             

                            I am interested in that option if I go with the new FM Server.  I was hoping I could do the http post with a standalone FM Go version.  Do you think the httppost has a bug in it?

                            • 11. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                              wimdecorte

                              Given the error I would think that Ebay expects a certain header to be there and the "insert from URL" does not allow us to set headers.  Or at least I haven't found it.  So not buggy I would say, more likely "incomplete".

                              • 12. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                                slane

                                I think Christian may well be onto something.

                                 

                                Just being able to send a POST doesn't guarantee success. Many web services, and if I recall correctly eBay may be among then, require finer-grained control over the HTTP Request than just being able to set the method to POST instead of GET. IIRC, eBay may require you to set a custom header, or a similar request parameter instead:

                                 

                                http://developer.ebay.com/DevZone/finding/Concepts/MakingACall.html

                                 

                                It looks like you are sending the two that I know of, the app name and operation name, but in any case, teh response you got from eBay tells you that your request is missing an expected component. The question is whether FileMaker's implementation allows you to set that.

                                 

                                If the service requires a custom header, you're out of luck. That's not a problem with FileMaker's implementation per se, so much as a limitation. FileMAker does not let you set HTTP headers on the requests it sends out.

                                 

                                That being said, again, the eBay API lets you send either custom headers or URL params. It looks like you're missing a param eBay expects. Take a look at the list of "Standard URL Parameter or HTTP Header Values" in the page I linked and verify you're sending something for each of them that's needed. IN particular you may be running up against needing a value for X-EBAY-SOA-MESSAGE-PROTOCOL, since you're sending via SOAP. This one alone seems to have NO equivalent URL param, which would mean in turn that you can't use FileMaker's implementation since this call will require a custom header. If you find that's the case, you could try a format other than SOAP, such as JSON.

                                 

                                [EDIT] I wrote the above without seeing Wim'sreply, which says what mine does in many fewer words I would see if you have better luck with JSON.

                                • 13. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                                  monkeybreadsoftware

                                  Well, I've written a lot of sample databases with FileMaker using our plugin, so I know the usual problems.

                                   

                                  Doing a httppost to a php script on your own webserver to do the ebay stuff would work. Because if you make your own proxy script there in php, you can of course set the header and pass back the result. That would work with FM Go just fine.

                                   

                                  But everyone who wants to set headers in FM Pro/Server/Runtime for the SOAP Query should try our MBS plugin. Also if you want to make SSL secure using certificates or you need authentication, you also need a plugin.

                                  • 14. Re: Anyone Gotten FM 13 New Httppost Command to Work?
                                    smower

                                    Thank you all for your comments.  I guess eBay may not allow their get requests to be sent as posts without headers.  That is strange to me, at least I can run some of their commands with the insert from url script as a get.  I am sorely disappointed that FileMaker didn't make the http post more functional.  I really wish that I could use FileMaker go stand alone databases to run http posts to webservices like eBay, FedEx, Ups, Amazon natively.  So I suppose we have to wait another 2 years hoping that FileMaker improves the http post to be able to send headers and to post xml documents to web services?

                                     

                                    Thanks,

                                    Shawn

                                    1 2 3 Previous Next