63
Views
8
Comments
Solved
Outsystems Integration Studio
Question

Hi everyone,

I am doing a extension that does a post request and it is spose to print out the values inside a table in the page. when i run the xml code in postman it runs fine but when i run it in outsystems i get 

{"Message":"The requested resource does not support http method 'GET'."}

and my C# does not have any GET requests and i only runt POST request. 

UserImage.jpg
Adnan Aljebreen
Solution

Hi @Sourabh sharma,

Yes i have seen the missing "<" because i deleted some values when sending the cs file but its fine on my end without the deleted < but it  still does not work but thank you for checking.

2021-01-19 14-07-32
Tom Zhao

Hi

Could you provide more detailed information?

From your question, I'm assuming that you are creating an extension that calls an external API, is that correct? Can you share the code of Extension? When post request what library you are using?

Just FYI, OutSystems can comsume API directly. So maybe you don't need to create extension for this.

Best Regards,

UserImage.jpg
Adnan Aljebreen

yes my extension calls my odoo endpoint that i want to just try out if there is output or not, i will attach the code.

Extensionn.cs
2022-07-03 17-24-08
Sourabh sharma

Hi @Adnan Aljebreen ,

I have checked your C# , The code you shared is generally well-structured, but there are a few issues and improvements to address code,  where I have found some incomplete tage XML Syntax Error: 

The xmlRequest string has a missing closing double quote in the  tag. 

It Should be :<param><value><string>test</string></value></param> 

also,In MssAction1, you are using .Result to synchronously wait for an asynchronous method (MakeXmlRpcRequestAsync) 

My suggestions to you to make the code correct and Use it.

Kind regards. 

Also try the updated .cs file. if you share the .xif file it will be more helpful to me to understand, but you can change the code as per your requirment.

Hope it will work for you!

Regards

Sourabh Sharma

Extensionn.cs
UserImage.jpg
Adnan Aljebreen
Solution

Hi @Sourabh sharma,

Yes i have seen the missing "<" because i deleted some values when sending the cs file but its fine on my end without the deleted < but it  still does not work but thank you for checking.

2019-01-07 16-04-16
Siya
 
MVP

I suggest you to add a console application to your Visual Studio Solution and consume the MssAction1 action and debug. I could do the same and but error message I have received is different.  I have attached the error message. btw I had to comment "client.DefaultRequestHeaders.Add("Accept-Encoding", "gzip, deflate, br");" to make it work.

response.txt
UserImage.jpg
Adnan Aljebreen

Hi @Siya,

I will try to do that thank you for your suggestion.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Adnan,

Console.WriteLine is not a good way to have debugging information in an extension, as the messages will end up nowhere. Instead, use the LogMessage action, so the messages will end up in the General Log in Service Center:

GenericExtendedActions.LogMessage(AppInfo.GetAppInfo().OsContext, "your message", "some name");

If you use this, you can check whether the error message received is really caused by the PostAsync. You may add a LogMessage before and after the call, and before and after the await on the response.


UserImage.jpg
Adnan Aljebreen

Hi @Kilian Hekhuis,

Will try thank you for the tip!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.