Solved

2.)Delphi Soap: how to

Posted on 2013-06-10
3
422 Views
Last Modified: 2016-02-10
Hello,

In the question http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28137065.html I got the answer how to build a Soap request so I could call with it the following soap function:
public XmlDocument setProduct (array auth, array params);
Here I generated the Xml document in sXmlMsg TStringStream and I used SoapClient.Execute(sXmlMsg, Msg);    //the  SoapClient here is THTTPReqResp object

Now I need to call public XmlDocument setProductXML (array auth, XmlDocument XML);

The problem here is that there are two parameters (and the second is a separate Xml document). How can I build and send it with one SoapClient.Execute call?

Thank you
0
Comment
Question by:starhu
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39234822
Generating xmldocument is easy. look here:
http://stackoverflow.com/questions/8354658/how-to-create-xml-file-in-delphi
https://forums.embarcadero.com/thread.jspa?threadID=81646
http://docwiki.embarcadero.com/CodeSamples/en/TXMLDocument_use_case_%28Delphi%29

var
   XMLDoc: IXMLDocument;
.
.
   XMLDoc := TXMLDocument.Create(nil);
   XMLDoc.Active := True;
// create nodes here
  ...
//pass to ...
setProductXML (auth, XMLDoc);
...
//add soap envelope to xml and send
xml_txt := XMLDoc.XML.Text;
...
//send
...

Open in new window

0
 

Author Comment

by:starhu
ID: 39344860
I will check it. Sorry for the late reply I was on holiday
0
 

Author Comment

by:starhu
ID: 39351339
Hello,

It is not clear to me how to send the xml file.

Let's say I have this

   XMLDoc := TXMLDocument.Create(nil);
   XMLDoc.Active := True;
   XMLDoc.LoadFromFile('setProductXMLRequest.xml');

Open in new window


Then how can I send the Xml to the server which waits for such a request:
public XmlDocument setProductXML (array auth, XmlDocument XML);

The setProductXML is not a Delphi procedure but a server side procedure.

Previusly (when I used *only* Xml message) I used SoapClient.Execute(sXmlMsg, Msg); where the sXmlMsg was the Xml message (as TStringStream).

But now I need to send not one but two parameteres:
- array auth (authentication array)
- and the Xml itself

The SoapClient.Execute has only one input parameter, how can I send two?

procedure Execute(const Request: TStream; Response: TStream);

Thank you!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

14 Experts available now in Live!

Get 1:1 Help Now