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

cURL Xbasic Object

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

    cURL Xbasic Object

    I've spent a whole lotta time trying to get a complex API integration underway with the new cURL Xbasic object. But I think I'm stymied on a basic point or two. Right now it appears that I'm not successful in submitting the credentials in the Headers.

    1. Is there any way to look at the object as you build it or otherwise view what's being constructed? If you follow all the examples, you can certainly set all the options, etc. but how to review the output/call so you can maybe see what's wrong?

    2. I need a bunch of stuff in the HTTP Header. So I presume this is OK, for instance:
    Code:
    ce.setOpt("HTTPHEADER", "Content-Type:text/xml")
    ce.setOpt("HTTPHEADER", "charset=utf-8")
    ce.setOpt("HTTPHEADER", "Accept:text/xml")
    ce.setOpt("HTTPHEADER", "SOAPAction: http://www.docusign.net/API/3.0/CreateAndSendEnvelope")
    And, while I'm here, has anyone used cURL (or any Alpha methods) to work with Docusign? I see Scott Binger's given it a run. My client is paying for a bit of tech help from Docusign but so far, no joy here. I do have an idea that if I can see (and share with tech support) what's being emitted/requested then perhaps we can figure out what's wrong.
    -Steve
    sigpic

    #2
    Re: cURL Xbasic Object

    I know absolutely nothing about this. However, for your item 2 regarding headers, did you see THIS ? (Especially the very bottom.)

    Excuse me if that has nothing to do with the issue.

    Ray Lyons

    Comment


      #3
      Re: cURL Xbasic Object

      Yeah, I saw all that Ray and have addressed it in every way possible. I've switched to HTTP_Fetch() and am still having problems. APIs can be "interesting" but this one is especially stubborn.
      -Steve
      sigpic

      Comment


        #4
        Re: cURL Xbasic Object

        Steve,

        I'm also working on integrating an alpha app I've built with docusign. I've started down the path of using node js as there is builtin support in alpha. Docusign provides node js Javascript examples and there are a couple videos by Selwyn demonstrating how xbasic can be used with node js

        Comment


          #5
          Re: cURL Xbasic Object

          Originally posted by Steve Workings View Post
          Yeah, I saw all that Ray and have addressed it in every way possible. I've switched to HTTP_Fetch() and am still having problems. APIs can be "interesting" but this one is especially stubborn.
          Okay, I am totally out of my element here, but for headers would something like the following be of any help? Don't see how it would relate to cURL but maybe?

          Code:
          dim alpha as P
          alpha = http_get("http://www.alphasoftware.com/")
          a5_show_html(alpha.headers)
          If not, either ignore or say "No", and in either case, I'm wasting your time and will stop.

          Ray

          Comment


            #6
            Re: cURL Xbasic Object

            Just looking at what's available from Docusign and their API examples another option would be to compile a .Net assembly in Visual Studio into a DLL and then use Alpha's native ability to call an external .Net library passing the parameters from Alpha. All you would have to do to distribute your app would be to include the DLL in your published files.
            Brad Weaver, President
            ComputerAid International
            Ottawa ON Canada
            Versailles KY USA
            www.compuaid.com

            Comment


              #7
              Re: cURL Xbasic Object

              I have successfully created the .net integration Steve but I wanted to use xbasic to interface with docusign, there is more control.

              I think the node js option is the best

              Comment


                #8
                Re: cURL Xbasic Object

                Still experimenting. Can't seem to get things rolling with the cURL Xbasic object. So it's an easy switch to http_fetch(). But while that call doesn't work either from Alpha's IDE, Docusign's tech can put the exact text I emit into Postman and it works. If we can figure out what's "different" coming out of the A5 IDE I'll be all set.
                -Steve
                sigpic

                Comment


                  #9
                  Re: cURL Xbasic Object

                  Steve,

                  Are you interested in seeing a working node.js solution?

                  I feel like I am invisible here : )
                  Last edited by coleresources; 05-31-2015, 08:51 PM.

                  Comment


                    #10
                    Re: cURL Xbasic Object

                    Lots of ways to do this Josh. I've already spent a ton of time with the cURL attempt, am within an inch of success using http_fetch() and that's enough for me right now. Sure, I'd like to have this implementation in about 5 different ways, but someone's gotta pay the bills.
                    -Steve
                    sigpic

                    Comment


                      #11
                      Re: cURL Xbasic Object

                      This really deserves another thread, but going to keep it here anyway. As noted elsewhere, the POST I'm doing with HTTP_Fetch() is returning this error when run from the A5 IDE, but not if you take the same POST and call it with, say, Postman.

                      Could not connect to server: WSANO_DATA - Valid name, no data record of requested type while getting host name..

                      Detailed Description:
                      The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.
                      The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName)
                      which uses the DNS (Domain Name Server).
                      An MX record is returned but no A record�indicating the host itself exists, but is not directly reachable.
                      Docusign's tech support says, and some web searches confirm, that this is a Winsock error.

                      Here is my POST header:

                      Code:
                      POST / HTTP/1.1
                      Host: https://demo.docusign.net/api/3.0/dsapi.asmx
                      Connection: close
                      X-DocuSign-Authentication:<stuff here...>
                      Content-Type:text/xml 
                      charset=utf-8
                      Accept:text/xml
                      SOAPAction: http://www.docusign.net/API/3.0/CreateAndSendEnvelope
                      Content-Length: 348021
                      So, anyone know what I need to do?
                      -Steve
                      sigpic

                      Comment


                        #12
                        Re: cURL Xbasic Object

                        Cole, I've been working on a third option which is integrating from Github a docusign API library written in .Net that includes classes and methods to fully interact with the Docusign REST services. I'm stuck on a couple of points at the moment but if I can get it working it should be a fairly elegant way of integrating the DocuSign API into Alpha. In the meantime I'd love to see your NodeJS solution as well. Great opportunity to learn a few tricks that could come in handy down the road.
                        Brad Weaver, President
                        ComputerAid International
                        Ottawa ON Canada
                        Versailles KY USA
                        www.compuaid.com

                        Comment


                          #13
                          Re: cURL Xbasic Object

                          Steve,

                          I have only minimal experience with http functions. I few years back i did some work on an EDI solution using SOAP. The cause of the problem I had at the time was pointed out to me to be including page information in the 'host:' info. if you checkout the wiki page for http_fetch you will notice that host server and the page to request are specified separately. Checking out some examples of POST on the net in line with your format shows that the 'page' portion goes after the 'POST' keyword and the server is specified by host: and does not include the http

                          Try
                          Code:
                          POST /api/3.0/dsapi.asmx HTTP/1.1
                          Host: demo.docusign.net
                          Connection: close
                          ..............
                          ...........
                          I don't know how to specify to use https over http though.
                          Tim Kiebert
                          Eagle Creek Citrus
                          A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                          Comment


                            #14
                            Re: cURL Xbasic Object

                            Thanks Tim. I was just starting to fool more with the http_fetch() parameters. If I remove the Host: from the header, I get an error that "Host must be specified."
                            -Steve
                            sigpic

                            Comment


                              #15
                              Re: cURL Xbasic Object

                              Your welcome Steve. Yes you still need to specify the host. But the host(.host) is just the server address. the resource at that server would go in the '.page' parameter.
                              Code:
                              dim request as P
                              dim response as P
                              
                              request.host = "demo.docusign.net"
                              request.page = "/api/3.0/dsapi.asmx"
                              
                              response = http_fetch(request)
                              Tim Kiebert
                              Eagle Creek Citrus
                              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                              Comment

                              Working...
                              X