Method Community

 

Error posting WebForm server-side using ASP Classic

Last post 09-24-2015 2:18 PM by Roper724. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 09-23-2015 8:44 PM

    Error posting WebForm server-side using ASP Classic

    I've read the posts about web forms and it surprises me how difficult such a simple thing could be.  Bascially, I used Method to generate a Basic Web-To-Lead form and changed nothing.  I then took the source code and took away all of the javascript and the form HTML tags and preserved the "id" values, including the hidden boxes.  The next step should be very straight forward.  Create an MSXML2.ServerXMLHTTP object, Open the object, set some parameters and send it away.

    But for some reason, I keep getting the following annoying error:

    We couldn't authenticate web form provider. Please contact web form provider for any additional information.

    I read in a post on Method that the "timezonerouter.aspx" might cause some problems.  So I tried submitting my test form (web2lead.asp) using it and not using it.  The same issue arises.

    Now, yes, ASP.NET certainly would be easier by using the Method API's web service.  But unfortunately, I have not delved enough into ASP.NET to appreciate if I require code behind pages or a GUI on my page.  So while it's ironic that I"m a present-day C# and .NET user, I still use good old classic ASP to get my data stuff done.

    Here is my code.  Hopefully someone at Method can give me some insight as to what I'm doing wrong here.  It should work.

    <% @LANGUAGE="VBScript" %>
    <% Response.buffer = true %>

    <%

    'on error resume next

    dim destURL
    dim payload

    ' TRIED USING THE TIME ZONE ROUTER -> DOES NOT WORK.
    'destURL = "https://www.methodintegration.com/method/timezonerouter.aspx?url=https://www.methodintegration.com/MethodWebForms/submit.aspx"


    ' SO WE'RE USING THIS INSTEAD AND ACCEPTING TIMESTAMPS IN EST
    destURL = "https://www.methodintegration.com/MethodWebForms/submit.aspx"

    'Construct the Post Data
    payload = "oid=xxxxxxxxxxxxxxxxxxxxxxxx"      ' note: THE XXXX's here are put here just for my post to Method Forum
    payload = payload & "&formName=" & server.URLencode("Web-To-Lead")
    payload = payload & "&redUrl=" & server.URLencode("http://")

    payload = payload & "&BillAddressAddr3_Step2=" & server.URLencode("101 Some Street")
    payload = payload & "&BillAddressCity_Step2=" & server.URLencode("Toronto")
    payload = payload & "&BillAddressState_Step2=" & server.URLencode("Ontario")
    payload = payload & "&BillAddressPostalCode_Step2=" & server.URLencode("M5N 2T3")
    payload = payload & "&BillAddressCountry_Step2=" & server.URLencode("CA")
    payload = payload & "&CompanyName_Step2=" & server.URLencode("ACME CORPORATION")
    payload = payload & "&FirstName_Step2=" & server.URLencode("John")
    payload = payload & "&LastName_Step2=" & server.URLencode("Doe")
    payload = payload & "&Email_Step2=" & server.URLencode("john.doe@somedomain.com")
    payload = payload & "&Phone_Step2=" & server.URLencode("9051234567")
    payload = payload & "&Description_Step3=" & server.URLencode("these are my comments")


    'Construct the useragent and send
    set http_obj = server.CreateObject("MSXML2.ServerXMLHTTP")
    http_obj.Open "POST", destURL , false
    http_obj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    http_obj.send(payload)


    'Grab the response
    strResponse = http_obj.ResponseText


    set http_obj=nothing

    Response.write(strResponse)
    Response.end

    %>

    IT SURE WOULD BE NICE TO GET THIS WORKING :)

    John
  • 09-24-2015 7:51 AM In reply to

    • jsenick
    • Top 150 Contributor
    • Joined on 03-29-2013
    • Jamestown, NY USA
    • Posts 35

    Re: Error posting WebForm server-side using ASP Classic

    The error you are receiving is the same as you would encounter if you were to visit the sbmission url directly without form data.  Method is basically saying that it can't verify  from where the firm is being submitted.

    The standard "is it plugged in" type questions may apply:

    Is the domain name that submits the form listed in the appropriate web to lead form wizard step?... seems like step 2 or 3

    Is the oid correct?

    Outside of that, I use a referrer header as part of the form which may or may not help. Also, I don't think it affects your current error. But I believe the firm field you have as redUrl should be retUrl. I don't have my code in front if me to verify.

    I am not well versed in asp. My code is all coldfusion. But I'd be happy to share what I have working if you do not get a solution by the time I get in to work today.

    Good luck.

    James







    James Senick
    JamestownStamp.com
  • 09-24-2015 8:00 AM In reply to

    • jsenick
    • Top 150 Contributor
    • Joined on 03-29-2013
    • Jamestown, NY USA
    • Posts 35

    Re: Error posting WebForm server-side using ASP Classic

    I am trying to post from my phone which is extremely frustrating. So, I apologize for this being difficult to read. One thing I try first whenever my web to lead forms fail is to change the method submission URL from https to http or vice versa. I don't think it applies here. But I'm throwing it out there just in case.

    James

    James Senick
    JamestownStamp.com
  • 09-24-2015 12:51 PM In reply to

    Re: Error posting WebForm server-side using ASP Classic

    Thanks James.  I fixed the typo for "redUrl" to "retURL" and no difference.

    The oid is correct.

    I've make sure that my Web-To-Lead form exists within Method and that my ASP code corresponds exactly to the same INPUT items.

    My site is SSL encrypted by default so I've inputted both "https" and "http" for the web form authentication (Step 1).

    I also want to reiterate that I've tried using the default "destURL" and the one that removes the "timezonerouter" url from the variable.  Both fail with the same error.

    At this point, there appears to be nothing wrong with my implementation.  The "web2lead.asp" file is stored in the folder "/asp/web2lead.asp" off the root of my site.  Obviously it fires.

    At this point, I'm tired of hitting my head on a brick wall.  I would love to see what code you have in ColdFusion. I'm sure I can map it to an ASP context.  

    John
  • 09-24-2015 1:11 PM In reply to

    • jsenick
    • Top 150 Contributor
    • Joined on 03-29-2013
    • Jamestown, NY USA
    • Posts 35

    Re: Error posting WebForm server-side using ASP Classic

    Sorry to hear that Roper.

    Our code looks something like this sans the actual form and the resulting variable formatting code...

    <!--- Method Variables Setup --->
    <!--- <cfset variables.methodURL = "http://www.methodintegration.com/method/timezonerouter.aspx"> --->
    <cfset variables.methodURL = "http://www.methodintegration.com/MethodWebForms/submit.aspx">
    <cfset variables.methodOID = "xxXXXxxx">
    <cfset variables.methodRetURL = "http://www.ourSite.com/thank-you.cfm">
    <cfset variables.methodFormName = "WTL-xXXxx01">

    <!--- CFHTTP SUBMISSION --->
    <cfhttp url="#variables.methodURL#" method="post" timeout="5" throwOnError="no" redirect="no" compression="none" charset="utf-8"><!--- result="methodResponse" redirect="yes" --->
        <cfhttpparam type="header" name="Referer" value="http://www.ourSite.com/formPage.cfm">
        <cfhttpparam type="FormField" name="oid" value="#variables.methodOID#">
        <cfhttpparam type="FormField" name="retURL" value="#variables.methodRetURL#">
        <cfhttpparam type="FormField" name="formName" value="#variables.methodFormName#">
        <cfhttpparam type="FormField" name="Name_Step2" value="#builtCustomerID#">
        <cfif prefixClean NEQ "NA">
        <cfhttpparam type="FormField" name="Salutation_Step2" value="#prefixClean#">
        </cfif>
        <cfhttpparam type="FormField" name="FirstName_Step2" value="#firstNameClean#">
        <cfhttpparam type="FormField" name="LastName_Step2" value="#lastNameClean#">
        <cfhttpparam type="FormField" name="ShipAddressAddr1_Step2" value="#writtenName#">
        <cfhttpparam type="FormField" name="ShipAddressAddr2_Step2" value="#addressClean#">
        <cfhttpparam type="FormField" name="BillAddressAddr1_Step2" value="#writtenName#">
        <cfhttpparam type="FormField" name="BillAddressAddr2_Step2" value="#addressClean#">
        <cfhttpparam type="FormField" name="ShipAddressCity_Step2" value="#cityClean#">
        <cfhttpparam type="FormField" name="BillAddressCity_Step2" value="#cityClean#">
        <cfhttpparam type="FormField" name="ShipAddressState_Step2" value="#stateClean#">
        <cfhttpparam type="FormField" name="BillAddressState_Step2" value="#stateClean#">
        <cfhttpparam type="FormField" name="ShipAddressPostalCode_Step2" value="#zipCodeClean#">
        <cfhttpparam type="FormField" name="BillAddressPostalCode_Step2" value="#zipCodeClean#">
        <cfhttpparam type="FormField" name="ShipAddressCountry_Step2" value="USA">
        <cfhttpparam type="FormField" name="BillAddressCountry_Step2" value="USA">
        <cfhttpparam type="FormField" name="Email_Step2" value="#emailAddyClean#">
        <cfif phoneClean NEQ "NA">
        <cfhttpparam type="FormField" name="Phone_Step2" value="#phoneClean#">
        </cfif>
        <cfhttpparam type="FormField" name="Campaign_Step2" value="#newJCode#">
        <cfhttpparam type="FormField" name="Campaign_Step4" value="#newJCode#">
        <cfhttpparam type="FormField" name="Campaign_Step5" value="#newJCode#">
        <cfhttpparam type="FormField" name="OCampaign_Step2" value="#newJCode#">
        <!--- <cfhttpparam type="FormField" name="Notes_Step2" value="none"> --->
    </cfhttp>
    <!--- END CFHTTP SUBMISSION --->

    Hope this helps.

    James

    James Senick
    JamestownStamp.com
  • 09-24-2015 1:37 PM In reply to

    Re: Error posting WebForm server-side using ASP Classic

    Thanks James.

    I just copied the plain old HTML page to my server and then filled it in.  I get the same error.

    I put in a support ticket with my hosting provider to see if they have some crazy security measures in place that are getting in the way.  It would not surprise me because I had something similar many years ago, I think it had to do with MS SQL.

    Once I hear back from them, I'll take a renewed look at just the plain old HTML form and go from there.

    NOTE:  I will be very displeased if it's been my hosting provider causing the problem all along.

    I will report back with my findings.

    BTW:  The name is John.  I have to change my moniker.

    Cheers!

    John
  • 09-24-2015 2:02 PM In reply to

    • jsenick
    • Top 150 Contributor
    • Joined on 03-29-2013
    • Jamestown, NY USA
    • Posts 35

    Re: Error posting WebForm server-side using ASP Classic

    John,

    We've had multiple issues with Method's SSL certificate being verified by ColdFusion which is Java based.  The solution, multiple times per year, has been to re-import Method's SSL certificate into the Java trusted keystore.  After the Amazon move, this has been a bigger hassle.  I believe, yet have no proof, that this is due to Method now forcing an SSL connection for Web to Lead forms regardless of whether https is used in the actual submit URL.  Anyway, asking the host if GeoTrust WildCard or SAN SSL certificates are recognized might be a starting point if the problem is indeed on the host's side.

    Again, I'm using ColdFusion.  But here is a link for reference:

    http://www.trunkful.com/index.cfm/2015/5/29/Wildcard-and-SAN-SSL-with-CFHTTP-in-ColdFusion

    Only other thing that comes to mind is if your site is actually using a Wildcard or SAN SSL certificate and possibly not recognized by Method.  Just a thought.

    Good Luck.  The first time this happened, it took me weeks and much grief from my client before I stumbled upon solutions.

    James

    James Senick
    JamestownStamp.com
  • 09-24-2015 2:18 PM In reply to

    Re: Error posting WebForm server-side using ASP Classic

    Thanks James!!!!!!!!!!!!

    Maybe I will finally get somewhere.  Unbelievable!  Will advise...

    John
Page 1 of 1 (8 items)