Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1056
  • Last Modified:

Delphi Soap: how to

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
starhu
Asked:
starhu
1 Solution
 
Sinisa VukCommented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now