Question Emil Odobasic · Mar 5, 2024

Hello everyone!
So, I am supposed to receive a REST-request into my production, and I need to send it, exactly as I received it, to another server.
I am struggling to find any good info on this, and have a hard time coming up with a good approach.
What would be the easiest way to do this?
- I have so far thought about possibly doing it with an EnsLib.REST.GenericService and then sending it with an EnsLib.REST.GenericOperation.
- I have also thought about manually creating a rest-service and somehow using %request and sending it directly if that would be possible.

4
0 312
Question Emil Odobasic · Jan 8, 2024

Hello everyone!
I am receiving a HTTP multipart/form-data request into my rest service.
How can I read the values for each Key in the form?
The key "Profile" is sent to my service as a String data type.
The code I have below does not seem to work, where I try to read the Key profile in the form.

I appreciate all the help I can get! :)

26
0 850
Question Emil Odobasic · Dec 20, 2023

Hello everyone!
I am wondering how I can retrieve multipart form-data from a request that is coming into my REST-service.
I am supposed to retrieve a string and a file. The file is being retrieved without issues, but the "testprofile" string is not being retrieved at all.
It just logs a an empty entry. 
The request that is sent to my REST-service has the Content-Type: multipart/form-data
Thanks beforehand for the help! :)

Down below is the code I use right now to retrieve the string and file from Form-data Rest HTTP-request to my service.

5
0 862
Question Emil Odobasic · Dec 14, 2023

Hello everyone!
I have to build a REST service that receives a POST HTTP-request, collect a file from that request in the Form data and then send it in another HTTP Post request through Form Data. However I can't really seem to send the file, and I do not know where it has gone wrong. All I am getting told is that no file is being received from my HTTP Post request. I am reaching the REST Service I am supposed to send the request to, but nothing is being sent.
I would be really thankful if someone could give some insight why nothing is being sent in my request. Thanks beforehand! :)

6
0 921
Question Emil Odobasic · Nov 29, 2023

Hello everyone!
Sorry for the vague title! But I wonder what would be the best way to easily import a large XML-file into a production, modifying it by deleting elements and nodes depending on what values are in those nodes/elements and later creating whole new XML-file from that?

I have gone through this: Using Caché XML Tools | Caché & Ensemble 2018.1.4 – 2018.1.8 (intersystems.com)

But I get the sense that there are a lot of ways of approaching this, but I do not know what is the most effective for my certain needs.

I appreciate the help! Thanks beforehand! :)
 

5
0 501
Question Emil Odobasic · Nov 27, 2023

Hello!
I am trying access each "name" tag in the xml-file down below and want to display them through the trace in the production:

<?xml version="1.0"?>
<staff>
  <doc type="consultant">
    <name first="David" last="Marston">Mr. Marston</name>
    <name first="David" last="Bertoni">Mr. Bertoni</name>
    <name first="Donald" last="Leslie">Mr. Leslie</name>
    <name first="Emily" last="Farmer">Ms. Farmer</name>
  </doc>

</staff>

2
0 481
Question Emil Odobasic · Oct 10, 2023

Hello everyone!
I have manually created a REST-service that receives incoming HTTP-GET calls together with an URL-map. As shown below:

XData UrlMap [ XMLNamespace = "https://www.intersystems.com/urlmap]
{
<Routes>
<Route Url="/testGet" Method="GET" Call="Handler" />
</Routes>
}

ClassMethod Handler(req As %Stream.Object) As %Status
{
set Class = ##class(Ens.Request).%New()

set status = ##class(Ens.Director).CreateBusinessService("TestService", .instance)
set status = instance.OnProcessInput(Class, .response)

if $ISOBJECT(response)
{
         write response.%ToJSON()
}Quit $$$OK
}

6
0 442
Question Emil Odobasic · Sep 6, 2023

Hello everyone!I need to build something that will receive a REST request. As of now I have tried my luck with using an EnsLib.HTTP.InboundAdapter. But i am not so sure how I am supposed to configure it to be able to receive the REST request together with the JSON body.I have specified the OnProcessInput in the adapter so that it receives a GlobalCharacterStream. However, I have not had any good luck finding out to actually make the request to the EnsLib.HTTP.InboundAdapter. I would be really thankful if you could let me know if it is possible for an EnsLib.HTTP.InboundAdapter to actually

8
0 447