Encontrar

Question
· Dec 11, 2019

Issue with parsing a form variable of a HTTP POST request

Hi everyone, 

I am currently sending an HTTP POST request to an  EnsLib.HTTP.Service service (which has an EnsLib.HTTP.InboundAdapter associated). 

Here the request URL: http://10.41.11.210:57772/csp/healthshare/dce/POSTServiceClass.cls?rpyTo...

From the documentation I have read (https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=EHTTP_inbound) I get that the form variables are written into the request body in case of a POST. I have also implemented the OnInint() is this way to enable the form variables parsing: 

 Method OnInit() As %Status
{
    Set ..Adapter.ParseBodyFormVars=1
    Quit 1
}

The OnProcessImput of the service is implemented in this way: 

Class POSTServiceClass Extends (EnsLib.HTTP.Service, HS.Util.Trace.Helper)
{
Parameter CONTENTTYPE = "text/xml";
Property TargetProcess As %String(MAXLEN = 250) [ Required ]; .
Property isServerFault As %Boolean;
Method OnInit() As %Status
{
    Set ..Adapter.ParseBodyFormVars=1
    Quit 1
}
Method OnProcessInput(pInput As %GlobalCharacterStream, Output pOutput As %GlobalCharacterStream, ByRef pHint As %String) As %Status
{
set ..isServerFault = $$$YES  // Server Fault by default #dim token As %String
if '$isObject(pInput) || (pInput.Size = 0) 
{
set ..isServerFault = $$$NO  
quit $$$ERROR($$$GeneralError, "Null request")
}
#dim inMsg As HS.Message.XMLMessage = ##class(HS.Message.XMLMessage).%New()
set inMsg.ContentStream=pInput
#dim outMsg As HS.Message.XMLMessage = "" 
#dim sc As %Status = ..SendRequestSync(..TargetProcess, inMsg, .outMsg) 
if $$$ISERR(sc) quit sc // check if we have a good response
if '$isObject(outMsg) || 'outMsg.%Extends("HS.Message.XMLMessage") quit $$$ERROR($$$GeneralError, "Null or incorrect response") set pOutput = outMsg.ContentStream
quit $$$OK
}

I was expecting to find my form variable (rpyToken) into the contentStream of the isMsg XMLMessage but there isn't. 

Can someone explain me what is my mistake?

Thank you in advance.

1 Comment
Discussion (1)1
Log in or sign up to continue
Announcement
· Dec 2, 2019

Get certified on InterSystems IRIS Development!

Hello, Community!

After beta testing the new exam InterSystems IRIS Core Solutions Developer Specialist at Global Summit 2019, the Certification Team of InterSystems Learning Services has performed the necessary calibration and adjustments to release it to our community. It is now ready for purchase and scheduling in InterSystems exam catalog

This is InterSystems first certification exam to feature mainly code samples as question topics. To give potential candidates a sample of the exam's content, practice questions have been published to help orient to exam question approaches and content. Take a look here.

Passing the exam allows you to claim the electronic badge that can be embedded in social media accounts to show the world that your InterSystems IRIS development skills are first rate. And if you aren't successful in your first attempt, we now offer a new service, Exam Retake Support, that can help you prepare for a retake. Read all about it in our Policies.

If you are new to InterSystems Certification, please review our new program pages that include information on taking examsexam policiesFAQ and more. Also, check out our Organizational Certification that can help your organization access valuable business opportunities and establish your organization as a solid provider of InterSystems solutions in our marketplace. 

The Certification Team at InterSystems Learning Services are pretty excited about this new exam and we are also looking forward to working with you to create new certifications that can help you advance your career. We are always open to ideas and suggestions at certification@intersystems.com.

Looking forward to celebrating your success, 

James Kantor - Certification Manager, InterSystems

13 Comments
Discussion (13)0
Log in or sign up to continue
Question
· Nov 19, 2019

Import data from a text file

Hi everyone. I'm new to cache, and i  was looking for a command who reads a .txt file and store the informations in variables. I've found on the documentation the EnsLib.SQL.SNapshot class, and, even if i'm not sure if that's what i need, when i run the code it says that the class doesn't exist, but i couldn't find the right superclass to extend.

3 Comments
Discussion (3)0
Log in or sign up to continue
Question
· Nov 18, 2019

REST service with 11G Sql

Hi, I asked last week and they gave me some little tips. But the truth is I still can't carry out this "Project".
 

I must perform a REST service, using Oracle 11 database. Eh tried anyway to achieve this.

The purpose is to make a REST service, using the database provided to me and use the procedure that is already created.

 

According to what I read, I made the connection via JDBC and I had no major problem

Then I managed to read the bd inside iris and capture its procedure, but at the time of doing this. The procedure does not work correctly.

The truth is that I am very complicated with this for about 1 month using iris and creating services, but never with an external bd and less oracle. If someone can give me help I would appreciate it too much.
 

2 Comments
Discussion (2)1
Log in or sign up to continue
Article
· Nov 18, 2019 8m read

Example: Review Monitor Metrics From InterSystems IRIS Using Default REST API

The following steps show you how to display a sample list of metrics available from the /api/monitor service.

In the last post, I gave an overview of the service that exposes IRIS metrics in Prometheus format. The post shows how to set up and run IRIS preview release 2019.4 in a container and then list the metrics.


This post assumes you have Docker installed. If not, go and do that now for your platform :)

10 Comments
Discussion (10)3
Log in or sign up to continue