Skip to main content
1-Visitor
March 30, 2017
Question

Invoking SOAP web service from TW

  • March 30, 2017
  • 5 replies
  • 2631 views

Hi,

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?

Best Regards,

Aniruddha

5 replies

1-Visitor
March 30, 2017

I've invoked SOAP with just standard TW services. You must look on PostXML snippet.

avaidya11-VisitorAuthor
1-Visitor
March 30, 2017

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?

1-Visitor
March 30, 2017

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 )

avaidya11-VisitorAuthor
1-Visitor
March 31, 2017

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