Solved

2.)Delphi Soap: how to

Posted on 2013-06-10
3
429 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 26

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Activex loadlibrary and show parented form issue 6 286
delphi custom sort exception 6 136
Sending Gmail through Delphi 3 91
Delphi XE10, MySQL Query 4 127
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

895 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

19 Experts available now in Live!

Get 1:1 Help Now