Tech Tip: How to discover the web service using web services wizard
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: April 14, 2025
Server-Side: Exposed Web Service Method
On the server side, we define a method and expose it as a web service. This method takes two integer inputs, var1 and var2, and returns their sum as an integer result.SOAP DECLARATION(var1; Is integer; SOAP input) SOAP DECLARATION(var2; Is integer; SOAP input) SOAP DECLARATION(res; Is integer; SOAP output) res:=var1+var2 |
For more information on how to create a web service method, please refer to this article.
Client-Side: discovering the Web Service with web services wizard
On the client side, click on Design => Web Services Wizard.Next, enter the URL of the WSDL file for the chosen web service. In our case, since we are working locally, the URL is:
http://127.0.0.1:8080/4dwsdl/
Then, click on the Discover button to allow 4D to parse the contents of the WSDL file. After a few moments, the central area displays the parsing results: the name of the web service(s) and the published method(s) appear as a hierarchical list.

Finally, click on Create. 4D will instantly generate the corresponding proxy method and display it in the Method editor window.
// // proxy_test_soap_1 // http://127.0.0.1:8080/4dwsdl/ // // Method source code automatically generated by the 4D SOAP wizard. // ---------------------------------------------------------------- C_LONGINT($1) C_LONGINT($2) C_LONGINT($0) WEB SERVICE SET PARAMETER("var1"; $1) WEB SERVICE SET PARAMETER("var2"; $2) WEB SERVICE CALL("http://127.0.0.1:8080/4DSOAP/"; "A_WebService#test_soap_1"; "test_soap_1"; "http://www.4d.com/namespace/default"; Web Service dynamic) If (OK=1) WEB SERVICE GET RESULT($0; "res"; *) // Memory clean-up on the final return value. End if |
Commented by Daniel A. Ivy on May 2, 2025 at 8:56 AM
Thank you 4D for continuing to support soap web services into v20! This old technology has fallen out of favor in the buzzword soup of the general tech world but the concept is still sound and 4D's implementation of it is fantastic IMO. At a minimum this obscure gem is a reliable, quick and easy way to exchange data between 4D servers. I encourage all newcomers to 4D to try it out. The licensing has become burdensome but for the right use case it is still very worth it.