Webclient - IIS - memptr

Posted by bart.syryn on 09-Jan-2012 11:07

Hi,

We have configured our webclient application to pass the request through IIS to Tomcat (see previous posts).  We want the client to access our server through port 80 and not the standard port 8080 in Tomcat.  We can't set Tomcat to port 80 because we have on the same server a webspeed app that is configured with IIS.

The webclient app works fine except for memptr-variables or temp-tables with blob fields.  At that point the webclient hangs.  There are no errors in the log files.  The probleem seems to be passing memptr-variables or temp-tables with blob-fields through IIS.  Has anyone experienced the same problem ?  Does anybody know what configuration-changes need to be made in IIS7 ?  Any help would be very much appreciated !

OE10.2A

Webclient

IIS 7

Kind regards

Bart Sryyn

All Replies

Posted by Stefan Drissen on 09-Jan-2012 16:12

1. does the issue occur when talking to tomcat directly?

2. are you using https? (if yes, does issue occur when using http?)

3. are you sure there is nothing in the iis logs?

We had an issue (not webclient, but via webspeed) when passing larger result sets via SSL to the backend. This did result in error 413 request entity too large in the IIS logs, which allowed a solution to be found:

http://technet.microsoft.com/en-us/library/cc737382(WS.10).aspx

Posted by bart.syryn on 10-Jan-2012 01:13

Hi Stefan,

Thanks for answering my question !

The problem doesn't occur when talking directly to tomcat.  The problem is since we changed the configuration, instead of talking through port 8080 directly to tomcat, we now use port 80 and talk to IIS that passes the request to tomcat.  We've used the solution you suggested last week.

We're not using https.

I've just had a look, and there is nothing in the iis log that points to the problem.

Kind regards

Bart Syryn

Posted by Stefan Drissen on 10-Jan-2012 07:53

When there is little or no data in the blob does the issue also occur? I am still thinking you are hitting an IIS limit, but I do not understand why you are not seeing this in the IIS logs.

See also http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits

Posted by bart.syryn on 10-Jan-2012 14:01

Hi Stefan,

It seems that you're right.  I've been testing and sending an empty memptr-parameter from appserver throught IIS to webclient isn't a problem.  The webclient doesn't hang.  So I've been testing with small memptr-variables and always greater and greater.  It seems that my webclient hangs when I sent a memptr about 300Kb big.

So I've tried your solution (article - link you've send) but standard in IIS7.5 the limit is set to 30Mb (30000000bytes).  So trying changing settings etc. that are suggested in your link, didn't solve my problem.

There's also nothing to find in the log-files of IIS.  Maybe because it's a webclient, and not a webspeed app, so no end-user browser involved...

I hope that I can find a solution for the problem....

Kind regards

Bart Syryn.

Posted by Stefan Drissen on 11-Jan-2012 17:06

Can you provide some code showing what you're doing? I'm passing a 300 mb memptr in a test routine and it works fine...

Client side:


DEF VAR hs AS HANDLE NO-UNDO.

DEF VAR mtest AS MEMPTR NO-UNDO.

DEF VAR isize AS INT NO-UNDO EXTENT 2.

DEF VAR itime AS INT NO-UNDO EXTENT 20 INITIAL {&SEQUENCE}.

DEF VAR ii AS INT NO-UNDO.

DO ii = 0 TO 1:

   itime[{&SEQUENCE} + ii * 10 ] = ETIME.

   CREATE SERVER hs.

   hs:CONNECT( substitute( "-URL http://localhost&1/aia/Aia?Appservice=as703openedge-tfs -sessionModel session-free", IF ii = 0 THEN ":8080":U ELSE "" ) ).

   itime[{&SEQUENCE} + ii * 10 ] = ETIME.

   IF hs:CONNECTED() THEN DO:

      SET-SIZE( mtest ) = 300 * 1024 * 1024.

      itime[{&SEQUENCE} + ii * 10 ] = ETIME.

      RUN internal/appserver/test.p ON hs ( mtest, OUTPUT isize[ ii + 1 ] ).

      itime[{&SEQUENCE} + ii * 10 ] = ETIME.

   END.

   hs:DISCONNECT().

   DELETE OBJECT hs.

END.

