In my last two blog I discussed about basic fundamental of SOA and how to use OOTB SOA in client side. In this blog we will discuss about basic for creating your own SOA. Usually new SOA service is required to be created when you don’t find OOTB SOA satisfying your requirement or what to have the service behavior in different way. Following are the guideline for creating your own SOA.
1) Check whether you can achieve the required result at client side by using OOTB SOA.
2) Analyze the desire state of transaction between Client and SOA server layer. For example you have to look whether transaction should be committed in one request or multiple request provide by OOTB SOA is acceptable.
3) Analyze what service you want to implement. Whether it will be single request base or multiple requests which satisfy the use case.
4) Analyze what input to perform the service. This will help in defining input data type.
5) Analyze what output will be provided for requested service and how the output will be used. This will also help in deciding whether you required having loose or strong binding.
Before You Start:
Before start you should understand some aspect of SOA service in teamcenter.
Loose vs. Strong Binding: The binding define how the data map between SOA server and Client. Loose binding mean Key/Value pair mapping as string map of data and its value. Whereas strong binding means the client data model is populated with typed objects that correspond one-to-one with their server-side object type. Hence decision required to be taken based on use case. For example if SOA service is for creating some static reports then loose Binding can be good option and for integration strong binding is good option.
Data Type:
Data Type defined encapsulation of Data while creating a request for SOA service as well getting output from SOA service. In SOA you can define data type either of Structure, Map or Enumeration. Meanings of this Data Types are same as in a programming language like C or Java. Structure defines set of basic data types encapsulated in structure. Similarly Map is data container.
Operations:
Operation defines set of function which will available to client for created a request for services to be performed. The SOA service can be either defined through single operation if it is a simple service or set of Operation if it is a complex use case.
Creating SOA services:
As you understand the basic building block of creating SOA, we are ready for creating your own SOA service in the BMIDE. The detail of steps of creating SOA service is given in this blog. Following are the steps of creating SOA service
1) Define preference binding. For example for Java you can select loose or strong binding.
2) Create new SOA service library or use existing if you already have one.
3) Create new service under SOA service library.
4) Define all the data type which will be used for SOA Operation.
5) Defined all the Operations with define data type. The Operation will have input data type and return data types. Data Type can be either defined data type or OOTB data types.
6) Generate code in BMIDE by selecting Generate Code -> Service Artifacts. This will create stub code for both server and client side (see step blog for detail).
7) Implement the server side code for all defined operation in BMIDE. The stubs for all Operation is already created by BMIDE and only required to implement the business logic for the Operation. Server side implementation is always in C++ and ITK API can be used for implementation.
8) No implementation is required at client side.
9) Build the BMIDE project. Jar file created for the client (if it is Java Binding) and dll for server.
10) Deploy the server dll in TC_ROOT\bin directory.
11) Implement custom SOA service in client side. The process is same as defined for OOTB service in the Blog. Only addition will be to add the client SOA jar file in the Class path for using Java client and client dll if using c++ binding.
The detail steps is given in Steps
for creating SOA.
These close my series on
Teamcenter SOA. I thanks my friend Bhaskar for introducing me to Teamcenter SOA Framework.
Hope this blogs will help good foundation for all people who want to learn Teamcenter SOA services and serve as quick start on for using and creating own services.
Hope this blogs will help good foundation for all people who want to learn Teamcenter SOA services and serve as quick start on for using and creating own services.
See Also :
Hi Monoj,
ReplyDeleteI have a question relted to SOA. I have written a Post action in the ITK and calling the SOA C++ client from the post action of the Item, could you please guide me how can i supress the SOA login credentials as I'm already logged in the TC from the ITK post action is there any way we can get the session from SOA.
Thanks,
Sudhir