Solved

Delphi Soap: how to

Posted on 2013-05-23
1
786 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 25

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now