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

Teamcenter SOA 开发基础代码解析

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82172
QQ
发表于 2015-2-3 08:45:06 | 显示全部楼层 |阅读模式

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

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

x

. M# F  C, k, M5 P6 W% r8 sTeamcenter SOA 开发基础代码解析
$ O0 D- t1 A9 x$ G$ x  w* An instance of the Connection object is created with implementations of the1 K* ?' |: T% s' ?
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners6 X) s4 d6 j' Q1 q
* intefaces. This client application performs the following functions:% W* x$ W3 h; E
* 1. Establishes a session with the Teamcenter server
5 z* `. x( T) [& K  Q+ c' W: v2 o* 2. Display the contents of the Home Folder+ P5 p9 e( P, Y4 W9 [- y0 L" F1 o
* 3. Performs a simple query of the database
5 P, A8 K( Z, ?8 t* 4. Create, revise, and delete an Item
) C2 p7 C2 ~; n/ o; C# w( A6 ^3 a4 ]& L# g9 c9 P

0 s5 f" v8 q/ r4 {! v9 ]7 j" fpublic class Hello
6 D+ P* v6 J0 k. H. y{
0 x: a" j) o+ Q' Y1 Q, {/**% \" i" E/ b/ {0 ]. }( T
* @param args -help or -h will print out a Usage statement5 i, G5 w3 M1 j( `: v% u" n
*/
; x& O  I' u, I0 T) N2 Y# ?8 ]public static void main(String[] args)
& O* q7 U8 g/ t4 W{9 `$ K* ?( u* X/ g' s7 }
if (args.length > 0)
/ B; p& t" e9 H% H8 }6 t! t8 a{# [- Q& d: V3 U) u* Z5 b7 ~
if (args[0].equals("-help") || args[0].equals("-h"))2 ^9 \- U. O, \1 N( x
{
" W6 G' m: h) B- X- |/ sSystem.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
* l9 |5 v: c, f5 wSystem.exit(0);
) @7 C7 \8 N8 p* L4 \6 V( t9 H9 ]}
& V5 k" K. e: M: R+ f}
! O8 a" u$ _/ C$ J$ a! \4 [9 q// Get optional host information
8 [8 z  A/ x# \: }1 c! _$ DString serverHost = "http://localhost:7001/tc";
0 h; f" R- p2 s: I$ u0 {# r. FString host = System.getProperty("host");
6 _# ], j0 v3 D8 l! xif (host != null && host.length() > 0)) a( ?- u% Q. J3 X- d- V
{
* \8 e. b: h. }( I0 x) W4 rserverHost = host;% D$ Y! A2 y. s2 h
}! u9 s3 G) z4 P1 x* F9 B
Session session = new Session(serverHost);
. I1 ]/ U) W/ u' X. |( `HomeFolder home = new HomeFolder();8 E9 k5 ]& Z' E9 y+ `0 e4 m! I
Query query = new Query();
* c  K1 @8 L+ q* L) A6 QDataManagement dm = new DataManagement();
8 a2 A3 W) p  R" G& Y- i! @9 ]// Establish a session with the Teamcenter Server
% Z2 _8 \0 t2 b  C7 wUser user = session.login();9 u% u9 @% f; _/ D
// Using the User object returned from the login service request0 X# o5 h: H- |7 @; c8 a$ _0 d
// display the contents of the Home Folder5 j; R/ j6 G1 O$ \
home.listHomeFolder(user);
3 o0 p% {! A- Z0 V8 a2 K' d& ^0 |// Perform a simple query of the database
2 r7 W' o( z4 J4 v$ y% Rquery.queryItems();- ^* R$ v- ?7 V! K  N
// Perform some basic data management functions: F6 d  G/ R" J* E" S
dm.createReviseAndDelete();
' i# Z, Q; u3 H6 s0 p// Terminate the session with the Teamcenter server
' t9 F0 i" s1 P2 msession.logout();
0 G5 ]& k4 ~5 }) g}( `2 i8 I( O* Y; e4 i4 ~- q2 W& M
}
+ P1 T% j5 c# X5 _( ]: K) Z
( B3 x5 _: M: g# }$ h0 B
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了