This blog provides detail steps of creating your own SOA. The SOA service provides all the query present in Teamcenter Query Builder. The SOA has one Operation which gat all query object in Teamcenter. The Operation doesn't take any input argument, it return list of Query Objects encapsulated in custom Data Structure.
Detail Steps :
- Create a new service library in BMIDE Extensions tab by selecting Project->Code Generation->Services
- Select the newly created service library (Ex: D4SoaTest) and create new service
- Open the new service (Ex: ServiceTest)
- Define the DataTypes and Operations as per the requirement. Ex: Operation is to get all the saved queries. Define Data Types as below
Define data type TestQueryObject
- Click on Add button in the Data Types tab
- Select Structure and click Next
- Enter name as TestObjectQuery and description for it
- Select DataType elements by clicking Add button
query->Teamcenter::ImanQuery [holds the query tag]
queryname->std::string [holds the name of the query]
querydescription->std::string [holds the description of the query]
Define data type TestGetSavedQueriesResponse – Used for as return data type in operation which returns vector of query objects holding query tag, name and description
- Click on Add button in the Data Types tab
- Select Structure and click Next
- Enter name as TestGetSavedQueriesResponse and description for it
- Select DataType elements by clicking Add button
queries->Vector of TestQueryObject
services->Teamcenter::Soa::Server::ServiceData
- Create Operation using the above defined data type. Select Operations tab of the service (Ex Test Service). Click Add on to create new operation.
- Click on Browse button of New Service Operation dialog
- Select D4::Soa::Test::_2012_02::TestService::TestGetSavedQueriesResponse as the return data type
- Enter Service Operation Name: testGetSavedQueries
- Enter Service Operation Description: SOA Operation for getting Query List
- Enter Return Description: List of Query Object in Teamcenter
- Click on Finish
- Once the Operation is created, in Operation Tab when Service is opened.
- Save the datamodel.
- Select the library created (D4SoaTest). Select GenerateCode->Service Artifacts
- Check the Console view to know if the code generation is successful or errors in other case.
- Source and header files corresponding to each service are created. They are placed in the following path in Navigator view:
Project->src->server->LibraryName
Ex: AccentureTest->src->server->D4SoaTest (This folder contains the files which need to be implemented by the developer)
Project->output->client->LibraryName - This contains the auto generated files for the client (no changes required to these files)
Project->output->server->LibraryName - This contains the auto generated files for the server(no changes required to these files)
Project->output->types->LibraryName - This contains the auto generated files for the data types that are created. (no changes required to these files)
Inferences:
- Name of the service library: D4SoaTest
- Services in the library D4SoaTest:
- TestService
- Operations in the service by name TestService:
- testGetSavedQueries
- Open the source file and enter the required code. Shown below is the file generated in the step #8. Operation ‘testGetSavedQueries’ is high lightened for a quick notice.
- Build the project. Dlls are generated in
- Project\output\client\jars (Project\output\types \lib if its c++ bindings) – jars files to added to java client classpath
- Project\output\server\lib (libraries which would be copied to Teamcenter Server TC_ROOT\bin)
- Project\output\types\jars (Project\output\types\lib if its c++bindings) contains the types definition – jars files to added to java client classpath
Note:-
- Check console to see a successful build message
- libD4soatypes.dll under types\lib and server\lib are same.
- Ensure the dependant libraries are added to the library definition. Ex: query module is used in the D4SoaTest library and hence added to the D4SoaTest library definition.
- Deploy the data model. This will deploy the library, service and operation definitions in the template to the database as well as it copies the built server libraries to TC_ROOT\bin. Ex Project\output\server\lib to TC_ROOT\bin
Hello,
ReplyDeletefirst I have to say that your Posts are great and helped me a lot! Thank you for the information and keep up with the good work!
I tried to create a custom service for my Teamcenter 9.1 4-Tier test system. I followed your steps and created a simple service that has just one operation that returns a boolean value.
I created service call in the sample HelloTeamcenter java application. The already implemented standard Teamcenter services such as listing the home folder contents etc. work nice but my custom service always returns the same error:
ERROR com.teamcenter.soa.internal.client.RestSender - Teamcenter server is not reachable. Starting a new client session might resolve the problem.
Server-side Exception:COMM_FAILURE
(...)
ERROR com.teamcenter.soa.internal.client.RestSender - The response XML:
Teamcenter server is not reachable. Starting a new client session might resolve the problem.
Server-side Exception:COMM_FAILURE
I the DLLs exist on the server. I copied them manually after deploying the template. I also tried to create a packaging template as stated in the Business Modeler IDE Guide and installed it via TEM.bat on the server but I always get this error. If I call the method from the SessionService to list all available services, my custom service is also in the list.
Can you help me? I don't know what to do now or what I am doing wrong. Thank you very much in advance, sir!
My System:
TC 9.1.2 4-Tier server (vmware) on Windows Server 2008 64Bit
TC 9.1.2 64Bit local client
Visual Studio 2008 SP1
JDK 6
Hi,
DeleteWere able to fix the issue ? if so can you please let me know how
Very good and deatiled explanation by manoj
ReplyDeleteHi Karl-hopper,
ReplyDeleteEven i have the same issue , can you please let me know if you could fix the issue that you were having
1. soa_client version mut match the installed version.
ReplyDelete2. If SOA is using your DLL then Build your DLL in release mode
Hello,
ReplyDeleteI'm new to SOA.
I'm facing one problem in SOA while creating new custom Service, below is description:
After selecting the library created (D4SoaTest) Select GenerateCode->Service Artifacts
I'm getting one error, here is this:
**** Build of configuration Preference Configuration for project Learn_SOA ****
(Cannot run program "nmake" (in directory "E:\Siemens\Teamcenter83\bmide\workspace\8000.3.0\Learn_SOA"): CreateProcess error=2, The system cannot find the file specified)
Please let me know how to resolve this issue.
Thanks in Advance.
may i know the solution for this if solved?
DeleteHi, Can you please let me know how to call custom exit from custom/ OOTB service. i have created the custom service according to the steps u have given but i do not have much idea on wht to add in cc++ code, is it possible to have the code only in java
ReplyDeleteHello generally when u write a code in bmide it gets difficult to debug your code.
ReplyDeleteso prefer to build code in visual studio. and its bit easy than this
ReplyDeleteTechforce services is a Salesforce Consulting Services in Australia Specialising in delivering end to end Salesforce solutions ,Consulting, Implementation DevOps partners in australia We deliver applications and services more rapidly and reliably, but it’s more than a methodology – it cuts to the very core.Salesforce Data Analytics let us help you become a data driven organisation and ensure your data is working hard for your business This includes implementi
Salesforce consulting companies
Salesforce Services
Staff augmentation companies
Salesforce integration companies
Salesforce Implementation services
Salesforce DevOps partners
Salesforce DevOps
Managed project services
Great Article. Thank you for providing such a unique and valuable information to your readers. I really appreciate your work.If you require about Tax consultants in India | NRI Tax Return Filing in India click on it.
ReplyDelete