Hello @weneed,
Yes, you can use something like this to send an XML Ffle to and SOAP WS and get the response:procedure Send(xmlDoc: XmlDocument; URLDest: Text; var ErrorCode: Text; var xmlDoc2: XmlDocument): Boolean var URL: Text; Client: HttpClient; Content: HttpContent; RequestMsg: HttpRequestMessage; ResponseMSg: HttpResponseMessage; RequestHeader: HttpHeaders; ContentHeader: HttpHeaders; ReqTxt: Text; ResTxt: Text; begin URL := URLDest; RequestHeader.Clear(); RequestMsg.GetHeaders(RequestHeader); RequestHeader.Add('Accept', 'application/xml'); // Add XML to content XmlDoc.WriteTo(ReqTxt); Content.WriteFrom(ReqTxt); ContentHeader.Clear(); Content.GetHeaders(ContentHeader); ContentHeader.Remove('Content-Type'); ContentHeader.Add('Content-Type', 'text/xml'); RequestMsg.Content(Content); RequestMsg.SetRequestUri(URL); RequestMsg.Method('POST'); if Client.Send(RequestMsg, ResponseMSg) then begin if ResponseMSg.IsSuccessStatusCode() then begin ResponseMSg.Content.ReadAs(ResTxt); if XmlDocument.ReadFrom(ResTxt, XMLDoc2) then begin ErrorCode := ''; exit(true); end else begin ErrorCode := ResTxt; exit(false); end; end else begin ErrorCode := ResponseMSg.ReasonPhrase(); exit(false); end; end else begin if ResponseMSg.Content.ReadAs(ResTxt) then ErrorCode := ResTxt else ErrorCode := ResponseMSg.ReasonPhrase; exit(false); end; end;
Regards
Answers
Yes, you can use something like this to send an XML Ffle to and SOAP WS and get the response:
Regards
Thanks. There is a way to authenticate giving username and password?
Yes, you can use an "Authorization" header for this:
The authorizationValue depends on what the remote web service is expecting.
Regards.
who if I want to use windows authentication?
How I can insert Username and password?
I guess that this post is related to the new one that you opened.
Regards.
I've solved windows authentication but bad request is response. so I opened another question