Call to webservice with soap

Posted by untipet on 01-Feb-2018 10:01

Hi,

This is my first post here so I apologize if I'm doing something wrong.

I want to call a webservice, but I'm new in progress so don't know if I'm doing the correct way. I just want to send in the call header an xml with the data that the provider is asking for, and get the xml in the answer to read the data received. Very simple thing. This is my code:

httpUrl = 'http://thewebserviceurl'.

xmlString = new String('myXml').

oRequest = RequestBuilder:Post(httpUrl, xmlString)

:ContentType("text/xml")
:AddHeader('Connection', 'Keep-Alive')
:AcceptXml()
:Request.

oResponse = ClientBuilder:Build():Client:Execute(oRequest).

IF TYPE-OF(oResponse:Entity, WidgetHandle) then do:
     hXmlDoc = CAST(oResponse:Entity, WidgetHandle):Value.
     hXmlDoc:save('file', 'Logs/test.xml').
end.
else do:
     message 'not xml'.
end.

I'm doing it right? Thanks in advance.

Joan

Posted by Peter Judge on 01-Feb-2018 12:04

Yep, that’s how it’s supposed to work.
 

All Replies

Posted by Peter Judge on 01-Feb-2018 12:04

Yep, that’s how it’s supposed to work.

This thread is closed