Date   

Re: Problem with HTTPPost in XPA3.3

sherman levine
 

Can you send separate parameters in HTTPPost instead of a composite, paralleling this curl template (%%1, %%2 etc are stored variables which are replaced at runtime in creating the CURL.BAT)

  curl -s -o "%%5" -X POST -F "client_id=%%1" -F "client_secret=%%2" -F "grant_type=client_credentials" -F "resource=%%3"  "https://login.microsoftonline.com/%%4/oauth2/token"

Sherm

On 5/11/2021 9:57 PM, Graham White wrote:

Hi Todd,

Thanks for that.  I put the code through the link you sent and it came back with this

grant_type%3Dclient_credentials%26client_id%3D{OURCLIENTID}%26client_secret%3D{OURCLIENTSECRET}%26scope%3Dhttps%3A%2F%2Fgraph.microsoft.com%2F.default

I tried this in both curl and my program and get the same error as I had before and I also get this error in curl using this above instead of what i had before.

Any ideas?

Graham



Re: Problem with HTTPPost in XPA3.3

Graham White
 

Hi Todd,

Thanks for that.  I put the code through the link you sent and it came back with this

grant_type%3Dclient_credentials%26client_id%3D{OURCLIENTID}%26client_secret%3D{OURCLIENTSECRET}%26scope%3Dhttps%3A%2F%2Fgraph.microsoft.com%2F.default

I tried this in both curl and my program and get the same error as I had before and I also get this error in curl using this above instead of what i had before.

Any ideas?

Graham


Re: Problem with HTTPPost in XPA3.3

Todd Baremore
 

Graham,

This string is only partially url encoded:
grant_type=client_credentials&client_id={OURCLIENTID}&client_secret={OURCLIENTSECRET}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default'

Try this site for url encoding:
https://www.urlencoder.org/

Todd
On 5/11/2021 7:31 PM, Graham White wrote:

Hi,

I am trying to obtain a token for MS Graph using HTTPPost but running into trouble.  This curl command works fine and I am returned a valid token

curl -k -X POST -d "grant_type=client_credentials&client_id={OUR_CLIENT_ID}&client_secret={OURCLIENTSECRET}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default" "https://login.microsoftonline.com/{OURCLIENTTOKEN}/oauth2/token"

In XPA I create a blob (Call it XX) and initialise it with 'grant_type=client_credentials&client_id={OURCLIENTID}&client_secret={OURCLIENTSECRET}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default'

I then do the following 


Whenever I do this I get an error below.  Can anyone throw some light on where I am going wrong?

"error": "invalid_request",
   "error_description": "AADSTS900144: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: 788e0f00-751e-402e-a5fc-6f1645bfbf00\r\nCorrelation ID: 3ac34f6d-6edf-40ef-b53d-5666f886e93c\r\nTimestamp: 2021-05-11 23:03:59Z",
   "error_codes": [
      900144
   ],
   "timestamp": "2021-05-11 23:03:59Z",
   "trace_id": "788e0f00-751e-402e-a5fc-6f1645bfbf00",
   "correlation_id": "3ac34f6d-6edf-40ef-b53d-5666f886e93c",
   "error_uri": "https://login.microsoftonline.com/error?code=900144"

Regards

Graham White




Problem with HTTPPost in XPA3.3

Graham White
 

Hi,

I am trying to obtain a token for MS Graph using HTTPPost but running into trouble.  This curl command works fine and I am returned a valid token

curl -k -X POST -d "grant_type=client_credentials&client_id={OUR_CLIENT_ID}&client_secret={OURCLIENTSECRET}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default" "https://login.microsoftonline.com/{OURCLIENTTOKEN}/oauth2/token"

In XPA I create a blob (Call it XX) and initialise it with 'grant_type=client_credentials&client_id={OURCLIENTID}&client_secret={OURCLIENTSECRET}&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default'

I then do the following 

HTTPPost('https://login.microsoftonline.com/4ff5564d-e84c-4023-9a9f-489e06d4ab18/oauth2/token',XX,'Content-Type: application/x-www-form-urlencoded','')

Whenever I do this I get an error below.  Can anyone throw some light on where I am going wrong?

"error": "invalid_request",
   "error_description": "AADSTS900144: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: 788e0f00-751e-402e-a5fc-6f1645bfbf00\r\nCorrelation ID: 3ac34f6d-6edf-40ef-b53d-5666f886e93c\r\nTimestamp: 2021-05-11 23:03:59Z",
   "error_codes": [
      900144
   ],
   "timestamp": "2021-05-11 23:03:59Z",
   "trace_id": "788e0f00-751e-402e-a5fc-6f1645bfbf00",
   "correlation_id": "3ac34f6d-6edf-40ef-b53d-5666f886e93c",
   "error_uri": "https://login.microsoftonline.com/error?code=900144"

