David Hockenbroch · Oct 15, 2021 go to post

I was updating code someone else wrote a few years ago, and they had set [Not ProcedureBlock] on the class. I'm not sure why.

David Hockenbroch · Oct 11, 2021 go to post

We've seen this behavior too. Whenever we use Job, we see a license used by the user at their computer's IP address, and we also see the job running as their username@127.0.0.1 because it's executing on the server.

David Hockenbroch · Oct 7, 2021 go to post

At the bottom of the pane you showed in your screenshot, there should be a few tabs. If you're on the "Project" tab and haven't added any classes to your project, it would look like that. If you switch it to the "Namespace" tab, you should see everything.

David Hockenbroch · Sep 24, 2021 go to post

MAXSTRING usually indicates that you're exceeding the maximum possible length of a string somewhere. Are you sure it's a problem with the %Stream.GlobalCharacter, and not a different string variable in your program? Global character streams shouldn't have that problem.

You can see what the maximum length of a string is on your system by opening a terminal and running:

write $SYSTEM.SYS.MaxLocalLength()

David Hockenbroch · Sep 24, 2021 go to post

One of the properties of the %SOAP.WebClient class is HttpRequest which is an instance of %Net.HttpRequest. You might need to set the content type of that HttpRequest. So where you have "..ContentType", try "..HttpRequest.ContentType"?

David Hockenbroch · Aug 19, 2021 go to post

The maximum URI size in Apache is usually 8,177 characters, but increasing that isn't the problem. Somewhere in your program, the value of your input is getting appended onto the URI, and it shouldn't be. Can you see anywhere that your program might be doing that?

David Hockenbroch · Aug 19, 2021 go to post

That's telling you the URL you're requesting is too long, not the request body. If it was the request body that was too big, that'd be a 413, not a 414. If you're getting that when your form contains a very long entry, you're probably somehow converting the request to a get, not a post, request. Can we see the code for your form as well as how it's being submitted?

David Hockenbroch · Jul 27, 2021 go to post

I've had some time to try this now. Here are steps that worked for me:

set myrequest = ##class(%Net.HttpRequest).%New()
set myrequest.Server = "<server ip or domain here>"
set myrequest.Port = "<server port here if it isn't 80>"
set myrequest.Location = "</path/to/rest>"
do myrequest.EntityBody.Write("<your json here>")
do myrequest.Post()
set mydata = myrequest.HttpResponse.Data.Read()

At that point, the data returned in the response should be in mydata.

Depending on your specific API, you made need to take additional steps for authentication, and you may need to use myrequest.Get() or myrequest.Put() instead of myrequest.Post().

If you need to set parameters, you use the SetParam method of the HttpRequest. For example, if you're using the very most basic way to authenticate to a Cache instance, you do that by specifying a CacheUserName and a CachePassword as parameters as follows any time before your post/put/get:

do myrequest.SetParam("CacheUserName","<your username here>")
do myrequest.SetParam("CachePassword","<your password here>")
David Hockenbroch · Jul 27, 2021 go to post

I'm about to go down the same path here. I have a rough idea of what I need to do. I'm going to try to use the %Net.HttpRequest object and do at least the following steps:

1. Create a new %Net.HttpRequest object

set myrequest = ##class(%Net.HttpRequest).%New()

2. Set the server

set myrequest.server = "www.whatever.com"

3. Set the locatoin

set myrequest.location = "/path/to/rest"

4. Create a global binary stream.

5. Write json data to the stream.

6. Use the stream as the EntityBody for the HttpRequest.

7. Call the get, put, or post method of the HttpRequest object to consume.

8. Use the HttpRequest's HttpResponse object to check the response

David Hockenbroch · Jul 21, 2021 go to post

If your other system is also a Cache or IRIS server, there is a mirroring options called a reporting async that exists for this specific purpose. If you've got multiple servers and need to consolidate that data for reporting purposes, a reporting async can be a part of up to 10 mirrors to help you bring that data together, too.

David Hockenbroch · Jul 20, 2021 go to post

Sam, thanks, that solves the first part! Any idea how to make it show the item number somewhere no matter what drill down level I'm at?

David Hockenbroch · Jul 19, 2021 go to post

Somewhere in your button tag, you have onselect= something. Buttons don't have an onselect, but even if they did, I'm guessing that's not the event you actually want. onselect happens when a user highlights text within a control, like in a text input.

If you're trying to set what happens when the user clicks the button, that's onclick.

If you're trying to set what happens when the user selects the button but doesn't click it (say by pressing tab until the button is highlighted) that's onfocus.

David Hockenbroch · Jul 15, 2021 go to post

It looks to me like the data returned in the HTTP response might not be proper JSON. Do you have that data for us to see?

David Hockenbroch · Jul 13, 2021 go to post

ObjectScript variables are untyped, so preserving the type isn't necessary.

You'll build the list by adding your MyPackage.MyClass objects to it, then you'll return the %ListOfObjects, then you'll use that list's methods to manipulate those objects. For instance, set mything = mylist.GetAt(1) will give you an object that is identical to the MyPackage.MyClass object you put in the list with all of its properties an methods.

David Hockenbroch · Jun 28, 2021 go to post

The %OnAfterCreatePage() method takes place after an instance of your page has been created on the server, but before it gets sent to the client, so it's really intended for server-side stuff.

Maybe instead you should be using the onloadHandler() method. That one runs on the client just before the page is displayed.

David Hockenbroch · Jun 25, 2021 go to post

A while back, I downloaded Crystal Reports for Eclipse and projected a couple of classes into Java and used them to set up an interface for us to automate emailing, printing, or archiving reports through Cache/IRIS's internal task manager.

David Hockenbroch · May 27, 2021 go to post

Just to clarify, in those bottom two queries, is that the entire query? No grouping, no sorting, no COUNT() functions?

If these are counts, it sounds like you've got some nulls in those columns. Try SELECT COUNT(*) FROM ACCT.Services WHERE TransID IS NULL and see what it says.

David Hockenbroch · May 20, 2021 go to post

FYI, I enabled the /api/atelier web app, and that fixed the issue. Once I did that, I tried it both with and without the extra commas, and it was fine letting me connect either way. They were incorrect JSON, but they weren't the source of this particular problem.

David Hockenbroch · May 20, 2021 go to post

EnsLib.File.PassthroughOperation that lets you use timestamp variables, not EnsLib.File.PassthroughService. PassthroughOperation sends files, PassthroughService receives them.

David Hockenbroch · May 20, 2021 go to post

You were right. The requested URL /api/atelier/ was not found on this server. What do I do about that, though?

David Hockenbroch · May 20, 2021 go to post

I tried it without those commas, and it made no difference. Thanks for the suggestion, though.

David Hockenbroch · May 19, 2021 go to post

Steven, I'm getting this even after doing a docker logout too. Same error, BAD_CREDENTIAL. I see there's a comment above about linking an account to an organization. Do I need to do that?