Solved

2.)Delphi Soap: how to

Posted on 2013-06-10
3
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error 1.1 400 Bad request idhttp delphi 18 263
Delphi Form ownership 4 153
How to renew a Delphi rad-studio licence? 5 92
Using MMsystem To change audio input 1 36
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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