Jump to content
Rolphy Reyes

ICS - XX: The XX field is required

Recommended Posts

I have Delphi Berlin (10.1) installed.

 

I have to consume an API endpoint

 

I've been using the Indy component suite and the Delphi native component suite TNetHTTPClient to send an XML file and the results are not what I expected; plus I'm very new to this.

 

Using the component suites mentioned above I get all kinds of errors except those that the API should report. However, using the PostMan application, the API returns correctly.

 

I haven't installed the ICS component suite yet, but I've run some of its examples, and the OverbyteIcsHttpRestTst.exe application example is pretty close to achieving what I need. If you look closely, you can see the error I get when attempting to send a message in the attached image. Can you help me resolve this issue?

 

TIA

 

Error ICS.png

Share this post


Link to post
18 minutes ago, Rolphy Reyes said:

Using the component suites mentioned above I get all kinds of errors

Such as? Can you be more specific?

18 minutes ago, Rolphy Reyes said:

However, using the PostMan application, the API returns correctly

What exactly are you entering into postman?

18 minutes ago, Rolphy Reyes said:

Can you help me resolve this issue?

Not without knowing what the endpoint is actually expecting, and what your actual code looks like that is not working for you.

  • Like 1

Share this post


Link to post

ICS is simply reporting a REST API error that says your XML contains an error.  So you need to correct your XML. Or maybe you are using the wrong API? 

 

Angus

 

Share this post


Link to post

I understand from the error message that you need to send the file as a "xml" field and not directly in body.

How it is working in PostMan? The XML is also in the body or you define a field named "xml" containing the file?

 

Edited by Cristian Peța
typo

Share this post


Link to post
2 hours ago, Cristian Peța said:

I understand from the error message that you need to send the file as a "xml" field and not directly in body.

How it is working in PostMan? The XML is also in the body or you define a field named "xml" containing the file?

 

Hi!

I attach an image of how sending the file works in Postman.

 

Envio Postman.png

Share this post


Link to post
8 hours ago, Remy Lebeau said:

Such as? Can you be more specific?

What exactly are you entering into postman?

Not without knowing what the endpoint is actually expecting, and what your actual code looks like that is not working for you.

Hi!

 

Sorry, I can't describe the errors because I didn't save any pictures of them.

 

Attached is an image of how it works in Postman.

Envio Postman.png

Share this post


Link to post
4 hours ago, Angus Robertson said:

ICS is simply reporting a REST API error that says your XML contains an error.  So you need to correct your XML. Or maybe you are using the wrong API? 

 

Angus

 

Hi!

 

My XML file is correct. And I'm using the correct URL. What I don't know is how to add the parameter from the OverbyteIcsHttpRestTst.exe application, just like Postman does.

Envio Postman.png

Share this post


Link to post

Hi!

 

I'm sorry if I wasted your valuable time.

 

But I found the right way to send the file. I think I was too exhausted and didn't understand the entire example.

 

Anyway, thank you very much.

 

This time, ICS saved my life.

Envio correcto ICS.png

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×