We need to invoke SOAP based (synchronous) Web service of external system, from Thingworx platform.
Do we need to write Java extension for it ? OR can we do it from Java script code in TW platform.
What is preferred from your experience?
Thanks for reply.
Using above suggestion,
If I write a Thing1.service1(param, param2) that invokes external SOAP web service passing param1, param2 as SOAP request params and returning response of web service as result of service1.
When say 5 concurrent users access the same Thing1.service1(), , will caller will get the expected result as per passed params or I need to create new Thing1 for each caller ? in Short is service code of Thing is threadsafe if used like singleton pattern in TW?
I don't see the singleton pattern for the same you say, if you are just calling a remote SOAP service and returning results, all the calls can be done in parallel ( same thing / service with multiple threads )
Thanks for clarification.
1. Does it mean when multiple callers call sameTW thing.service() concurrently, the code inside the thing.service() gets executed in separate thread(s)?
2. Is the abovetrue, in case Thing1 is a Java extension.?
If Yes, What happens if there are some instance variables in Java implementation those are used inside service() logic, aren't their values going to create issue for concurrent invocation of the service()?
OR TW platform at runtime will create multiple copies of same thing on stack during concurrent invocation?
As I am from J2EE background getting my doubts cleared about TW platofrm
1. Yes if it are started by different Events, Timers, Users,... But If the service writes on a Persistent property, then no concurrent calls will be done.