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

Teamcenter SOA 开发基础代码解析

[复制链接]

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

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

admin 楼主

2015-2-3 08:45:06

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

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

x
* `  h# x, b1 x5 A) m  e. v
Teamcenter SOA 开发基础代码解析
$ |: b  [6 z2 J$ n! M- ]& C* An instance of the Connection object is created with implementations of the
5 M  ~- m2 n* g: E1 H: u6 N* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners) s- I3 f3 S" l; _" d3 R6 ]8 q
* intefaces. This client application performs the following functions:
# _" f4 g6 M. U) p9 M1 q) a; k! F* 1. Establishes a session with the Teamcenter server
3 U" M0 p1 \5 A5 G* 2. Display the contents of the Home Folder
) b3 f( b/ J$ a: _2 \+ O3 S' y* 3. Performs a simple query of the database
4 {% c* t0 ?# Y& _, U1 M. ]& v* 4. Create, revise, and delete an Item8 N* R$ k$ Q7 v3 E( D9 a& l
2 k; c/ R9 K% q+ _
% k" m/ H, n* Z* x. x+ Z
public class Hello
- p, g5 p  V7 S* J* r! l{
/ w; e) L* z8 I$ q/**/ H7 {+ w' p, r: h2 Z
* @param args -help or -h will print out a Usage statement
& W8 J8 ^: W  A! g" W/ j: N+ E*/
: P* K+ \$ m5 o& o) \public static void main(String[] args)
' D$ F) l% E  ~  c$ y) z{
- N  A4 j4 ^9 L0 o& f; o- S) N1 Z4 fif (args.length > 0)
# j' T- v5 B  y% ?7 i{5 c5 c: w2 o& A/ U
if (args[0].equals("-help") || args[0].equals("-h"))8 N+ @$ j$ u( Z7 q) r( r5 F; x- u1 L
{" w! @# z$ p% D! u6 f9 Y/ K$ D
System.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");8 R2 G0 L: g$ S5 y+ B' q/ E7 u
System.exit(0);
3 H* s9 q# j' _, [) M}8 E) u; G! ?# F# o$ ]
}
: Q8 a, \% P) r9 K$ E// Get optional host information* J; T! K, S- _' A
String serverHost = "http://localhost:7001/tc";  e6 f, D- c5 a: K/ F0 g3 q& Z8 S6 m
String host = System.getProperty("host");
+ L2 x  T4 ]5 y# fif (host != null && host.length() > 0)
1 w4 ]2 F; W& C1 q5 q' l$ y{' T8 j( p& B$ V, f2 K4 l
serverHost = host;
; A1 O3 k% V5 Y- ^2 Z1 h4 j! ^6 q+ C}
3 f# u6 {/ [7 Y- M; M: qSession session = new Session(serverHost);
, @; J5 l& E! V7 c3 R+ ~HomeFolder home = new HomeFolder();
$ }9 {+ P: x! X1 G! k. B; Q$ IQuery query = new Query();/ [/ w) _$ M  A' q# `: e7 w
DataManagement dm = new DataManagement();6 E7 F) e7 `; P' G
// Establish a session with the Teamcenter Server
2 {: W9 I$ Z; J( R( [User user = session.login();- n; i7 Z- R! n4 j" z3 R
// Using the User object returned from the login service request# O9 X. F; O4 {
// display the contents of the Home Folder1 \' e$ [& U" p) h9 R$ \8 D3 I7 y
home.listHomeFolder(user);$ C3 M1 c, w& u7 `7 M
// Perform a simple query of the database/ k; d3 ]3 F% p3 W! K$ k
query.queryItems();
; w- ~' T' Y# Z+ i// Perform some basic data management functions2 z' l9 \1 @# q
dm.createReviseAndDelete();
+ W; r- J, {& @$ q/ P6 a// Terminate the session with the Teamcenter server
+ A4 K1 g' u/ Y4 W2 L* csession.logout();
5 k4 R% T# V" y: v: R* P# R}
' _) `" s' L( h! J. _% K}
/ H. S2 A1 U9 Z4 Y, t
) Y4 d& C% v( t. A& J# k! X
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了