How to read "HTTP status code" for a consumed SOAP web service in my Server Action

Hello,


I am requested to consume a SOAP web service, i am done with that but I want to read the HTTP status code. In SOAPUI tool, Headers show "200 OK" status code. But in Outsystems, it is not showing.

So I have two issues: 

1)  I increased the logging level to "Full" for the this SOAP web service (in the Service Center, Integrations), but the Response Headers are empty. 

2) How can I read Headers in Service Studio in my Server Action? Is developing Extension is the only way to read the Http status code ?


Your support is appreciated. 


thanks and regards, 


Hi Maitha,

Prior to SOAP 1.2 you would be able to do it without an extension, see:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/EnhancedWebReferences_API

As of SOAP 1.2 and OutSystems 11 you have to create an extension:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/SOAP_Extensibility_API

Luckily someone has already done that for you and it is available in the Forge:

https://www.outsystems.com/forge/component-overview/5322/soap-extensibility-samples

In it are the following server actions provided (of them GetHTTPHeaders_FromRequest and GetSOAPHeaders_FromRequest).

Regards,

Daniel


Daniël Kuhlmann wrote:

Hi Maitha,

Prior to SOAP 1.2 you would be able to do it without an extension, see:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/EnhancedWebReferences_API

As of SOAP 1.2 and OutSystems 11 you have to create an extension:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/SOAP_Extensibility_API

Luckily someone has already done that for you and it is available in the Forge:

https://www.outsystems.com/forge/component-overview/5322/soap-extensibility-samples

In it are the following server actions provided (of them GetHTTPHeaders_FromRequest and GetSOAPHeaders_FromRequest).

Regards,

Daniel


Thanks a lot for your prompt response! 


Daniël Kuhlmann wrote:

Hi Maitha,

Prior to SOAP 1.2 you would be able to do it without an extension, see:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/EnhancedWebReferences_API

As of SOAP 1.2 and OutSystems 11 you have to create an extension:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/SOAP_Extensibility_API

Luckily someone has already done that for you and it is available in the Forge:

https://www.outsystems.com/forge/component-overview/5322/soap-extensibility-samples

In it are the following server actions provided (of them GetHTTPHeaders_FromRequest and GetSOAPHeaders_FromRequest).

Regards,

Daniel


With regards to the first question. The Http Headers are empty which is causing the error below. While in SOAPUI it shows fine. Why it is not coming in Outsystems? 

Your support is much appreciated. 

Below are screenshots:


ServiceCenter logs


I already called the RegisterInspectHeader mehtod in the OnBeforeRequestAdvanced of the SOAP web service as shown below. And then i called the GetHTTPHeaders_FromResponse in my Server Action.


Error in Outsystems Service Studio

There are no available response HTTP headers from the last invoked SOAP method. Make sure you’re calling the “RegisterInspectHeaders” action in the “OnBeforeRequestAdvanced” callback of the desired SOAP Web Service.



SOAPUI Http Headers showing

 


any suggestions ? 

Hi,

Did you consume the wsdl of the SOAP service from the actual endpoint that you use when using the SOAP service? If not are you sure the endpoint is reachable?

Also, did you check service center error and integration logs for additional info?

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi,

Did you consume the wsdl of the SOAP service from the actual endpoint that you use when using the SOAP service? If not are you sure the endpoint is reachable?

Also, did you check service center error and integration logs for additional info?

Regards,

Daniel

Hi,

Currently I am in development stage so I am hosting it through Mock service in SOAPUI which is like this http://myMachineName:8088/MyLocalMockService

Based on the SOAPUI logs in the screen shot below it is hitting the endpoint whenever I run from Outsystems.

In Service Center Integration logs showing no errors. In the "Error" tab logs it is showing the error I shared in the previous comment which is

There are no available response HTTP headers from the last invoked SOAP method. Make sure you’re calling the “RegisterInspectHeaders” action in the “OnBeforeRequestAdvanced” callback of the desired SOAP Web Service.
   at OutSystems.NssSOAPExtensibilitySamples.CssSOAPExtensibilitySamples.MssGetHTTPHeaders_FromResponse(RLHTTPHeaderRecordList& ssHTTPHeaders)
   at ssWSI.RssExtensionSOAPExtensibilitySamples.MssGetHTTPHeaders_FromResponse(HeContext heContext, RecordList& outParamHTTPHeaders)


Sorry I don't know, maybe increasing the logging level gives a bit more detail:

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/SOAP/Troubleshoot_SOAP_Web_Services


Did you expose the Soap yourself?   I think there is an issues of creating the Soap API. Please check it in postman if everything is coming properly or not. sometime status give "ok" but was not working properly. 

So please check the properly that SOAP is created properly or not.

I hope there is an issue of the SOAP Api.

Please let me know your response,

Thank you,

Sudip

Sudip Dey wrote:

Did you expose the Soap yourself?   I think there is an issues of creating the Soap API. Please check it in postman if everything is coming properly or not. sometime status give "ok" but was not working properly. 

So please check the properly that SOAP is created properly or not.

I hope there is an issue of the SOAP Api.

Please let me know your response,

Thank you,

Sudip

Thanks for your reply. I ran it in Postman and it is giving 200 OK status as shown below. 

Any idea why it is not working in Outsystems ? 

Note that the method I am using is one-way method it does not have an output parameter (void method). But even though it should have headers in the response with Http status code. 


Is there an Outsystems API similar to this one but for HTTP Response? 

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/HTTPRequestHandler_API