PLM之家PLMHome-工业软件践行者

Teamcenter SOA 开发基础代码解析

[复制链接]

2015-2-3 08:45:06 5457 0

admin 发表于 2015-2-3 08:45:06 |阅读模式

admin 楼主

2015-2-3 08:45:06

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
/ A8 R) C. H# m; S( a
Teamcenter SOA 开发基础代码解析5 [& i, C4 q" v5 Z! ]1 \
* An instance of the Connection object is created with implementations of the3 ~) e4 A+ m* h
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners3 {. s, i2 f2 S( s% F
* intefaces. This client application performs the following functions:2 j1 z! v5 b- q8 }+ a  j* c' p& f
* 1. Establishes a session with the Teamcenter server
) }7 z( a7 L. w* 2. Display the contents of the Home Folder
' [3 o$ A/ b; z+ m, C* 3. Performs a simple query of the database, A5 P! t# M! V' a6 h+ T9 P2 X0 F
* 4. Create, revise, and delete an Item* b& r/ X& o. |# `/ f' m* N

, F( y( U4 H; q- Y5 @( n( U/ B1 e2 b) j6 F; x9 A6 n7 n: _1 D
public class Hello5 A8 h  {1 x- J0 p
{
8 M0 x% f0 T) ~0 N7 I/**7 z$ U6 ]4 b; g. t* R
* @param args -help or -h will print out a Usage statement6 o  \8 ~2 Y) ^, \/ P) @. [
*/( `4 O0 S3 N( h; m' k
public static void main(String[] args)
' x8 U; O6 m9 \9 k{
% L( _5 W) I- E  Q6 Sif (args.length > 0)
- S7 b" J/ }; y  l. K: F' @{
8 N  l$ `, M' U& |$ Kif (args[0].equals("-help") || args[0].equals("-h"))" ~& ?+ b+ o' Z( i: p
{
7 T  t8 [) F& d3 uSystem.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");* p' c' A% K3 j& X$ [# }
System.exit(0);2 x; W. J' j. V# u6 G
}
, ?8 ]% U$ `  u# h& g- O}7 z% A/ i8 @: K9 K1 k$ L8 h/ t
// Get optional host information
( m' S4 f0 H. H2 k. z& ?: X) sString serverHost = "http://localhost:7001/tc";
" c. z& l! g% O# X: dString host = System.getProperty("host");
: ]; p" d2 G" Hif (host != null && host.length() > 0)
7 i6 |0 @- Q) g+ P" m{0 J& e; J4 p8 [7 W# K, `
serverHost = host;
. |7 w2 L' B& t1 z9 T0 y}' i8 Q) J7 ?, z4 h- I! H
Session session = new Session(serverHost);
+ @0 A& b( k& ~: M- @* NHomeFolder home = new HomeFolder();1 R8 n3 `, W( J! F& Z' }( ^4 n
Query query = new Query();8 v; E* Y4 U8 y; B
DataManagement dm = new DataManagement();6 s# L5 u9 T$ a6 `  C" `) U
// Establish a session with the Teamcenter Server
: T6 q) |/ `! }( l# w3 IUser user = session.login();$ q/ g/ B! o. o; o* K% g
// Using the User object returned from the login service request. o/ |9 h# N5 p4 v- S
// display the contents of the Home Folder
" ^9 M8 P" |- y' L1 w/ vhome.listHomeFolder(user);% t" H1 ^4 E2 T$ d2 J+ {
// Perform a simple query of the database
( K7 g! e7 L# z. I; J& Qquery.queryItems();
0 w  W0 \3 V' p$ Q. R# J4 L; G6 e! K// Perform some basic data management functions& G1 ~. R* G( ]4 k; t2 K  H: m2 {
dm.createReviseAndDelete();
1 u; U5 R  j- W+ x// Terminate the session with the Teamcenter server: p8 i7 u( W- H
session.logout();
% r" ]. _5 F5 d5 \/ h$ t3 o}; f; \: ~: E1 {
}
" O) {  Z0 |+ e" s; [2 E" E
  J" K' q, r8 [' u. g* H; a
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了