MESSAGE

   "~ttomcat~tiis" SKIP

   "connect~t" itime[2] - itime[1] "~t" itime[12] - itime[11] SKIP

   "execute~t" itime[4] - itime[3] "~t" itime[14] - itime[13] SKIP

   "size~t" isize[1] "~t" isize[2]

VIEW-AS ALERT-BOX.

Server side:


DEFINE INPUT PARAMETER i_mt AS MEMPTR.

DEFINE OUTPUT PARAMETER o_isize AS INTEGER.

o_isize = GET-SIZE( i_mt ).

MESSAGE o_isize VIEW-AS ALERT-BOX.

Posted by bart.syryn on 12-Jan-2012 01:31

Hi Stefan,

First of all, thanks for helping me with this problem.

The problem occurs since we go through IIS to Tomcat instead of client connects directly on Tomcat port 8080.

Sending from webclient to AppServer isn't a problem, but it's memptr or temp-tables with blob that comes from appserver to the client.   Then the client hangs.

An example where it goes wrong :

Client side :

PROCEDURE Read-verslag :
/*------------------------------------------------------------------------------
  Purpose:    
  Parameters: 
  Notes:      
------------------------------------------------------------------------------*/
  DEF INPUT PARAMETER P-fullserverpath                  AS CHAR NO-UNDO.
  DEF OUTPUT PARAMETER P-fileblob                       AS MEMPTR NO-UNDO.
  DEF OUTPUT PARAMETER P-ok                             AS LOG  NO-UNDO.

  G-dummy-log = SESSION:SET-WAIT-STATE("GENERAL").
  RUN appserverConnect(INPUT 'Etest':U, NO, '', OUTPUT E-happserver) NO-ERROR.
  IF VALID-HANDLE(E-happserver) THEN
  RUN Readverslag ON SERVER E-hAppServer ({incl\pmrun.i},
                                          INPUT P-fullserverpath,
                                          OUTPUT P-fileblob,
                                          OUTPUT P-ok).
  G-dummy-log = SESSION:SET-WAIT-STATE("").
  IF ERROR-STATUS:ERROR
     THEN MESSAGE "Geen connectie server E-testing." VIEW-AS ALERT-BOX.
     ELSE RUN appserverDisconnect('Etest':U).
END PROCEDURE.

Appserver :

{incl\pmdef.i}
DEF INPUT PARAMETER P-fullserverpath                  AS CHAR NO-UNDO.
DEF OUTPUT PARAMETER P-fileblob                       AS MEMPTR NO-UNDO.
DEF OUTPUT PARAMETER P-ok                             AS LOG  NO-UNDO.

DEF VAR L-filename                                    AS CHAR NO-UNDO.

ASSIGN P-ok = FALSE.
L-filename = SEARCH(P-fullserverpath).
IF L-filename = ?
   THEN RETURN.

COPY-LOB FROM FILE L-filename TO P-fileblob.
ASSIGN P-ok = TRUE.
RETURN.

Explanation : P-fullserverpath is the path to a PDF-file on the server that needs to be transferred to the client.  It can also be a temp-table with blob-fields in it.

It works great with IIS7.5 when the file or the total of blob-fields in a temp-table are smaller than about 250K.

Kind regards,

Bart Syryn

Posted by Stefan Drissen on 12-Jan-2012 03:19

OK, when returning a 300k memptr to the client my OE Graphical Client crashes with ARR and works fine without

I couldn't find an error that meant anything to me so I opened the IIS configuration screen 'Application Request Routing' and noticed the 'Response buffer threshold (KB)' setting that was at 256k. Increase this to 512k and the 300k memptr is passed without issue.

Posted by bart.syryn on 12-Jan-2012 12:20

Hi Stefan,

Indeed, it solved my problem.  Thanks for helping me out with this problem by giving the correct answer and all the efforts !!!

Kind regards,

Bart Syryn

Posted by Tai Li on 09-Mar-2014 22:22

--- Edited on 10 March 2014, 14:52h (UTC+08:00) Singapore ---

Hi [mention:f74159d0d7ac493497e441f53f353b10:e9ed411860ed4f2ba0265705b8793d05],

Can you advice me how should I setup SSL with IIS ARR to Tomcat and AIA?  I am using IIS 7, ARR 3 and Tomcat 7.

IIS + ARR configuration:

