Forum Discussion
3 Replies
- Colin_McCraeCommunity Hero
You can certainly connect and converse with RESTful API's. I'm just finishing off a bunch of script extensions to make use of the new TFS RESTful API for updating test results in TFS from TestComplete.
I use an "MSXML2.ServerXMLHTTP" object ( https://msdn.microsoft.com/en-us/library/ms766431(v=vs.85).aspx )
Which can have headers and body attached and receives a response object in return containing response code, body text etc. Mine is primarily JSON so I'm also using http://www.aspjson.com/ in a script extension as my JSON parser. (Mainly as I'm most familiar with VBScript)
Not so sure about websockets. Never tried to use them directly from TC.
- maljContributor
I was primarily thinking of the built-in support via GUI but I suppose we can create our own solution like you say. I believe I have used that object to connect to a web service somewhere else. Thanks for the tip, also on the JSON parser. I remember having a problem finding a good parser to use from VBScript.
- Colin_McCraeCommunity Hero
No problem.
The JSON parser works *almost* perfectly out of the box. I've only had to make one minor change so far. I've only used it for reading, not writing. See the linked post below for a note of what I had to change. I'm using it in a script extension.