You can send texts through SMTP if you know the SMS gateway for the service provider. Several of these should be preconfigured on your instance of Cache or IRIS under System Administration, Security, Mobile Phone. You use the phone number @ that server as the email address to send to. For instance, if the phone number was 999-999-9999 and it was on AT&T, you'd send the email to 9999999999@txt.att.net.

So that's one way to do it, but I'm sure there are better ones.

This might be easier to do with XPath rather than a loop.

First, you'll need to create a %XML.XPATH.Document object, maybe using the create from string method:

set sc = ##class(%XML.XPATH.Document).CreateFromString(xmlstring,.mydoc)

Check that the status you get back from that is not an error. If it isn't, you mydoc should be an XPath document. Then you should be able to use the EvaluateExpression method of that document to get what you want, something like:

set sc = mydoc.EvaluateExpression("/Msg/Parties/Party[AgentId=1]/OrgCode","",.value)

If that status is okay, the value you're looking for will be in value, unless there are multiple XML nodes that match that path. W3 provides the XPath syntax specification here.

I've had to do this a time or two in a development environment. Sometimes you can find it under System Operation > Processes and terminate the process. If that doesn't work, you can look at the process ID of the process and kill it at the OS level (the kill command in Linux, or taskkill in Windows). Just be aware that depending on what it's doing and how the task was written, you may end up with some weird stuff.

@Rochdi Badis in addition to what Danny mentioned here, if you see a part of a URL that starts with a colon in the url map, that part of the url is going to be passed as an argument to the method listed in Call. For example, I'm working on an API for an ERP system, and I've got an endpoint that can be called to get a customer record. The route in the url map is defined as:

<Route Url="/customer/:cust" Method="GET" Call="RequestCust" />

The RequestCust method is defined as:

ClassMethod RequestCust(cust As %String) As %Status

So if a user sends a request to /customer/123456, that gets passed to the RequestCust method with 123456 as the cust argument, and they get customer record 123456. If they send the request to /customer/999999, they get customer record 999999.