Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

http_fetch options

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    http_fetch options

    Hi everyone,

    I am trying to work with an API that I can call successfully using getpostman.
    The response I get is "failure
    No service was requested. No customer ID. No password. "

    Any help would be greatly appreciated.

    Gregg

    Code:
    dim myxml as c
    dim pfmxr as p
    dim baseurl as c = "http://apidomain.com/scripts/open.dll?"
    dim url as c
    dim settings as p
    
    myxml = <<%txt%
    <!DOCTYPEservice_geocode_addressPUBLIC"-//serviceprovider//service_geocode_address""http://apidomain.com/dtd/service_geocode_address.dtd">
    <service_geocode_address>
    <cid>custid</cid>
    <pw>password</pw>
    <address>1231stStreetN</address>
    <city>Minneapolis</city>
    <state>MN</state>
    <zip>55417</zip>
    </service_geocode_address>
    %txt%
    
    debug(1)
    
    settings.host="apidomain.com"
    settings.page="/scripts/open.dll"
    settings.method="post"
    settings.protocol = "HTTP/1.1"
    settings.header = "Content-Type: application/x-www-form-urlencoded"
    settings.ssl_on = .f.
    settings.ssl_ValidateCert = .f.
    
    
    settings.body=urlencode(myxml)
    settings.query_string="service=service_geocode_address&xml="
    
    pfmxr = http_fetch(settings,.f.)
    QC10pfm02adjusted.png
    QC10pfm01adjusted.png
    QC10pfm03.PNG
    Gregg
    https://paiza.io is a great site to test and share sql code

    #2
    Re: http_fetch options

    I believe you have wandered away from the Mobile/Browser forum and gotten lost.
    There can be only one.

    Comment


      #3
      Re: http_fetch options

      Good morning Stan,

      I actually need this for a desktop application. The goal is to retrieve lat/lon data from a provider other than google.
      Once I get this part right, I should be able to use their other APIs as well.
      Gregg
      https://paiza.io is a great site to test and share sql code

      Comment


        #4
        Re: http_fetch options

        Your post body is XML. You should not urlencode it and set the content type to urlencoded. You should send it as-is and use a content type of either tex/xml or application/xml. You should be able to find out what exactly is expected in the API documentation.

        Lenny Forziati
        Vice President, Internet Products and Technical Services
        Alpha Software Corporation

        Comment


          #5
          Re: http_fetch options

          Hi Lenny,

          I appreciate your response.
          My overabundance of failed efforts suggest I don't understand the http_fetch function as well as I should, and I am sure its the parameters I don't understand.

          Example: http://host.serviceprovider.com/scri...dservice&xml=( your xml goes here... )

          I can handle the url and the page from the above example, but would you be kind enough to show me how to code the items to the right of the "?" ?
          Gregg
          https://paiza.io is a great site to test and share sql code

          Comment


            #6
            Re: http_fetch options

            (disclaimer:i am not an expert in xml) most often the xml document needs a paired descriptors and the content.
            for example and xml request statement will be
            <user>gandhi</user>,<password>some_password</password>
            the program will know it is xml, and the coding is UTF-8 since it is the standard, also i believe that urlencoded is not needed since it is also standard in xml content ( not 100% sure)
            what is important, the tags are not predefined so you can use any tags ( you should supply what the service provider wants and pair should match exactly.)
            for example
            <Response>....</response> is not correct as opposed to <Response>............</Response>
            so in your example
            http://host.serviceprovider.com/scri...dservice&xml=<name>gandhi</name>&<age>67</age>
            something like this
            that xml should be in the http_fetch settings, body as "<name>gandhi</name>&<age>67</age>"
            (you may not need the '&' so look at their example to keep or skip)

            edit:
            i just looked at your first post, ( please disregard the line above) it is assumed this is what they are expecting
            settings.body=urlencode(myxml)
            settings.query_string="<country>USA</country>,<region>NY</region>,<city>new york</city>,<street>33 east end ave</street>"

            this is my guess. since i did not want to reach out apidomain.com most often i encounter unwanted notification so i did not.
            it is my impression the http_fetch.body contains what is the query string. not the query string itself in the settings. you can play with these and see if it works.

            edit2: i am sure you can use http_post also with that url
            the body will contain the geo_code_address in the form of string.
            Last edited by GGandhi; 03-12-2017, 09:43 AM.
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #7
              Re: http_fetch options

              hi Gandhi,

              I have tried http_post as well as http_fetch, and constantly get
              results that say I did not choose a service, or the newest response shown below,
              using this code to setup http_fetch.

              As another option, I have been posting generic domain info because the other company considers this
              proprietary. I can be more frank with the code if I'm working one on one.

              Code:
              pfmxr.body=""
              pfmxr.header=""
              pfmxr.query_string=""
              pfmxr.host="apidomain.com"
              pfmxr.method="POST"
              pfmxr.page="/scripts/open.dll"
              pfmxr.ssl_on = .f.
              pfmxr.ssl_validatecert = .f.
              pfmxr.header = "Content-Type: text/xml"

              PC12err1919.PNG
              Gregg
              https://paiza.io is a great site to test and share sql code

              Comment


                #8
                Re: http_fetch options

                the request header says invalid verb
                so the request needs to be in their list.
                they are looking for the approved verbs.
                will you be able to address that?
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #9
                  Re: http_fetch options

                  you don'e need to post all the information
                  can you post the domain name. as long as that is not virus infected site i can take a look at their documentation and see what they want.

                  edit: i omitted the 'not' and conveyed wrong message.
                  thanks for reading

                  gandhi

                  version 11 3381 - 4096
                  mysql backend
                  http://www.alphawebprogramming.blogspot.com
                  [email protected]
                  Skype:[email protected]
                  1 914 924 5171

                  Comment


                    #10
                    Re: http_fetch options

                    Originally posted by madtowng View Post
                    hi Gandhi,

                    I have tried http_post as well as http_fetch, and constantly get
                    results that say I did not choose a service, or the newest response shown below,
                    using this code to setup http_fetch.

                    As another option, I have been posting generic domain info because the other company considers this
                    proprietary. I can be more frank with the code if I'm working one on one.

                    Code:
                    pfmxr.body=""
                    pfmxr.header=""
                    pfmxr.query_string=""
                    pfmxr.host="apidomain.com"
                    pfmxr.method="POST"
                    pfmxr.page="/scripts/open.dll"
                    pfmxr.ssl_on = .f.
                    pfmxr.ssl_validatecert = .f.
                    pfmxr.header = "Content-Type: text/xml"

                    [ATTACH=CONFIG]43196[/ATTACH]
                    i don't see any string in the body, is that intentional?
                    and that is the error?
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment


                      #11
                      Re: http_fetch options

                      The only part I can think of would be
                      Code:
                      pfmxr.query_string= "service=geocode_address&xml="+myxml
                      which sets up pfmxr.query_string.
                      Gregg
                      https://paiza.io is a great site to test and share sql code

                      Comment


                        #12
                        Re: http_fetch options

                        as far as i know you don't need "service=geocode_address&xml="+
                        your xml or absence of it is throwing the error.
                        thanks for reading

                        gandhi

                        version 11 3381 - 4096
                        mysql backend
                        http://www.alphawebprogramming.blogspot.com
                        [email protected]
                        Skype:[email protected]
                        1 914 924 5171

                        Comment


                          #13
                          Re: http_fetch options

                          what does your myxml say?
                          thanks for reading

                          gandhi

                          version 11 3381 - 4096
                          mysql backend
                          http://www.alphawebprogramming.blogspot.com
                          [email protected]
                          Skype:[email protected]
                          1 914 924 5171

                          Comment


                            #14
                            Re: http_fetch options

                            Code:
                            myxml = <<%txt%
                            <?xml version="1.0" encoding="ISO-8859-1"?>
                            <!DOCTYPEgeocode_addressPUBLIC"-//APIprovider//geocode_address""http://apidomain.com/dtd/geocode_address.dtd">
                            <geocode_address>
                            <cid>customerID</cid>
                            <pw>password</pw>
                            <address>1231stStreetN</address>
                            <city>Minneapolis</city>
                            <state>MN</state>
                            <zip>55417</zip>
                            </geocode_address>
                            %txt%
                            Gregg
                            https://paiza.io is a great site to test and share sql code

                            Comment


                              #15
                              Re: http_fetch options

                              i am just guessing this will work, would you please check this out
                              Code:
                              dim settings as p
                              settingss.host = "apidomain.com/dtd/geocode_address.dtd"
                              setting.method = "POST"
                              settings.body= "<address>1231stStreetN</address><city>Minneapolis</city><state>MN</state><zip>55417</zip>"
                              settings.header = "<cid>customer_id</cid><pw>password</pw>"
                              
                              dim response as p
                              response = http_fetch(settings)
                              show_var(response.body)
                              thanks for reading

                              gandhi

                              version 11 3381 - 4096
                              mysql backend
                              http://www.alphawebprogramming.blogspot.com
                              [email protected]
                              Skype:[email protected]
                              1 914 924 5171

                              Comment

                              Working...
                              X