Solved

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

Posted on 2009-07-07
18
268 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now