[Server]

  • IIS > Application Request Routing Cache > Application Request Routing > Server Proxy Settings...
  • "Enable proxy" checked.

[Default Web Site]

  • IIS > SSL Settings
  • "Require SSL" checked.
  • "Client certificates" set to "Ignore".
  • IIS > URL Rewrite
  • Created a new "Inbound Rule" saved as "Tomcat7-ARR".
  • Under "Match URL", "Using" set to "Wildcards".
  • "Pattern" set to "*".
  • Under "Action", "Action type" set to "Rewrite".
  • "Action Properties" set to "http://localhost:8080/{R:0}".
  • "Stop processing of subsequent rules" checked.
  • Created a new "Inbound Rule" saved as "Tomcat7-ARR-SSL".
  • Under "Match URL", "Using" set to "Wildcards".
  • "Pattern" set to "*".
  • Under "Action", "Action type" set to "Rewrite".
  • "Action Properties" set to "https://localhost:8443/{R:0}".
  • "Stop processing of subsequent rules" checked.

Tomcat 7 Configuration:

  • HTTP Port: 8080
  • HTTPS Port: 8443

AppServer configuration:

[AIA]

  • General
  • "HTTPS enabled" checked.

The following are my findings:

  • "Tomcat7-ARR" rule enabled.
  • "Tomcat7-ARR-SSL" rule disabled.

HTTPS -> IIS (Working)
HTTPS -> IIS -> ARR -> Tomcat -> Tomcat "examples" webapp (Working)
HTTPS -> IIS -> ARR -> Tomcat -> AIA (Not working)
HTTPS:8443 -> Tomcat (Working)
HTTPS:8443 -> Tomcat -> Tomcat "examples" webapp (Working)
HTTPS:8443 -> Tomcat -> AIA (Working)

Browser error messages:

This page can’t be displayed

IIS Log:

2014-03-10 08:06:42 127.0.0.1 GET / X-ARR-CACHE-HIT=0&X-ARR-LOG-ID=4becbad1-8340-490f-ab75-640121d1b35f 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+6.1;+Trident/7.0;+rv:11.0)+like+Gecko 200 0 0 79
2014-03-10 08:06:42 127.0.0.1 GET /tomcat.css X-ARR-CACHE-HIT=0&X-ARR-LOG-ID=2b19d016-5c91-4fdd-83ad-eed2824591c8 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+6.1;+Trident/7.0;+rv:11.0)+like+Gecko 304 0 0 3
2014-03-10 08:06:42 127.0.0.1 GET /tomcat.png X-ARR-CACHE-HIT=0&X-ARR-LOG-ID=37d8ddbe-f64b-4558-b907-3653814d60aa 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+6.1;+Trident/7.0;+rv:11.0)+like+Gecko 304 0 0 2

Tomcat Log:

127.0.0.1 - - [10/Mar/2014:16:06:42 +0800] "GET / HTTP/1.1" 200 11444
127.0.0.1 - - [10/Mar/2014:16:06:42 +0800] "GET /tomcat.css HTTP/1.1" 304 -
127.0.0.1 - - [10/Mar/2014:16:06:42 +0800] "GET /tomcat.png HTTP/1.1" 304 -

  • "Tomcat7-ARR" rule disabled.
  • "Tomcat7-ARR-SSL" rule enabled.

HTTPS -> IIS (Not working)
HTTPS -> IIS -> ARR -> Tomcat -> Tomcat "examples" webapp (Not working)
HTTPS -> IIS -> ARR -> Tomcat -> AIA (Not working)
HTTPS:8443 -> Tomcat (Working)
HTTPS:8443 -> Tomcat -> Tomcat "examples" webapp (Working)
HTTPS:8443 -> Tomcat -> AIA (Working)

Browser error messages for not working:

HTTP Error 502.3 - Bad Gateway
A security error occurred

IIS Log:

2014-03-10 08:04:40 127.0.0.1 GET / X-ARR-CACHE-HIT=0&X-ARR-LOG-ID=e17dd650-f4dc-4750-b135-179c1e288f3f 443 - 127.0.0.1 Mozilla/5.0+(Windows+NT+6.1;+Trident/7.0;+rv:11.0)+like+Gecko 502 3 12175 4

Tomcat Log:

Nothing. (It seems that the packets does not even reach Tomcat.)

Please advise.

Thank you.

This thread is closed