docs.intersystems.com
Caché Web Services QuickStart Tutorial
Testing Complex Object Code from Terminal
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Search:    

Here are the steps for testing SOAPService's SaveContact method using Terminal:

  1. Open Terminal in the namespace in which you are working.
  2. Use the WSDL to regenerate a client for the service and then instantiate the client. See Testing the Service from Terminal for the steps.
  3. Enter the following commands to create a new instance of Contact and assign values to its Name and ContactType properties.
    USER>Set contact = ##class(SOAPTutorial.Contact).%New()
    USER>Set contact.Name = "Doe,John"
    USER>Set contact.ContactType = "Business"
    
  4. Enter the following command to invoke the SaveContact method, passing it the newly instantiated Contact object, and write the method's return value — the ID value of the new Contact instance. Note that the client variable represents the Web service client generated in the earlier step.
    USER>Set client = ##class(SOAPService.SOAPServiceSoap).%New()
    USER>write client.SaveContact(contact)
    6
    
  5. Use the GetContact method added earlier to retrieve the contact using the ID returned by SaveContact.
    USER>set contact = client.GetContact(6)
    USER>write contact.Name
    Doe,John
    


Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA