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

    #16
    Re: cURL Xbasic Object

    Yes, tried that and many other things. Here's my current Header, but same result:

    Code:
    POST /api/3.0/dsapi.asmx HTTP/1.1
    Host: https://demo.docusign.net
    Connection: close
    X-DocuSign-Authentication:<DocuSignCredentials>...</DocuSignCredentials>
    Content-Type:text/xml 
    charset=utf-8
    Accept:text/xml
    SOAPAction: http://www.docusign.net/API/3.0/CreateAndSendEnvelope
    Content-Length: 348029
    -Steve
    sigpic

    Comment


      #17
      Re: cURL Xbasic Object

      Originally posted by Steve Workings View Post
      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.



      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?
      Yes, it is a Winsock error. And it is not related to the actual POST that you've created. Winsock is complaining that it cannot even resolve the proper IP address for the specified host in order to make the initial connection.

      What exactly are you specifying for the host when you set up your http_fetch() call? It looks like you may be specifying https://demo.docusign.net, and that is a URI, not a host. The host would just be demo.docusign.net

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

      Comment


        #18
        Re: cURL Xbasic Object

        The next prerelease will include additional validation in http_fetch() to handle a full URI being provided as a hostname. In this case, it will extract just the hostname from the URI and use it as appropriate.

        -Lenny

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

        Comment


          #19
          Re: cURL Xbasic Object

          Thanks Lenny. At least I've been able to change the behavior.

          When I specify the host as "demo.docusign.net", and run this:

          resp = http_fetch(req, .t.)
          showvar(resp)

          I get:

          Body error:
          Code:
          <html><body><h1>400 Bad request</h1>
          Your browser sent an invalid request.
          </body></html>
          and
          headers:
          Code:
          HTTP/1.0 400 Bad request
          Cache-Control: no-cache
          Connection: close
          Content-Type: text/html
          -Steve
          sigpic

          Comment


            #20
            Re: cURL Xbasic Object

            I have successfully created a document, then a template, and then sent it to me for signing, and signed using DocuSign.

            I'm using the REST API and pieced together the requirements for a successful login call and envelope call using a templateid with the XBasic cURL genie and the DocuSign REST API Explorer.

            Although there's a lot of documentation for DocuSign it is, on the whole, kinda terrible. Some of their cURL examples are for V1 and are incomplete or simply just wrong enough to make you wander through their API.

            I'll post it if you want it... but it's not for SOAP. If SOAP or http_fetch() is what you're after then I won't bother. I've read on their site that SOAP, although available, may not be kept up to date... so I woudn't use it.

            Comment


              #21
              Re: cURL Xbasic Object

              In working on the .Net DLL integration I discovered a bug in Alpha's routines that will be fixed in tomorrow's pre-release to allow reading and writing to static properties in a class without a constructor. Once I have that working I believe I'll be able to utilize the library available at: https://github.com/docusign/DocuSign-.NET-Client. It's very full-featured and uses REST connected to the V2 API. I'll let you know what I find once I get the newest update to Alpha.

              Special thanks to Kurt Rayner at Alpha for looking at this issue and correcting the bug in such a timely fashion!
              Brad Weaver, President
              ComputerAid International
              Ottawa ON Canada
              Versailles KY USA
              www.compuaid.com

              Comment


                #22
                Re: cURL Xbasic Object

                Originally posted by Steve Workings View Post
                Thanks Lenny. At least I've been able to change the behavior.

                When I specify the host as "demo.docusign.net", and run this:

                resp = http_fetch(req, .t.)
                showvar(resp)

                I get:

                Body error:
                Code:
                <html><body><h1>400 Bad request</h1>
                Your browser sent an invalid request.
                </body></html>
                and
                headers:
                Code:
                HTTP/1.0 400 Bad request
                Cache-Control: no-cache
                Connection: close
                Content-Type: text/html
                Your headers are not valid HTTP/1.1. The format is
                <header_name><colon><single space><header value>

                While some servers may tolerate the missing space after the colon in a couple of your headers, charset=utf-8 will not parse as a proper HTTP header and should result in an error. I suspect what you want is
                Content-Type: text/html; charset=utf-8

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

                Comment


                  #23
                  Re: cURL Xbasic Object

                  Okay, with a bit of guidance from Kurt's response I have successfully logged in and sent an envelope using the .Net API. Here's the code necessary to login, fill an envelope with information and link it to a pre-defined template:

                  Code:
                  dim sv as DotNet::Services
                  dim assy as DotNet::AssemblyReference
                  assy.FileName=a5.Get_Path()+"\DocuSign.Integration.Client.dll"
                  DocuSign_Web_Address="http://demo.docusign.net"
                  rs=sv.RegisterAssembly("::",assy)
                  
                  if rs then
                  	'Set the RestSettings properties
                  	RestSettings = DocuSign::Integrations::Client::RestSettings::Instance
                  	RestSettings.IntegratorKey="YourIntegratorKeyGoesHere"
                  	RestSettings.DocuSignAddress=DocuSign_Web_Address
                  	RestSettings.WebServiceURL=DocuSign_Web_Address+"/restapi/v2"
                  end if
                  
                  'Create an Account class instance and login
                  Dim account as DocuSign::Integrations::Client::Account
                  account.Email="[email protected]"
                  account.Password="YourDocuSignPassword"
                  rs=account.login()
                  
                  if rs then
                  	'Create and send an envelope based on a template
                  	Dim envelope as DocuSign::Integrations::Client::Envelope
                  	envelope.Login=account
                  	envelope.TemplateId="GUID-of-Docusign-Template" 'ID of template in DocuSign
                  
                  	'Create an array of template roles to attach to the envelope with recipient information - for testing just make it one
                  	Dim template_roles[1] as DocuSign::Integrations::Client::TemplateRole
                  	template_roles[1].name = "John Doe" ' Recipient name
                  	template_roles[1].email = "[email protected]" ' Recipient Email
                  	template_roles[1].roleName="YourTemplateRole" ' RoleName in template - I used RoleOne for instance
                  
                  	'Assign the array of recipients to the envelope
                  	envelope.TemplateRoles=template_roles
                  	envelope.EmailSubject = "DocuSign Alpha Client - Signature Request from Template"
                  	envelope.Status = "sent"
                  
                  	'Attempt to send the email(s)
                  	result=envelope.Create()
                  
                  	if result then 'Successfully sent so show the Envelope ID - we could capture this and use it to view status updates later
                  		showvar(envelope.EnvelopeId)
                  	end if
                  end if
                  It's actually pretty simple once you get the initial syntax down. The two tricks were figuring out the syntax to access the RestSettings and creating an array of type TemplateRole to submit to the TemplateRoles property of envelope.
                  Last edited by compuaid; 06-01-2015, 06:11 PM.
                  Brad Weaver, President
                  ComputerAid International
                  Ottawa ON Canada
                  Versailles KY USA
                  www.compuaid.com

                  Comment


                    #24
                    Re: cURL Xbasic Object

                    Boy we have a lot of topics in this thread. Anyway, Lenny - your suggestion seems to work about the Header. It's not what Docusign documentation shows and it seems to not matter to Postman. But, at least I don't have an error.

                    Now I'm trying to figure out what else is going on as I'm getting back a parsed_headers.status_code = 302. This is getting very confusing as it seems now that I have to completely re-construct my request and submit it, but when I do, Docusign complains right away with a "Not Found". This makes less and less sense as I go, and I'm getting crap help so far from their paid tech support.
                    -Steve
                    sigpic

                    Comment


                      #25
                      Re: cURL Xbasic Object

                      Another update. Turns out that http_fetch() and it's resulting 302 response is just a killer. After 3 weeks of trying. cURL doesn't seem to do the job, or at least no one knows how. Glad a couple of you are trying the .NET but I can't use the REST API for various reasons so now I'll have to figure out .NET and and SOAP API.
                      -Steve
                      sigpic

                      Comment


                        #26
                        Re: cURL Xbasic Object

                        Steve, just a question - based on the fact that the SOAP API is older and may not continue to be updated in the future what would force you to go that route rather than the newer and more full-featured REST API? I used the REST API mainly to leverage the full-featured open source .NET library available through Github that's already been written (I hate reinventing the wheel!) I'm sure you can write a similar library for SOAP using the examples provided and simply expose those classes in a "roll your own" DLL and it shouldn't be too difficult but I just was curious as to what kind of circumstances would make REST unusable in an environment.
                        Brad Weaver, President
                        ComputerAid International
                        Ottawa ON Canada
                        Versailles KY USA
                        www.compuaid.com

                        Comment


                          #27
                          Re: cURL Xbasic Object

                          I had an initial discussion with their sales and tech, and we all agreed that because their REST API uses OAuth, it is not appropriate for this implementation on an Intranet where Oauth cannot complete its validation. Looking further now I'm not so sure of the accuracy of all those assumptions. But, I'm going to stick with http_fetch() and the SOAP because I got it working last night (er, this morning) after their tech guy mentioned that there's a redirect in the sandbox that's causing the 302 response, and that redirect is not in the final implementation. After a bit more experimenting, I'm on my way now.
                          -Steve
                          sigpic

                          Comment


                            #28
                            Re: cURL Xbasic Object

                            Glad you got it working. Sounds like your tenacity paid off. This has been a good project to try and push the .NET integration capabilities to a bit more of a limit and also a good proof-of-concept use case for pulling in open source libraries and extending the already terrific capabilities of Alpha.
                            Brad Weaver, President
                            ComputerAid International
                            Ottawa ON Canada
                            Versailles KY USA
                            www.compuaid.com

                            Comment


                              #29
                              Re: cURL Xbasic Object

                              Not working. Nearly 2 days ago I moved my code -- the exact stuff that works on my local PC - to my client's development PC for further development. Haven't been able to succeed a single time from there, despite using the exact same code. I think the clue is in my response.headers which vary substantially between my local success and the new machine failure.

                              Successful headers:
                              HTTP/1.1 200 OK
                              Cache-Control: private, max-age=0
                              Content-Length: 3632
                              Content-Type: text/xml; charset=utf-8
                              X-RateLimit-Reset: 1433383200
                              X-RateLimit-Limit: 1000
                              X-RateLimit-Remaining: 998
                              Date: Thu, 04 Jun 2015 01:22:13 GMT
                              Vary: Accept-Encoding
                              Connection: close
                              Strict-Transport-Security: max-age=31536000; includeSubDomains
                              Failed headers:
                              HTTP/1.1 500 Internal Server Error
                              Cache-Control: private
                              Content-Length: 1267
                              Content-Type: application/soap+xml; charset=utf-8
                              Date: Thu, 04 Jun 2015 01:14:14 GMT
                              Connection: close
                              Strict-Transport-Security: max-age=31536000; includeSubDomains
                              But I have no idea why.
                              -Steve
                              sigpic

                              Comment


                                #30
                                Re: cURL Xbasic Object

                                Steve,

                                Is this a windows server operating system? It could be the Internet security settings on the server that are causing the problem. If you have access to the server manager you can disable the restrictive access

                                Just a thought

                                Comment

                                Working...
                                X