Error running SMREQ - HTTP REQUEST FAILED - HTTP/1.1 403 - HTTP STATUS 403 ::: FORBIDDEN
search cancel

Error running SMREQ - HTTP REQUEST FAILED - HTTP/1.1 403 - HTTP STATUS 403 ::: FORBIDDEN

book

Article ID: 266244

calendar_today

Updated On: 09-16-2024

Products

OPS/MVS Event Management & Automation

Issue/Introduction

Getting the following error when trying to create a ticket in Service Now using the SMREQ API:

Calling ServiceNow                                                                       
RC= 8 Stem line count= 1                                                                 
Queued messages:                                                                         
    HTTP REQUEST FAILED - HTTP/1.1 403                                                   
    RESPONSE BODY: BUF=3B7E5DE8 LEN= 796                                                 
         <!DOCTYPE HTML><HTML LANG="EN"><HEAD><TITLE>HTTP STATUS 403 ::: FORBIDDEN</TITLE
         ><STYLE TYPE="TEXT/CSS">H1 :FONT-FAMILY:TAHOMA,ARIAL,SANS-SERIF;COLOR:WHITE;BACK
         GROUND-COLOR:#525D76;FONT-SIZE:22PX;: H2 :FONT-FAMILY:TAHOMA,ARIAL,SANS-SERIF;CO
         LOR:WHITE;BACKGROUND-COLOR:#525D76;FONT-SIZE:16PX;: H3 :FONT-FAMILY:TAHOMA,ARIAL
         ,SANS-SERIF;COLOR:WHITE;BACKGROUND-COLOR:#525D76;FONT-SIZE:14PX;: BODY :FONT-FAM
         ILY:TAHOMA,ARIAL,SANS-SERIF;COLOR:BLACK;BACKGROUND-COLOR:WHITE;: B :FONT-FAMILY:
         TAHOMA,ARIAL,SANS-SERIF;COLOR:WHITE;BACKGROUND-COLOR:#525D76;: P :FONT-FAMILY:TA
         HOMA,ARIAL,SANS-SERIF;BACKGROUND:WHITE;COLOR:BLACK;FONT-SIZE:12PX;: A :COLOR:BLA
         CK;: A.NAME :COLOR:BLACK;: .LINE :HEIGHT:1PX;BACKGROUND-COLOR:#525D76;BORDER:NON
         E;:</STYLE></HEAD><BODY><H1>HTTP STATUS 403 ::: FORBIDDEN</H1></BODY></HTML>                         

Resolution

Edit the  ../tomcat/conf/web.xml file to remove the POST method from the restricted methods in this section at the bottom of the file.

 <!-- CCS Tomcat 9.0.14 - The HTTP methods below will be disabled   -->                  
   <security-constraint>                                                                 
       <web-resource-collection>                                                         
           <web-resource-name><strong>restricted methods</strong></web-resource-name>    
           <url-pattern>/*</url-pattern>                                                 
           <http-method>DELETE</http-method>                                             
           <http-method>OPTIONS</http-method>                                            
           <http-method>PUT</http-method>                                                
   <!--    <http-method>POST</http-method> -->                                           
           <http-method>TRACE</http-method>                                              
       </web-resource-collection>                                                        
       <auth-constraint />                                                               
   </security-constraint>                                                                

  <!-- CCS Tomcat 9.0.27 - Enables the other HTTP methods not listed -->                  
    <security-constraint>                                                                 
        <web-resource-collection>                                                         
            <web-resource-name><strong>unrestricted methods</strong></web-resource-name>  
            <url-pattern>/*</url-pattern>                                                 
            <http-method-omission>DELETE</http-method-omission>                           
            <http-method-omission>OPTIONS</http-method-omission>                          
            <http-method-omission>PUT</http-method-omission>                              
            <http-method-omission>POST</http-method-omission>                             
            <http-method-omission>TRACE</http-method-omission>                            
        </web-resource-collection>                                                        
    </security-constraint>                                                                
                                                                                          
</web-app>                                                                                

Recycle the Tomcat server and retry the REXX that creates the SNOW incident.