Search code examples
delphisoapremobjects

Getting started with SOAP for Delphi in Win32


I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests.

What's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day...

To clarify this, I'm already connecting to the server happily using the RO native protocol, and have SOAP enabled, but I want to test how systems NOT based on the RO SDK can use it. Using RO SOAP for both client and server doesn't accomplish this...


Solution

  • I haven't tried it with RemObjects, but if the server already supports SOAP, I can't think of an easier way to test it than to simply consume the web service using Delphi and call each of the methods. It's surprisingly straight forward.

    • Create a new application.
    • In File|New|Other|WebServices choose WSDL Importer.
    • Enter the server's WSDL page. A wrapper unit is created for you with all of the web service methods and any additional classes/enumerations the web service uses.

    Just above the Implementation section, you will see a method to return an instance of your web service class:

    function GetMyServerSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): MyServerSoap;
    

    Instantiate it with the defaults and start calling methods.

    If you want/need to see the XML being sent and received, supply your own HTTPRIO component and use the OnBeforeExecute and OnExecute events.