0

I just started learning web services and i have been asked to implement a calculator web service with the usual 4 operations.

I saw many tutorials on youtube and most of them just take a WSDL url and “import” it to SoapUI, and just show how requests and responses are done.

But i want to figure out how the arithmetic operations are actually done, so when reading the WSDL file i tried to find where the actual method/operation of adding two values are done but there seems to be none.

I guess the methods are implemented in the server of the WSDL code (in this case dneonline), but i might be wrong. Hope someone can clarify this for me

The url wsdl file : http://www.dneonline.com/calculator.asmx?WSDL

cactus020
  • 45
  • 5
  • You can find a simple calculator implementation is [here](https://stackoverflow.com/questions/75063294/why-isnt-my-simple-calculator-postman-request-not-working/75064595#75064595) by Python `spyne` library OR by node.js `soap` library in [here](https://stackoverflow.com/questions/74890978/how-to-consume-soap-web-services-using-node-js/74894011#74894011) And consume it by Postman or SoapUI. – Bench Vue Aug 14 '23 at 17:50

1 Answers1

0

How are operations/functions implemented in wsdl?

They are not.

WSDL means Web Services Description Language. It just describes the operations/functions. The implementation needs to sit on a server somewhere, that accepts a SOAP request, gets the parameters from the payload, does the computation, places the result in a SOAP response, and returns it. The WSDL just describes the contract of those operations.

You can use the WSDL on the client side to create a stub to invoke the service, or you can use the WSDL on the server side to create a skeleton to handle the SOAP communication. But you need to add the computation yourself to that skeleton. Then deploy the service somewhere and that's your web service calculator.

See also this:

Bogdan
  • 23,890
  • 3
  • 69
  • 61