?
Solved

How do you Auto submit a form as ajob on a server?

Posted on 2009-07-07
18
Medium Priority
?
291 Views
Last Modified: 2013-12-24
Ok this is tough!

I have a client that I need to post data to via http post:
All i can get is connection failures because of the https and I have exhausted the work arounds on that.
So I made the code a form with auto submit but can't get the form to fire as a server job in cfadmin jobs.

Any ideas???

See code below:
Original code: 
Connection failure Every time: 
cfhttp url="https://URL.aspx" method="post"> 
<cfhttpparam type="FORMFIELD" name="Name" value="Stephanie  Slimfield">
<cfhttpparam type="FORMFIELD" name="Address" value="101 Main st">
<cfhttpparam type="FORMFIELD" name="City" value="Florence">
<cfhttpparam type="FORMFIELD" name="State" value="AL">
<cfhttpparam type="FORMFIELD" name="Zip" value="35641">
<cfhttpparam type="FORMFIELD" name="OfficePhone" value="2561258589">
<cfhttpparam type="FORMFIELD" name="Email" value="walk@email.biz">
<cfhttpparam type="FORMFIELD" name="Company" value="compname">
</cfhttp>
<br />
 
<cfoutput>#cfhttp.FileContent#</cfoutput>
 
 
-----------------------------------------------------------
 
New Code with auto submit  (Works great when I open in my browser won't work as a scheduled job)
 
<cfform action="https://URL.aspx" method="post" name="form1" target="_self">
<input name="Name" type="hidden" value="Stephanie Slimfield" />
<input name="Address" type="hidden" value="115 sMain st" />
<input name="City" type="hidden" value="Killen" />
<input name="State" type="hidden" value="AL" />
<input name="Zip" type="hidden" value="35412" />
<input name="OfficePhone" type="hidden" value="2568568547" />
<input name="Email" type="hidden" value="1@asdfssk.com" />
 
<input name="Company" type="hidden" value="A to Z Insurance" />
<script>
document.form1.submit();
</script>
</cfform>

Open in new window

0
Comment
Question by:LeadCo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
  • 2
  • +1
18 Comments
 
LVL 19

Assisted Solution

by:erikTsomik
erikTsomik earned 200 total points
ID: 24800732
make sure that the job is scheduled
0
 

Author Comment

by:LeadCo
ID: 24800780
Yes it is scheduled.
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 1000 total points
ID: 24801036
why cant you create a schedular usign cfschedule

http://www.geocities.com/SoHo/Cafe/8032/2_ColdFusion_Tags/lr2_082.htm


0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:LeadCo
ID: 24801126
In cfadmin I can click a check box Publish Save output to file on a scheduled job, is that what you mean?
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 1000 total points
ID: 24801161
see you can create schedular with code no need of cfadmin with cfschedule tag  .

The only limitation it has is it should be in same domain.

in you case i don't think ur dng cross domain stuff

0
 

Author Comment

by:LeadCo
ID: 24801180
I am submiting to an external URL, thats cross domain isn't it?
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 1000 total points
ID: 24801208
ur submitting to external but the called page in schedular is in ur local domain it self isn't it?

Try cfschedule  and see it should work
0
 
LVL 27

Accepted Solution

by:
azadisaryev earned 800 total points
ID: 24801433
cfschedule and scheduled tasks use the same <cfhttp> call behind the scenes to request your page. and cfhttp does not execute javascript...

go back to you original <cfhttp> call, and try adding redirect="yes" and resolveurl="yes" to the tag, and maybe a valid useragent attribute as well...

Azadi
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 1000 total points
ID: 24801701
Yup azadi i completely agree with you
 
Ok see this URL which will give you steps to debugging
http://kb2.adobe.com/cps/998/9987e902.html .
I think ur using SSL right , so enable the SSL debugging options for the JVM and just look at the SSL handshake details.
I haven't tried this myself, but I'm thinking that since CFSCHEDULE uses CFHTTP under the covers, that it should be possible to do if you follow the procedure for enabling SSL for CFHTTP
 
0
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 1000 total points
ID: 24801724
Please see this URL it will help you i think so
http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=843 
0
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 24801747
0
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 24801788
@Azaadi,
redirect="yes" and resolveurl="yes" ,  those two will not solve the issue  , these two come in to act after the intial handshake is done ,I am very sure the problem is LeadCo is calling https://  from cfhhtp  because he is getting connection failure error.
So the steps i gave may help in that .
0
 

Author Comment

by:LeadCo
ID: 24820351
Can't seem to get a different result even with redirect and reolveURL.

Still Get Connection Failure even after importing there cert in my kestore.

0
 

Author Comment

by:LeadCo
ID: 24820354
They are puzzled others are posting fine.
They don't even show me hitting the page from my IP.
0
 
LVL 27

Assisted Solution

by:azadisaryev
azadisaryev earned 800 total points
ID: 24820994
try using fiddler on IE, or FireBug/httpFox/Tamper Data on FF to check the actual http headers and request/response sent to and received back from the url you are submitting to when you do cfhttp call and when you do direct form post, then compare them to see where they differ.

if you see some headers when you do straight form post which you do not see in your cfhttp call, add those to <cfhttp> and see if it works.

it's impossible to give you a detailed direct answer without testing it out, for which we'll need the url you are submitting to.

Azadi
0
 

Author Comment

by:LeadCo
ID: 24833109
Ok we did the Dump and found that when the SSL is checked my connection drops it, my server admin can't figure why. Any Suggestions???

        Issuer
          C=US
          O=VeriSign, Inc.
          OU=VeriSign Trust Network
          OU=Terms of use at https:
         
          www.verisign.com
          rpa (c)05
          CN=VeriSign Class 3 Secure Server CA
        Serial         xxxxxxxxxxxxxx
        Extensions
          Extension: X509v3 Basic Constraints
          Extension: X509v3 Key Usage
          Extension: X509v3 CRL Distribution Points
          Extension: X509v3 Certificate Policies
          Extension: X509v3 Extended Key Usage
          Extension: X509v3 Authority Key Identifier
          Extension: Authority Information Access
          Extension: 1.3.6.1.5.5.7.1.12
2 4  0.0491 (0.0000)  S>CV3.1(4)  Handshake
      ServerHelloDone
2 5  0.0991 (0.0500)  C>SV3.1(2)  Alert
    level           fatal
    value           certificate_unknown
0
 

Author Comment

by:LeadCo
ID: 24874818
Ok for future reference do all above then restart ColdFusion......  I think importing the cert and restarting coldfusion was the ticket..  Thanks for all who contributed. Points for all.
0
 

Author Closing Comment

by:LeadCo
ID: 31600960
Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question