Hi Richard, the reason you are shown the form instead of the expected results is because the verification.jsp template expects you to have a valid session when you hit it to view the results. <cfhttp> does not support native state, so a project like Ben Nadel CFHttpSession.cfc can help. CFHttpSession will manage cookies (and therefore the session) between <cfhttp> calls by interpreting the results of the Set-Cookie header and adding them back on subsequent calls.
Another thing I noticed while looking at the server response headers was that the session cookie (jsessionId) is set to "secure". This means that cookies can only be used by secure connections. I donβt have SSL settings in my test environment, so my attempts to use the Ben object failed, but I think that it has a good chance if you can test it via SSL connection.
Here is a simple test that I used with the Ben project:
<cfset objHttpSession = CreateObject("component","CFHTTPSession").Init() /> <cfset objResponse = objHttpSession.NewRequest( "https://testefile.boe.ca.gov/boewebservices/servlet/BOEVerification" ) .AddFormField( "type", "SALES" ) .AddFormField( "account", 10003 ) .AddFormField( "Submit", "Submit+Request" ) .Post()/> <cfset objResponse = objHttpSession .NewRequest( "https://testefile.boe.ca.gov/boewebservices/verification.jsp" ) .get() /> <cfoutput>#objResponse.filecontent#</cfoutput>
** You may also need to make another http call before the others establish a session before your message.
source share