IBM Support

Impact IPL function: GETHTTP Post method sample on Tomcat

Technical Blog Post


Abstract

Impact IPL function: GETHTTP Post method sample on Tomcat

Body

Impact IPL function: GETHTTP Post method sample on Tomcat

Start Tomcat as follow.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

There is a JSP example name Calendar can be used.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Impact IPL Policy is as following.

HTTPHost="9.125.21.202";
HTTPPort=8080;
Protocol="http";
Path="/examples/jsp/cal/cal1.jsp?name=me&email=sth";
ChannelKey="";
Method="POST";
AuthHandlerActionTreeName="";
FormParameters=null;
FilesToSend=null;
HeadersToSend=null;
HttpProperties = NewObject();   
HttpProperties.Content = "date=current&time=11am&description=this+is+a+GETHTTP+POST+sample";
HttpProperties.ContentType = "application/x-www-form-urlencoded";
x=GetHTTP(HTTPHost, HTTPPort, Protocol, Path, ChannelKey, Method, AuthHandlerActionTreeName, FormParameters, FilesToSend, HeadersToSend, HttpProperties);
Log(ResultCode);
Log(x);  

Trigger it and check with policylogger.

NCI_policylogger.log

08 Jan 2016 03:33:03,051: [GetHTTPPOST][pool-3-thread-13]
!++++++++++( GetHTTP: Pre-Execution )+++++++++++
!GetHTTP->      Module: GetHTTP
!-----------
!GetHTTP->      HTTPHost:       9.125.21.202 (String)
!GetHTTP->      HTTPPort:       8080 (Long)
!GetHTTP->      Protocol:       http (String)
!GetHTTP->      Path:   /examples/jsp/cal/cal1.jsp?name=me&email=sth (String)
!GetHTTP->      ChannelKey:      (String)
!GetHTTP->      Method: POST (String)
!GetHTTP->      AuthHandlerActionTreeName:       (String)
!GetHTTP->      FormParameters: NULL (Null)
!GetHTTP->      FilesToSend:    NULL (Null)
!GetHTTP->      HeadersToSend:  NULL (Null)
!GetHTTP->      HttpProperties: "Created by parser"=(
     Content=date=current&time=11am&description=this+is+a+GETHTTP+POST+sample (String),
     ContentType=application/x-www-form-urlencoded (String))
!GetHTTP->      DataItem:       null
!GetHTTP->      DataItems:      null
!----------( GetHTTP: Pre-Execution )-----------
08 Jan 2016 03:33:03,949: [GetHTTPPOST][pool-3-thread-13]
!++++++++++( GetHTTP: Post-Execution )+++++++++++
!GetHTTP->      Module: GetHTTP
!-----------
!GetHTTP->      HTTPHost:       9.125.21.202 (String)
!GetHTTP->      HTTPPort:       8080 (Long)
!GetHTTP->      Protocol:       http (String)
!GetHTTP->      Path:   /examples/jsp/cal/cal1.jsp?name=me&email=sth (String)
!GetHTTP->      ChannelKey:      (String)
!GetHTTP->      Method: POST (String)
!GetHTTP->      AuthHandlerActionTreeName:       (String)
!GetHTTP->      FormParameters: NULL (Null)
!GetHTTP->      FilesToSend:    NULL (Null)
!GetHTTP->      HeadersToSend:  NULL (Null)
!GetHTTP->      HttpProperties: "Created by parser"=(
     Content=date=current&time=11am&description=this+is+a+GETHTTP+POST+sample (String),
     ContentType=application/x-www-form-urlencoded (String))
!GetHTTP->      DataItem:       null
!GetHTTP->      DataItems:      null
!----------( GetHTTP: Post-Execution )-----------
08 Jan 2016 03:33:03,949: [GetHTTPPOST][pool-3-thread-13]Parser log: 200
08 Jan 2016 03:33:03,950: [GetHTTPPOST][pool-3-thread-13]Parser log: <HTML>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<HEAD><TITLE>
        Calendar: A JSP APPLICATION
</TITLE></HEAD>


<BODY BGCOLOR="white">

 

 


<!-- html table goes here -->
<CENTER>
<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
<TR>
<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A>
<TD ALIGN=CENTER> Calendar:1/8/2016</TD>
<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A>
</TR>
</TABLE>

<!-- the main table -->
<TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10>
<TR>
<TH> Time </TH>
<TH> Appointment </TH>
</TR>
<FORM METHOD=POST ACTION=cal1.jsp>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=8am>
                8am </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=9am>
                9am </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=10am>
                10am </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=11am>
                11am </A>
        </TD>
        <TD BGCOLOR=red>
        this is a GETHTTP POST sample
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=12pm>
                12pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=1pm>
                1pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=2pm>
                2pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=3pm>
                3pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=4pm>
                4pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=5pm>
                5pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=6pm>
                6pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

        <TR>
        <TD>
        <A HREF=cal2.jsp?time=7pm>
                7pm </A>
        </TD>
        <TD BGCOLOR=lightblue>
        None
        </TD>
        </TR>

</FORM>
</TABLE>
<BR>

<!-- footer -->
<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
<TR>
<TD ALIGN=CENTER>  me :
                     sth </TD>
</TR>
</TABLE>
</CENTER>

 


</BODY>
</HTML>

 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"","label":""},"Component":"","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm11080009