Solved

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

Posted on 2009-07-07
18
285 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 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
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…

688 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