PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - cwellis67

Pages: [1]
Programming / Re: *tools\unzip not extracting files if read only
« on: December 02, 2021, 09:46:08 AM »
** If it is important, we are using PxPlus v15.10

The FIN(ch,"INPUT") tells me that it is available for INPUT, but not that it is input ONLY, which would be the case for a Read Only file, right? When I use the FIN(ch, "INPUT") on a file that is NOT read only, it returns a "1" as well. I need to know that a file is set to Read Only or not. I thought I could use the "WRITE Ok" bit returned from checking the mid(FIN(ch),27,2) bytes, but even if the file is NOT read only, the "write ok" bit is still not set, just the OPEN INPUT bit is set.

An example of what I am seeing is this:
With a file ("1.txt") set to read only:
? hta(mid(fin(1),27,2))
? fin(1,"Input")


When the same file is not read only:
? hta(mid(fin(1),27,2))
? fin(1,"Input")


Programming / *tools\unzip not extracting files if read only
« on: December 01, 2021, 04:13:47 PM »
On Windows, I've noticed that the *tools\unzip utility will generate an untrapped error if the file being extracted already exists AND it is read only on the target system. There doesn't seem to be a way around this other than checking to see if the file on the target system is read only, and if it is, change the flag and then try the extract record from the zip file to overwrite it.

There also doesn't seem to be a nice and clean way of determining through PxPlus if a file is read only or not. Currently, I am OPENing the file, then checking the FIN() to see if the OPEN INPUT bit is set. That seems to be the only indicator that the file was Read Only; otherwise, the file is OPENed normally. Is this the best, or only, way to determine programmatically if a file is Read Only or not?

Likewise, changing the flag seems to require using the system call to use the "attrib" command. Is that also correct? There's no exposed Windows objects I assume?


Web Services / Error 400 - Bad Request
« on: July 20, 2021, 04:35:46 PM »
I am getting an error 400 (Requested URL is not properly formed) returned from the Webserver when an external program is sending a POST message to it. Is there a way to see the actual and full request the Webserver is getting? I'm totally guessing that the improperly formed URL is actually part of the body of the message, but I'm not sure of that. When I use Postman to send the request, the Webserver handles it fine, but when this external program (Infor OS) is trying to send a POST it fails. It succeeds on regular GET commands, though, and I'm trying to figure out what is failing.   

Here is what is in the request.log:
POST /ims/v2/multipartMessage HTTP/1.1
host: usalvwfacts2k16
x-forwarded-proto: https
x-forwarded-port: 443
x-amzn-trace-id: Root=1-60f5e322-2762508921d698154b7ac999
content-type: text/plain
authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkluZm9yQWNjZXNzVG9rZW5TaWduaW5nQ2VydGlmaWNhdGUtMTU2NjgwNDQzOSJ9.eyJzY29wZSI6IiIsImNsaWVudF9pZCI6IkZBQ1RTREVWX0RFVn4tUVUzcW9JM09aR1NKYldrN3pYTmd3VWxsUlF5dmx4LUpfQS1CNkFqMjFRIiwiaXNzIjoiaHR0cHM6Ly9xYWMtc3NvLnFhYy5hd3NkZXYuaW5mb3IuY29tIiwiYXVkIjoiaHR0cHM6Ly9xYWMtaW9uYXBpLnFhYy5hd3NkZXYuaW5mb3IuY29tIiwianRpIjoiQm4xdjdKdG9TOHh4UjZ2M083dXlQUHB1NU5KUTZ5czd1MDJBIiwiU2VydmljZUFjY291bnQiOiJGQUNUU0RFVl9ERVYjMFdMZUN2ckVHTHd2TzV3NERobUxvLUNwb2NiSXlVN3hRZGQzZjNpQzUtTFR3SXFCMGY0MUZqb2lGTmdIcjVTenZSemJJM29hbndoeDRQN1QwMEV4LVEiLCJJZGVudGl0eTIiOiJlMmE0OTUyZi0yYWQ3LTQ5OGItYWU4NS0xZDBlMGFlNWM1MDQiLCJUZW5hbnQiOiJGQUNUU0RFVl9ERVYiLCJFbmZvcmNlU2NvcGVzRm9yQ2xpZW50IjoiMCIsImV4cCI6MTYyNjczMDY2M30.NmjpfDpU8ieWlNcVmPldb6Rdv6FGSf_DRSZCfV1OLvr_owUW1kqSWrOCfHMkmtX2EyIYfMT8vdPhhI2ynFQPzL2cJn8cpOKbuYGd9S4L-5xKNZTMSXnCYvW9nMJ-8BzvwPMlox-5HPPSwwylbr99VXSOCWTl7yMXhA1L6rjb6tqkB3ejkyWvrZIfkTn9y5H8-2PIs8OBe6-UEp_eOtXrH2M0G0qxC7nshsi1GhXkeu5EfXSVj_TBlUfpxu7g8UIdikoN4I2TGJiRNqSDTlQMQ4rFrhVnR2_sbgEmV7hu2mQnFCYjfOwsWHuP0eY1r_y_SrAKTG_PHdG5aERrJBSQcQ
accept: application/json
x-tenantid: FACTSDEV_DEV
user-agent: Apache-HttpClient/4.5.12 (Java/1.8.0_282)
accept-encoding: gzip,deflate
x-request-id: 0496213e-29e8-97d4-b439-adbaea0682d2
x-b3-traceid: 0f5eaf078eb01f24
x-b3-spanid: 0f5eaf078eb01f24
x-b3-sampled: 1
Content-Length: 0
Connection: Keep-Alive

HTTP/1.0 400 Bad Request
Server: PxPlus-WebServer/1.3.18
Date: Mon, 19 Jul 2021 20:40:02 GMT
Content-Length: 256
Content-Type: text/html
Connection: close

      <title>400 Bad Request</title>
      <h1>400 Bad Request</h1>
      <p>The Requested URL is not properly formed.<br>
Method: POST  URI:/ims/v2/multipartMessage  ARGS:</p>

Pages: [1]