The following code snippet is a REGEX that validates characters that are not in English, as well as English characters. The class method "test" takes an email address and validates it based on this additional criteria:
first thank you from heart and mind, mind and heart; for reading, thinking, reflecting, responding, and above all explaining a possible solution and/or documentation to address this doubt.
We would need a way to get inside a SOAP Web Service the SAML Assertion, and then, send it directly to the endpoint throught a SOAP Operation.
Currently we have researched and developed how to get the SAML Assertion with the following code:
We currently have the following scenario: We have a bussiness SOAP Operation, where we get a SAML String and we convert it into a %SAML.Assertion object correctly.
👩💻👨💻 We would need to send the SAML Assertion inside the SOAP Header to the Target System.
First of all thanks for reading, and thanks for answering.
We currently have opened Log Soap and we do not observe it being added to the SOAP Header, as you would observe in the following Log Soap:
The challenge of day 16 is about generating random data using a modified version of a dragon curve (you can find more info on fractal curves like Dragon here : https://en.wikipedia.org/wiki/Dragon_curve).
Advent of Code is a series of 25 small programming challenges, it's an ideal way for beginners to start learning a computer language, and for advanced people to sharpen their programming skills.
There are small and bigger puzzles, which you can solve typically in half an hour to a few hours. (Looking at the leaderboard, the top aces can do them in less than 10 minutes.)
RESTful API Call From Cache to Particle.io Electron
Tom Fitzgibbon | Multidata | 212-967-6700 x537 | tom@mul.com
Summary: Simple Blink Tutorial for Particle.io Electron Device from Cache
Electron device is a tiny ARM processor ($40-$60) that connects to Particle’s world wide leased 2G/3G network (about $3/mo) and runs off an included LiPo battery. Using Cache’s %Net.HttpRequest you can send/receive data, control hardware and read sensors.
There have been a few use cases recently within InterSystems where we've needed to connect to Caché-based web services from PHP. The first of these was actually the Developer Community itself, which uses web services as part of Single Sign-On with other InterSystems sites/applications. The following example demonstrates how to connect to a Caché-based web service (particularly, the web service in the SAMPLES namespace) from PHP, using password authentication.
It is not possible in a COS (Caché Object Script) job/process context to have multiple Named Pipes. It is a one Named Pipe per job/process limited line of communication.
Named Pipes, in Caché, like most pipes on most operating systems are Unidirectional. That means you open them for either Read or Write, but not both.
This code snippet allows for a file on the web to be saved into the file system. Specify the server and GET request, as well as the directory the file should be saved to. The class method "test" runs the code:
Class objectscript.saveFileHTTP Extends %RegisteredObject
{
classmethod test() {
Set httprequest = ##class(%Net.HttpRequest).%New()
Set httprequest.Server = "docs.intersystems.com"
Do httprequest.Get("documentation/cache/20172/pdfs/GJSON.pdf")
Do $System.OBJ.Dump(httprequest.HttpResponse)
Set stream=##class(%FileBinaryStream).%New()
Set stream.Filename="c:\test.pdf"
Write stream.CopyFrom(httprequest.HttpResponse.Data)
Write stream.%Save()
}
}
In this article, I'll show you how to run code at compile time with ObjectScript macros.
Here's a use case that recently led me to use this feature:
As part of a medical application developed for more than 20 years, we have a large number of parameters. Although we have procedures for documenting these settings, it can be helpful to have a quick view of which settings are actually used by the application code.
The ideal number of table permissions to assign for your users is zero. Permissions should be granted upon sign-in based on the application used for access. For web applications, we have a simple way of doing this by appointing application roles, matching roles, and required resources in the System Management Portal.
ODBC and JDBC connections present a different problem, however, especially when third-party applications are involved. As providers of an ERP system, our customers often wish to be able to employ various software packages to integrate with or report on their data. Many of these programs are capable of running any kind of query. Yet, letting them do that can be devastating to a customer’s data.
Tip dvacátý šestý: objekty a concurrency 2 - swizzling
Když tento seriál před několika lety začínal, byl jeho první díl věnován zajištění izolace instance objektů pro exkluzivní přístup a popisu příslušných API funkcí. Nedávno se mi ale stalo, že mě tento díl dostihl. Jeden ze zákazníků začal mít problémy v aplikaci, přestože důsledně používal exkluzivní zámky pro editování instancí svých objektů.
The following code walks a DOM using %XML.Node. It also prevents %XML.Writer to change whitespace. Run the code using the class method "test":
Class objectscript.walkDOM Extends %Persistent
{
ClassMethod dfs(node As %XML.Node)
{
s entrynode=node.NodeId
do {
//element nodes with one whitespacetyped child are the ones we want to change
if (node.NodeType=$$$xmlELEMENTNODE){
s snode=node.NodeId
if (node.MoveToFirstChild())
{
i ('node.MoveToNextSibling()){
i (node.NodeType=$$$xmlWHITESPACENODE){
s node.NodeType=$$$xmlTEXTNODE
s node.NodeId=snode
}
}
}
s node.NodeId=snode
}
if (node.HasChildNodes()){
d node.MoveToFirstChild()
d ..dfs(node)
}
} while (node.NodeType'="" && node.MoveToNextSibling())
s node.NodeId=entrynode
}
ClassMethod test()
{
set xml = "abcdefg<![CDATA[ ]]>"
s reader=##class(%XML.Reader).%New()
do reader.OpenString(xml)
set writer = ##class(%XML.Writer).%New()
//do some magic
d ..dfs(reader.Document)
w !,"with indent=1:",!
set writer.Indent = 1
do writer.OutputToString()
do writer.Document(reader.Document)
w writer.GetXMLString()
set writer.Indent = 0
w !,"with indent=0:",!
do writer.OutputToString()
do writer.Document(reader.Document)
w writer.GetXMLString()
}
}
The attached zip file contains a bunch of examples of Cache SQL Storage mappings that I have done over the years.
If you have existing globals and want to expose them via Objects or SQL you need to setup Cache SQL Storage mapping. If you do not see an example that helps with your case send me an example and I can help you out.
This code snippet sends an XML request to a server and saves the response to a file. The class method "test" runs the code:
Class objectscript.postXML
{
classmethod test() {
Set HTTPRequest = ##class(%Net.HttpRequest).%New()
Set HTTPRequest.ContentType = "text/xml"
Set HTTPRequest.NoDefaultContentCharset = 1
Set HTTPRequest.Location = "ITOMCZ"
Set HTTPRequest.Server = "wph.foactive.com"
Do HTTPRequest.RemoveHeader("User-Agent")
Do HTTPRequest.RemoveHeader("Accept-Encoding")
Do HTTPRequest.RemoveHeader("Connection")
Do HTTPRequest.SetHeader("Expect","100-continue")
Set RequestXML = ##class(%Library.File).%New("c:\test.xml")
Do RequestXML.Open("RS")
Do HTTPRequest.EntityBody.CopyFrom(RequestXML)
Do RequestXML.%Close()
Do HTTPRequest.Post(HTTPRequest.Location)
Do $System.OBJ.Dump(HTTPRequest)
Do $System.OBJ.Dump(HTTPRequest.HttpResponse)
Write HTTPRequest.HttpResponse.Data.Size
Write HTTPRequest.ContentLength
Set ResponseStream = ##class(%Stream.FileBinary).%New()
// Second part is typically the file extension, i.e.: application/pdf -> pdf
Set FileType = $Piece(HTTPRequest.HttpResponse.GetHeader("CONTENT-TYPE"),"/",2)
Set ResponseStream.Filename = "C:\test."_FileType
Write ResponseStream.CopyFrom(HTTPRequest.HttpResponse.Data)
Write ResponseStream.%Save()
Do ResponseStream.%Close()
}
}