[XML Records] Xml error

Forge Component
(44)
Published on 2019-11-25 by Afonso Carvalho
44 votes
Published on 2019-11-25 by Afonso Carvalho

when i consume SOAP web services using url an error occured. Screenshot are also attached

Hi Maha,

Though SOAP uses XML, it has nothing to do with the XML Records component.

Hi Maha,

403 Forbidden usually points to authentication or permission issues. Can you successfully invoke the service outside of the OutSystems context, through Postman or SoapUI?

Afonso Carvalho wrote:

Hi Maha,

403 Forbidden usually points to authentication or permission issues. Can you successfully invoke the service outside of the OutSystems context, through Postman or SoapUI?

While i hit api on postman it successfully give me response while in outsystems it give error.


HI Maha,

You are getting this error while calling soap web service or adding its wsdl? Because when I saw the screenshot there is no service added in your application.

Nikhil Gaur wrote:

HI Maha,

You are getting this error while calling soap web service or adding its wsdl? Because when I saw the screenshot there is no service added in your application.

I'm calling web soap web service and when i run this webservice on postman it's give me response but in outsystems its give error


Daniël Kuhlmann wrote:

Hi Maha,

Did you already read this document

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/SOAP/Consuming_SOAP_Web_Services/Configure_Web_Service_Authentication

Maybe it is applicable to your situation.

Regards,

Daniel

Thanks but when i consume web service using url it give me error and web service is not consume and it stop me on 1st step and i'm unable to continue further so i'm unable to use your document


Maha Rani wrote:

Daniël Kuhlmann wrote:

Hi Maha,

Did you already read this document

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/SOAP/Consuming_SOAP_Web_Services/Configure_Web_Service_Authentication

Maybe it is applicable to your situation.

Regards,

Daniel

Thanks but when i consume web service using url it give me error and web service is not consume and it stop me on 1st step and i'm unable to continue further so i'm unable to use your document



Hi Maha,

I think you are not able to complete first step of "consume SOAP web service", as mentioned in below screen shot. If this is the case then you need to pass valid wsdl url here.

Hi Maha,

Keep in mind that when you're using Outsystems in the cloud, the webservice is being accessed from the cloud environment. When you use postman it's being accessed from your local machine.

So is the web service accessible from external IP's?

Regards,

Lennart

Lennart Kraak wrote:

Hi Maha,

Keep in mind that when you're using Outsystems in the cloud, the webservice is being accessed from the cloud environment. When you use postman it's being accessed from your local machine.

So is the web service accessible from external IP's?

Regards,

Lennart

Web service is https://api.bestbuy.com/v1/stores?apiKey=3n4psbfccx9vgy86jmbget6k you can also check it


Solution

Hi Maha,

This is not soap api, its Rest api and its response is in xml format. For consuming this api you just need to go Logic tab -> Rest-> consume rest api.

In this click on "add single method".

Paste this URL there in method URL field and test api. Its working and able to see the response in below screen shot. After that you need to follow consume rest api tutorial for further steps to consume. Please let me know if further any confusion is there.


Thanks.


Solution

vikas sharma wrote:

Hi Maha,

This is not soap api, its Rest api and its response is in xml format. For consuming this api you just need to go Logic tab -> Rest-> consume rest api.

In this click on "add single method".

Paste this URL there in method URL field and test api. Its working and able to see the response in below screen shot. After that you need to follow consume rest api tutorial for further steps to consume. Please let me know if further any confusion is there.


Thanks.


Thanks Vikas

But when i consume webservice in response no data entitiy are created as per the documentation. Screenshot are attache for specification


vikas sharma wrote:

Hi Maha,

This is not soap api, its Rest api and its response is in xml format. For consuming this api you just need to go Logic tab -> Rest-> consume rest api.

In this click on "add single method".

Paste this URL there in method URL field and test api. Its working and able to see the response in below screen shot. After that you need to follow consume rest api tutorial for further steps to consume. Please let me know if further any confusion is there.


Thanks.


And i want response like this screenshot are attached.


Hi Maha,

Actually issue is that you are getting response in xml format. So its unable to create response object for this and return a plain text in response.

So now after getting response in plain text, in OnAfterResponse method you can use some xml parser to parse this or can customize the response as per your requirement. In below screen shot you can verify that getting response as text.



In OnAfterResponse event, you can use some xml parser to convert the text response to xml or json and then can assign required values in a variable.



Thanks.


vikas sharma wrote:

Hi Maha,

Actually issue is that you are getting response in xml format. So its unable to create response object for this and return a plain text in response.

So now after getting response in plain text, in OnAfterResponse method you can use some xml parser to parse this or can customize the response as per your requirement. In below screen shot you can verify that getting response as text.



In OnAfterResponse event, you can use some xml parser to convert the text response to xml or json and then can assign required values in a variable.



Thanks.


Thanks. How can i use xml parser can you please explain me little bit.