Solved

Delphi Soap: how to

Posted on 2013-05-23
1
855 Views
Last Modified: 2016-09-30
Hello,

I need to send xml-s and receive answers using Soap.

The Xml is quite special, so it is best for me to build the xml like this:

result.WriteString('<?xml version="1.0" encoding="UTF-8"?>' + sLineBreak);
      result.WriteString('<SOAP-ENV:Envelope' + sLineBreak);
      result.WriteString('	xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"' + sLineBreak);
...

Open in new window


How can I make some Soap component send it? (I mean the xml generated by me)

Thank you
0
Comment
Question by:starhu
1 Comment
 
LVL 26

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39192593
You don't need soap if you already have soap xml ('<SOAP-ENV:Envelope ....'). You need just transport to send this. I'm send soap messages using THTTPReqResp. It can be send using Indy too.
...
Msg: TStringStream; //to receive incoming xml
SoapClient: THTTPReqResp; //transport
...
SoapClient:= THTTPReqResp.Create(nil);
  try
          SoapClient.UseUTF8InHeader := True;
          SoapClient.Connect(False);
          SoapClient.URL := ...
          SoapClient.InvokeOptions := [soNoValueForEmptySOAPAction];
          SoapClient.Execute(sXmlMsg, Msg);

          Msg.Position := 0;   //!!!
          sResult := Msg.ReadString(Msg.Size);
...

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question