TWAIN ActiveX Control, Plug-in, Scanner SDK, Component, HTTP Control/SDK

Dynamsoft TWAIN Products

Support Community for TWAIN Control/Component/SDK for Scanning Solutions
* Login   * Register
* FAQ    * Search

It is currently Tue May 22, 2012 1:56 am




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Problem with POST on site secured with SSO ?
PostPosted: Fri Nov 07, 2008 3:47 am 
Offline

Joined: Fri Nov 07, 2008 3:24 am
Posts: 2
Hello,
I'm using full 5.1.1 ActiveX version of control.
My Tomcat application is secured with SSO (CAS) and after successfull login 'JSESSIONID' cookie is set.
The problem is when I try to call 'HTTPUploadThroughPost' method redirection to SSO is returned to the client (read from 'HTTPPostResponseString').
I've tried to add JSESSIONID parameter with 'SetHTTPFormField' but it doesn't work.

Is there any way to set session cookie to be send with POST upload or maybe I can get the content of scanned object in form of PDF, JPG etc. and upload it myself with 'Msxml2.ServerXMLHTTP' object where cookie can be set.

Greetings,
cholo


Top
 Profile  
 
 Post subject: Re: Problem with POST on site secured with SSO ?
PostPosted: Sun Nov 09, 2008 7:13 pm 
Offline
User avatar

Joined: Mon Mar 07, 2005 11:11 pm
Posts: 866
Quote:
The problem is when I try to call 'HTTPUploadThroughPost' method redirection to SSO is returned to the client (read from 'HTTPPostResponseString').


Would you please send the screenshot of the message returned by the HTTPPostResponseString to twainsupport@dynamsoft.com? I will check it for you.

Quote:
I've tried to add JSESSIONID parameter with 'SetHTTPFormField' but it doesn't work.


Would you please be more specific about "it doesn't work"? Do you get any error message when using the method? You can use the ErrorString property to get the error message. For information about this, please refer to:
http://www.dynamsoft.com/help/TWAIN/pro ... String.htm

Quote:
maybe I can get the content of scanned object in form of PDF, JPG etc.

The field name of the uploaded image is RemoteFile. You can get the content of scanned image form RemoteFile. For more information about this, please refer to:
http://www.dynamsoft.com/help/TWAIN/Web ... ghPost.htm

Thanks.

_________________
Robert
TWAIN Support Team
http://www.dynamsoft.com/
TWAIN ActiveX/Plug-in HTTP Control/SDK & TWAIN ActiveX Control, Scanner SDK, Component
Software Configuration Management | SCM Solution


Top
 Profile  
 
 Post subject: Re: Problem with POST on site secured with SSO ?
PostPosted: Wed Nov 12, 2008 2:53 am 
Offline

Joined: Fri Nov 07, 2008 3:24 am
Posts: 2
Robert wrote:
Would you please send the screenshot of the message returned by the HTTPPostResponseString to twainsupport@dynamsoft.com? I will check it for you.


there is no specific error message.
just plain html content of my login page with user and password fields.

Robert wrote:
Would you please be more specific about "it doesn't work"? Do you get any error message when using the method? You can use the ErrorString property to get the error message. For information about this, please refer to:


content of login page is returned as before
error string is 'HTTP process error'

Robert wrote:
The field name of the uploaded image is RemoteFile. You can get the content of scanned image form RemoteFile.


'RemoteFile' holds scanned object at the server side but I need to access scanned image as PDF at the client side (from the javascript hosted inside browser page)


Another solution (in case cookie is not supported) is to include 'jsessionid' in call url.
So when I open 'saveScan.jsp' page using fresh browser with url where session id (present at the tomcat server) is set in following form:
Code:
.../saveScan.jsp;jsessionid=C722AB591ECD786914D8E02A74488548

it works (no login page required)
but adding ';jsessionid=...' at the end of 'sActionPage' param in method call
Code:
gScannerObject.HTTPUploadAllThroughPostAsPDF(sHost, sActionPage, sFileName);

does not :(

Greetings,
cholo


Top
 Profile  
 
 Post subject: Re: Problem with POST on site secured with SSO ?
PostPosted: Wed Nov 12, 2008 7:26 pm 
Offline
User avatar

Joined: Mon Mar 07, 2005 11:11 pm
Posts: 866
Would you please send your code, along with the screenshot of the message returned by the HTTPPostResponseString property to twainsupport@dynamsoft.com? I will check it for you.

Thanks.

_________________
Robert
TWAIN Support Team
http://www.dynamsoft.com/
TWAIN ActiveX/Plug-in HTTP Control/SDK & TWAIN ActiveX Control, Scanner SDK, Component
Software Configuration Management | SCM Solution


Top
 Profile  
 
 Post subject: Re: Problem with POST on site secured with SSO ?
PostPosted: Tue May 03, 2011 1:21 am 
Offline

Joined: Tue May 03, 2011 1:15 am
Posts: 1
Is there any solution for this problem? I am facing the same problem! and this is my code:

Code:

function doUpload(){
   var objScan = frmScan.objScan;
   if(objScan != null){
      var ext = $('#fileType').val();
      var fileName = ($.trim(frmScan.FileName.value) || 'Documents') +'.'+ ext;
      
      var currentPathName = unescape(location.pathname);   // get current PathName in plain ASCII   
      var currentPath = currentPathName.substring(0, currentPathName.lastIndexOf("/") + 1);
      var url = currentPath + 'ScanAttachDocTest?DBName=${DBName}&TableName=${TableName}&Code=${UniqueKeyValue}';
      url += '&FileName=' + encodeURIComponent(fileName);
      alert(url);
      if(ext == 'pdf'){
         objScan.HTTPUploadAllThroughPostAsPDF(window.location.hostname, url, escape(fileName));
      } else {
         objScan.HTTPUploadAllThroughPostAsMultiPageTIFF(window.location.hostname, url, escape(fileName));
      }

      if (objScan.ErrorCode != 0) {//Failed to upload image
         alert(objScan.ErrorString);
         if(objScan.ErrorString == "HTTP process error")
            alert(objScan.HTTPPostResponseString);
      } else {
         if (window.parent.frames.frmThumbnails) {
            window.parent.frames.frmThumbnails.location = window.parent.frames.frmThumbnails.location
         }
      }
   }
}




Top
 Profile  
 
 Post subject: Re: Problem with POST on site secured with SSO ?
PostPosted: Wed May 04, 2011 10:18 pm 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1075
Hi basheerb,

Would you please let me know which version of Dynamic Web TWAIN you are using? To troubleshoot the problem, you can first take a look at the following article.
http://kb.dynamsoft.com/questions/559/W ... loading%3F

Besides the tips mentioned in the article, you can also use the SetHTTPFormField method to pass the info along with the HTTP Post method.

To download the SetHTTPFormField sample code, you can follow the steps in the article:
http://kb.dynamsoft.com/questions/543/H ... b+TWAIN%3F

FYI, the latest version of Dynamic Web TWAIN is 6.2. If you are using an old version, I recommend you upgrade the control to the latest version.

If the problem persists, you can contact our support team via Live Help to have an online meeting.

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

It is currently Tue May 22, 2012 1:56 am


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog