Saturday, January 5, 2013

Teamcenter SOA : Using OOTB SOA Services

In last blog I have given introduction to Teamcenter SOA service. In this blog I will provide detail of using OOTB SOA services provided by Teamcenter. Teamcenter provide set of core SOA Framework class for login , Error Logging, Object Model Change framework etc. Apart from core Framework API teamcenter also provide set of SOA service for all modules like Workflow, Change Management, Query, Structure Manager etc. The detail of all API and SOA service can be found in BMIDE in Extension view under Code Generation - > Services.
Process of using SOA Client:
Teamcenter provide SOA framework for creating SOA session and using publish SOA services. For implementing SOA client required following steps.
1)      Implementing Login Credential and session Class encapsulation connection.
2)      Using published SOA service.
3)      Optionally using other Framework services like Object Model Changes, Exception handling etc.
I suggest going through the sample program provided in SAO_client.zip.  I provided the detail of setup step for sample code in this blog.
For using SOA service first thing is to connect to Teamcenter Server with two tier (iiop connection) or four tier  (web URL). Teamcenter SOA framework encapsulates most of connection implementation through com.teamcenter.soa.client.connection class and only required credential management through implementing the CredentialManager interface.
The SOA client can implement either in .NET,C++ or Java. First step is to get the connection instance for SOA which is done by creating connection instance

url is connection string for two tier or four tier server connection. credentialManagerInstance is a instance of class which implemented CredentialManager interface.
public class AppCredentialManager implements CredentialManager

Calling SAO services:
Teamcenter provide set of OOTB SOA service for different modules like work flow etc. Each of this service has its own static service class which provide handle to those specific services. For example Query service handle can be get by
SavedQueryService queryService = SavedQueryService.getService(connectionObj);
Or workflow service instance can be obtain through
WorkflowService wfser = WorkflowService.getService(connectionObj);
connectionObj is the connection instance which we created above. Similarly there are other several services for different functionality. Detail of all services and its operation detail can be seen in BMIDE as shown in below images.


The above image show the SavedQuery and available operation for it. Once we get instance on query service we can invoke all available SOA operation on it. The detail of all operations functionality and its argument Data Type is describe in BMIDE.
Quick Example of using SOA service:
Let look small code snippet of using OTTB SOA service in Java. These below code release the object using operation from TcWorkflow SOA service.



The above code release given object by calling Teamcenter SOA service. This are basic step for doing any SOA service call.
1)      Get Instance of required SOA service by providing connection object.
2)      Prepare input argument Data for requesting for specific services.
3)      Call the specific Operation for achieving the  required results.

In above example we get first WorkFlow service instance. Then we prepare input argument by creating release options object, release input object and populating them with appropriate value.

Note the most of Argument for SOA API takes as array value and return are also in array. The reason for this is that Teamcenter SOA is design is such a way that it takes bulk request (in an array) in single operation for avoiding multiple calls to server from client.  Hence in SOA implementation we have to first create instance of object and then encapsulate them in Array.
I hope the above blog will help you to understand basic aspect of using OOTB SOA services. 

 Also See :
Teamcenter SOA Introduction
Temcenter SOA : Sample SOA Code Setup

Teamcenter SOA : Create your Own SOA
Teamcenter SOA : Detail Step for Creating SOA

20 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. No this solution is provided by Siemens. Hence I can't provide in public blog.

      Delete
  2. Hello Sir,

    Do u have any ide a how to call ITK API in SOA using BMIDE.

    Neha Agrawal

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. I am also having the same question as Neha had, I had created a dialog which has a textbox and a button using RAC customisation.When text box is filled and button is clicked, a item to be created in teamcenter with the name given in text box.I know we have to use services to get this done.I am having ITK coding to create a item.I don't no how to use that in sevices using BMIDE

      Delete
  3. Hi
    i am trying to setup SOA c++ ,can you help me how to do it.

    ReplyDelete
  4. Hi All,

    I have to call Teamcenter Report Query through JAVA menu bar ..is it possible to and if how ?

    Regards,
    Dayanand

    ReplyDelete
    Replies
    1. did you mean ,how to call TC Query from Team Center rich client menu command?

      Delete
  5. I want to trigger NX from TCE using some service. Is there any option to trigger NX from TCE?
    I tried with start_NXManager.bat. But I am not able to succeed. Please help to fix this.

    ReplyDelete
  6. Hi,

    I couldn't find soa_client.zip in the image. Can you tell me where to look for?

    Cem

    ReplyDelete
    Replies
    1. Hi,
      I face a similar issue. The link goes to 404 unless you want me to hit an alternative webservice :)
      Can you please re-publish soa_client.zip file? Alternatively you may send it across to commoninbox7@gmail.com.
      Thanks for the blog.
      Regards,
      Prads

      Delete
  7. I have found some nice examples into soa_client.zip for connecting via WebServices to a remote TC installation, login, and perform some queries like enumerate item tree. But, any example provided is a "read" task. How can as example, giving an item/rev, "change/add/write" a metadata by name and value ? Any example available ? Does exist a full blown documentation that explain how to properly use that HUGE api set via WebServices ?

    ReplyDelete
  8. "Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.
    "

    ReplyDelete
  9. I really impressed for this blog because it has good content for learners. check it once now Angularjs Online Training Hyderabad

    ReplyDelete
  10. If I release the ItemRevision then it shows the item revision is released only. But how can it would be possible if I release ItemRevision then all other objects(IMAN_specification, BOMVIEW, IMAN_Rendering, ImanFile) related to the ItemRevision will be released automatically.

    ReplyDelete