Skip to main content

Testing the Service from the Terminal

Using the Terminal we can generate a client for the Web Service based on its WSDL. Open the Terminal in any namespace and set a variable to the value of the url of the WSDL for the web service. Note that the port number for the url on your system may well be different than what is shown here.


USER>Set url="http://localhost:57774/csp/myaccount/MyApp.MyService.CLS?WSDL=1"

Create an instance of %SOAP.WSDL.ReaderOpens in a new tab and use its Process method to generate a client for our web service:


USER>Set reader=##class(%SOAP.WSDL.Reader).%New()
USER>Write reader.Process(url)
Compilation started on 09/04/2014 11:09:27 with qualifiers 'dk'
Compiling class MyService.MyServiceSoap
Compiling routine MyService.MyServiceSoap.1
Compiling class MyService.MyServiceSoap.Test
Compiling routine MyService.MyServiceSoap.Test.1
Compilation finished successfully in 0.334s.
1

Next, create an instance of the generated client and invoke its Test method. It should return “Test”.


USER>Set client = ##class(MyService.MyServiceSoap).%New()
USER>Write client.Test()
Test

FeedbackOpens in a new tab