Regards

Graham White



Re: How to disable MSSQL XTP (In-Memory OLTP) #xpa

Marc Gauthier
 

Hi,

Not about XTP

Did support make you test the flag, SQL_OLDOLEDB=Y

Not sure  if xpa 4.71 has this option but in magic 3.3i - a flag was introduced to behave like in 2.5 - below the release notes:

Database Enhancements

The following enhancements are added with respect to database:

New Keyword: 'SQL_OLDOLEDB' You can maintain the previous behavior of the old OLEDB library for backward compatibility reason, by setting the keyword named SQL_OLDOLEDB to 'Y' in Database Properties of SQLServer database.


In our case it solved a performance issue that we had with a migration from 2.5 to 3.3 (Same code was slower in 3.3)

HTH

Marc


How to disable MSSQL XTP (In-Memory OLTP) #xpa

magic_texas@...
 

Hi All,

We are in the process of upgrading our XPA applications from 2.5 to 4.71, our DB is MSSQL 2016

We have found that the processing time in 4.71 is two or three times more when compared vs 2.5 - same DB, "same" code.

After reviewing with MSE support, we found that 4.7 is now aware of an MSSQL feature called XTP, this together with the fact that our programs do NOT use Transactions is causing a new SQL connection to be opened and closed for every access, every task, every link in order to check if the table(s) are memory optimized or not - we do not have any.

HQ advised that of we disable this XTP feature at the server or at the DB level, none of this functionality is executed and the application will behave like 2.5 - which was blissfully unaware of XTP -, I have googled for hours and have found nothing.

Is anybody aware of how to disable this XTP feature in MSSQL ?
Here is the link to use to retrieve if the feature is ON/OFF

 

SELECT DatabasePropertyEx('XYZ', 'IsXTPSupported') 

Thanks


Re: Looking for advice to replace an ActiveX

Marc Gauthier
 

Hi Steven,

Thanks for the answer and the Sample - I already download it 

I will look the code

Thanks again!

Marc


Re: Looking for advice to replace an ActiveX

Marc Gauthier
 

Hi Todd,

Thanks for the fast answer. Contact me privately for the demo. No rush

Thank very much.


Re: Looking for advice to replace an ActiveX

Steven Blank
 

Marc,

I built a demo application illustrating the related objects in System.Net and their usage and, a little over a year ago, uploaded it to this forum's shared files area:

https://magicu-l.groups.io/g/main/files/Demo_WinsockDotNet_3.3.zip

This was developed in v3.3 but should go forward into v4.x just fine. I suggest you download this demo app and take a look. If you get stumped anywhere along the way, feel free to contact me for assistance.

Steven G. Blank
SGBlank Consulting


On 5/10/2021 5:24 AM, Marc Gauthier wrote:
Hi,

I'm upgrading a Magic 9 application that was using Microsoft Winsock Control 6.0 ActiveX.

The code in v9 is extremely simple

We connect to the IP and a specific port using winsock.Connect and in a loop we read winsock.data 

Each time we receive the data ó we call a batch job...

It's for an processing box on a conveyor.

What is the best way to reproduce the active X in XPA 3 ?

Thank Very much

Marc Gauthier


Re: Looking for advice to replace an ActiveX

Todd Baremore
 

Marc,

Steve Blank demoed an "IP listener" solution at a Brown Bag a couple of years ago.  You can specify TCP or UDP and the port #.  I customized it for my use and it works well.  I demo it for you and send you an export of the program later this week.
Todd
On 5/10/2021 8:24 AM, Marc Gauthier wrote:

Hi,

I'm upgrading a Magic 9 application that was using Microsoft Winsock Control 6.0 ActiveX.

The code in v9 is extremely simple

We connect to the IP and a specific port using winsock.Connect and in a loop we read winsock.data 

Each time we receive the data ó we call a batch job...

It's for an processing box on a conveyor.

What is the best way to reproduce the active X in XPA 3 ?

Thank Very much

Marc Gauthier


Re: Running XPA 4 on Remote Desktop

Marc Gauthier
 

Hi Jim,

We had issues with the scanning of long barcode - If your device used datawedge to decode barcode make sure you put Interchar delay of at least 2.

Set the the device to send an Enter after the scan. In magic we just trap the enter to do next field....This allow the user to scan a barcode ou type it manually and press enter (tab is usually not directly accesible on the keyboard scanner) if it's not readable...

Let me know if you need more info 

HTH

Marc


Looking for advice to replace an ActiveX

Marc Gauthier
 

Hi,

I'm upgrading a Magic 9 application that was using Microsoft Winsock Control 6.0 ActiveX.

