views:

145

answers:

1

Is there a recommended way / a tutorial which shows how to create and process plain SOAP request with Delphi without THTTPRio, for example, if I want to implement SOAP over JMS, SOAP over AMQP or SOAP over SMTP?

Simplified code examples:

// create a SOAP request (client side)
RequestXML := Service.Add(Arg1, Arg2);

This code would generate the XML with the SOAP message for the 'Add' method invocation with the arguments Arg1 and Arg2.

// process a SOAP request (server side)
ResponseXML := Service.ProcessRequest(RequestXML);

This code would take the SOAP request XML and invoke the method. The result of the method invocation will be wrapped as a SOAP response and is ready to be sent to the client.

+2  A: 

Hello,

Take a peek at the TLinkedRIO class ( http://shenoyatwork.blogspot.com/2004/10/using-tlinkedrio.html ). It creates the SOAP request and writes it to a file. Since TLinkedRIO is used for testing purposes, it also contains code to find a (Delphi) Server that implements the Service and have the server read the request from the file, process it and write a response to another file. The caller (client) then reads from the response file. If you want to use a different transport you won't have to do that part: the response will come from a true Service. However, it's a good example to show how the XML serialization is separate from the transport.

Cheers,

Bruneau

PS: The SOAP serialization basically expects IWebNode for its transport needs. And namely the Execute method of that interface. How/where you send the request stream to and how/where you get the response stream from is up to the transport implementation.

Anonymous
+1 thank you for the link, I will test it and see how far I get with it
mjustin