[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] HTTPAPI - Method not allowed.





The other programmer said that it works outside the AS/400 with SoapUI using the same URL.

I’m not sure what that tells us about the issue.
We’ve sent the question to the vendor, whether the site allows POST.


(I forgot to change the subject line before so I changed it now.)

Thanks,
Charlie

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Leo Burkett
Sent: Thursday, August 31, 2017 11:30 AM
To: 'FTPAPI/HTTPAPI mailing list'
Subject: Re: [Ftpapi] HTTPAPI - Hex characters cropping up in parms for http_url_post_stmf

 

The debug messages are saying that GET, HEAD, OPTIONS and TRACE are the only allowable methods.  Looks like POST is not allowed.

 

Leo Burkett

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Versfelt, Charles
Sent: Thursday, August 31, 2017 10:41 AM
To: FTPAPI/HTTPAPI mailing list
Subject: Re: [Ftpapi] HTTPAPI - Hex characters cropping up in parms for http_url_post_stmf

 

 

I’m an RPG programmer, I’m not an expert on HTTP although I’ve been using HTTPAPI for some time, it’s helped us with many projects.
(and thanks for that)
We have an application written by another programmer that uses http_url_post_stmf to send a inventory request and receive a reply.
It was cloned for a few different vendors, and it works for those vendors. The latest gave him this error:

<h2>405 - HTTP verb used to access this page is not allowed.</h2>

  <h3>The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.</h3>

Neither he nor I know how to resolve this, but I did a http_debug to get more information.
I believe the important information is in this part:

recvresp(): entered             

HTTP/1.1 405 Method Not Allowed 
HTTP/1.1 405 Method Not Allowed     

Allow: GET, HEAD, OPTIONS, TRACE    

Content-Type: text/html             

Server: Microsoft-IIS/8.5           

X-Powered-By: ASP.NET                

Date: Wed, 30 Aug 2017 20:55:45 GMT 

Content-Length: 1293                

I’m not sure if this means we’re not authorized to do POST, or if it’s not liking the http_url_post_stmf  method or what I need to do to resolve this.

Here’s the program code.    

// 8. Transmit file to URL                                  

      callp http_debug(*ON);                                

      ContentType = 'text/xml;charset=UTF-8';               

      SoapAction  = 'getInventoryLevels';                   

      rc = http_url_post_stmf(url: reqstfile: replyfile:    

                              HTTP_TIMEOUT:                 

                              HTTP_USERAGENT:               

                              ContentType:                  

                              SoapAction);                  

                                                             

// 9.  If error transmitting file, log error and exit.      

                                                             

      if (rc <> 1);                                         

      //error receive file                                  

The full XML reply:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x

<html xmlns="http://www.w3.org/1999/xhtml">                                    

<head>                                                                         

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>      

<title>405 - HTTP verb used to access this page is not allowed.</title>        

<style type="text/css">                                                        

<!--                                                                            

body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;b

fieldset{padding:0 15px 10px 15px;}                                            

h1{font-size:2.4em;margin:0;color:#FFF;}                                        

h2{font-size:1.7em;margin:0;color:#CC0000;}                                    

h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}                           

#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS

background-color:#555555;}                                                     

background-color:#555555;}                                                     

#content{margin:0 0 0 2%;position:relative;}                                   

.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;positio

-->                                                                            

</style>                                                                       

</head>                                                                        

<body>                                                                         

<div id="header"><h1>Server Error</h1></div>                                   

<div id="content">                                                             

 <div class="content-container"><fieldset>                                     

  <h2>405 - HTTP verb used to access this page is not allowed.</h2>            

  <h3>The page you are looking for cannot be displayed because an invalid method

</fieldset></div>                                                             

</div>                                                                         

</body>                                                                         


</body> 

</html> 

Regards,
Charlie


 

This email has been scanned for viruses by Mimecast.



This email has been scanned for viruses by Mimecast.

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi