Solved

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

Posted on 2009-07-07
18
277 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
  • 8
  • 7
  • 2
  • +1
18 Comments
 
LVL 19

Assisted Solution

by:erikTsomik
erikTsomik earned 50 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 250 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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 

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 250 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 250 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 200 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 250 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 250 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 200 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
need some regex help 15 29
Column Spacing 3 94
Connect to MS-SQL server from Linux/PHP 8 89
Is it true tt IIS7 can't support TLSv1.2 if OS is on Win2008 1 70
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

828 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