検索

質問
· 2025年2月5日

Erreur rencontrée lors de l'appel d'une API

Bonjour, j'ai un problème avec un appel et j'aurais besoin d'aide.

Lorsque j'appelle une API avec la méthode SendFormDataArray de l'adaptateur EnsLib.HTTP.OutboundAdapter, je lui passe un objet %Net.HttpRequest et je reçois l'erreur suivante :

ERROR #5002: ObjectScript error: <SUBSCRIPT>MatchSuffix+1^%Net.HttpRequest.1 ^%qPublicSuffix("")

J'ai correctement saisi l'url dans mon business operation et je la passe dans le dernier paramètre de la méthode SendFormDataArray. Avez-vous une idée, s'il vous plaît ?

Method XRPUAuthentification(pInput As ANCV.msg.BO.XRPUAuthentificationDmde, Output pOutput As ANCV.msg.BO.XRPUAuthentificationRpse) As %String
{
	
 Set pOutput = ##class(ANCV.msg.BO.XRPUAuthentificationRpse).%New()
 
 Try{
 	Set httpRequest = ##class(%Net.HttpRequest).%New()
 	Set utilisateur = ##class(ANCV.WebObjet.wsXRPUUtilisateur).%New()
	Set utilisateur.login = ..RecupererLogin()
	Set utilisateur.password = ..RecupererMdp()
	Do httpRequest.SetHeader("Content-Type", "application/json")

 	//Transformation du message d'entrée en JSON
 	Set tSC = ..ObjectToJSONStream(utilisateur, .entityBody)
 	$$$ThrowDecomposeIfError(tSC, "Impossible de transformer le message", $$$ErreurRecuperationToken)
 	
 	Set httpRequest.EntityBody = entityBody
 	//Appel à l'api security/authentication
 	set tSC = ..Adapter.SendFormDataArray(.response, "POST",httpRequest,,,..Adapter.URL_"/security/authentication")
 	$$$ThrowDecomposeIfError(tSC, "Impossible d'appeler l'api", $$$ErreurRecuperationToken)
 	//Transformation du JSON de retour en message
 	set tSC = ..JSONStreamToObject(response.Data, .pOutput, "ANCV.msg.BO.XRPUAuthentificationRpse", 1)
 	$$$ThrowDecomposeIfError(tSC, "Impossible de récupérer le token", $$$ErreurRecuperationToken)
 	set pOutput.codeRetour = "OK"
 } Catch Exception {
		Set pOutput.codeRetour = "KO"
		Set pOutput.libErreur = Exception.DisplayString()
		Set pOutput.codeErreur = Exception.Code
	 }
	 Quit $$$OK
}

Method RecupererLogin() As %String
{
	Quit ##class(Ens.Config.Credentials).GetValue(..Adapter.Credentials, "Username")
}

Method RecupererMdp() As %String
{
	Quit ##class(Ens.Config.Credentials).GetValue(..Adapter.Credentials, "Password")
}
ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
質問
· 2025年2月5日

How to delete account

Help!

I want to get rid of this account but there seems to be no way to do this by myself. Whom can I write to, to have my account deleted? Thank you in advance...

2 Comments
ディスカッション (2)3
続けるにはログインするか新規登録を行ってください
質問
· 2025年2月4日

Process multiple messages by increasing pool size while maintaining order with keys

At the moment we're creating multiple BPLs are using a router (or another BPL) to direct to these based on a unique key modulo the amount of BPLs available, e.g. if we have 3 BPLs created.

Message key = 1 mod 3 + 1 -> BPL02
Message key = 2 mod 3 + 1 -> BPL03
Message key = 3 mod 3 + 1 -> BPL01

FIFO only matters in that each messages for each key is processed in order.
What we were considering doing is increasing the pool size to 3 and programmatically creating a BPL on each thread that processes messages that would be directed to it, rather than having to create multiple BPLs into the production.

Everything I've found so far suggests just keeping the pool size as one to maintain FIFO and I can't really find much about how that may be over-ridden, or if it's even possible or advised. So not really sure if I'm completely barking up the wrong tree here.

Any tips or advice appreciated.

 

7 Comments
ディスカッション (7)1
続けるにはログインするか新規登録を行ってください
記事
· 2025年2月4日 2m read

Memoria un Acelerador de API

Estimada comunidad,

Quería comentarles que hoy publique en OpenExchange un acelerador de APIs muy simple de implementar (con algún parecido a Redis, pero más funcional) y con resultados bastante buenos, a continuación está la publicación del README, espero les sea de ayuda!

https://openexchange.intersystems.com/package/memoria

1 Comment
ディスカッション (1)2
続けるにはログインするか新規登録を行ってください
質問
· 2025年2月4日

How to find all globals in routines?

The task is to find all globals that are referenced in certain routines. I could search for ^ using  class(%Studio.Project).FindInFiles  but that would also find ^ in comments and function calls. I can distinguish between a global and a function call visually, but it would be lovely to be able to skip function calls programmatically. Is it possible?

The Find and Replace screen in Studio has a capability of searching for ^ with Match Element Type set to Global Variable. Maybe I could use that but what is the ObjectScript function behind this screen if any?

16 Comments
ディスカッション (16)3
続けるにはログインするか新規登録を行ってください