The code in v9 is extremely simple

We connect to the IP and a specific port using winsock.Connect and in a loop we read winsock.data 

Each time we receive the data ó we call a batch job...

It's for an processing box on a conveyor.

What is the best way to reproduce the active X in XPA 3 ?

Thank Very much

Marc Gauthier


Re: XPA 4.7.1 RIA Android License error -119 ERR LICENSES EXCEEDED

Todd Baremore
 

Disregard.  I forgot to set the Deployment Mode to Background.

Todd

On 5/7/2021 4:01 PM, Todd Baremore wrote:
I'm trying to upgrade my RIA Android app from XPA3.2e to 4.7.1

In 3.2e and 3.3h  I'm able to run the project from the toolkit and have my laptop act as a server for my Android app.
In 4.7.1 I can see the first request from the Android app in the Broker monitor, but then I get -119 ERR LICENSES EXCEEDED.

I've been through the magic.ini, mgrb.ini and mgreq.ini files and they are correct. My toolkit license is for T=MGCSTK.  The toolkit works fine. I did not install the Web Client files during the install.

Any ideas?

Todd





XPA 4.7.1 RIA Android License error -119 ERR LICENSES EXCEEDED

Todd Baremore
 

I'm trying to upgrade my RIA Android app from XPA3.2e to 4.7.1

In 3.2e and 3.3h  I'm able to run the project from the toolkit and have my laptop act as a server for my Android app.
In 4.7.1 I can see the first request from the Android app in the Broker monitor, but then I get -119 ERR LICENSES EXCEEDED.

I've been through the magic.ini, mgrb.ini and mgreq.ini files and they are correct. My toolkit license is for T=MGCSTK.  The toolkit works fine. I did not install the Web Client files during the install.

Any ideas?

Todd


Re: Office365 email

Todd Baremore
 

It turned out to be a corporate HQ firewall in your neck of the woods that was causing the problem.  We're up and running. Thanks.
Todd
On 5/6/2021 11:23 AM, Andreas Sedlmeier wrote:

On Mon, Apr 26, 2021 at 06:44 PM, Todd Baremore wrote:
I'm able to connect to an office365 relay using MailConnect(). MailSend() returns -67, which I'm unable to find any references to in either XAP or Office 365
For me this sounds as if you did not configure the relay for outgoing mail properly.


Re: Office365 email

Andreas Sedlmeier
 

On Mon, Apr 26, 2021 at 06:44 PM, Todd Baremore wrote:
I'm able to connect to an office365 relay using MailConnect(). MailSend() returns -67, which I'm unable to find any references to in either XAP or Office 365
For me this sounds as if you did not configure the relay for outgoing mail properly.


Re: Runtime doesn't take focus [XPA 4.7]

George Stewart
 

I also had an issue with this, although it was sporadic. Try adding a .NET invoke to your main program task prefix to fetch the runtime window and then you can call BringToFront() on it. Something like:

using System.Windows.Forms;
...
Form mdiChildForm = Application.OpenForms["MDIClientForm"];
Form form = mdiChildForm.MdiParent;
form.BringToFront();

Bear in mind, this will probably only work if the Open task window option for the main program task is set to Yes.



Re: Running XPA 4 on Remote Desktop

Steven Burrows
 

You might want to play with SDI/MDI etc to get the desired effect which you didn’t have in v9, but it should generally work the same.

 

Steven Burrows

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Jim Stephenson via groups.io
Sent: 05 May 2021 18:18
To: main@magicu-l.groups.io
Subject: [magicu-l] Running XPA 4 on Remote Desktop

 

I will be updating an XPA 4 app for a client to allow them to access a program in the app through remote desktop running on a Windows CE handheld scanner.

I currently have this same configuration running on an Old Magic 9.4 app and it works fine. Small screen, but we only need a few input fields and scan a barcode.

I assume it will operate basically the same way.

Has anyone done anything like this with XPA? If so, did you run into any gotchas?

Thanks,
Jim


Running XPA 4 on Remote Desktop

Jim Stephenson
 

I will be updating an XPA 4 app for a client to allow them to access a program in the app through remote desktop running on a Windows CE handheld scanner.

I currently have this same configuration running on an Old Magic 9.4 app and it works fine. Small screen, but we only need a few input fields and scan a barcode.

I assume it will operate basically the same way.

Has anyone done anything like this with XPA? If so, did you run into any gotchas?

Thanks,
Jim


Re: Runtime doesn't take focus [XPA 4.7]

Florian Groothuis
 

The Runtime window is visible, but the focus stays on the studio, so for instance you start typing some incremental search but instead your overwriting your program name...

1761 - 1780 of 195968