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

Teamcenter SOA 开发基础代码解析

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

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

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

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

x

% p* Z4 a+ C7 K$ ^3 _. G% x0 b% b" BTeamcenter SOA 开发基础代码解析
% E$ z- y" E9 O! R0 K7 h* An instance of the Connection object is created with implementations of the# w: @0 v$ I& I4 U
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners
. T. J5 s; X! a; e# q2 Z* intefaces. This client application performs the following functions:
! L4 ~: }; v& Y* 1. Establishes a session with the Teamcenter server+ }/ h, A/ f2 H: y+ `
* 2. Display the contents of the Home Folder: t* L$ y/ B* Q. @: l/ l: R
* 3. Performs a simple query of the database
, D: b/ [( p  I5 x* 4. Create, revise, and delete an Item
) Q$ m4 r# n1 P* B# `2 h' C
2 _3 B/ q9 {' }( p- M. u( E+ c& ^3 w
public class Hello
6 L. W8 F, ?  W- i3 N. F{4 c/ \9 f7 J8 f* y
/**0 a  c* {% G6 `9 x6 }
* @param args -help or -h will print out a Usage statement: j! |, h/ R9 R4 h# ~/ t, b9 g
*/
. u; S* q6 k$ u. Apublic static void main(String[] args). O' ^. C* p4 _0 \: G
{' K: c  e3 Q# t/ V* P
if (args.length > 0)
5 g4 [' p0 A; y8 L/ @* @{
; N; l. a. K4 G" y' jif (args[0].equals("-help") || args[0].equals("-h"))
+ |, m. v* j) }! v{5 }4 \1 v4 A: d) g8 ~$ p
System.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");6 C6 E4 A3 Q$ L" o6 a, ], s# a3 R7 U) ]
System.exit(0);
5 q2 @3 x6 o4 C6 m- ^1 V' B, J$ q+ j}
! P, R; h# N* y+ q. Q9 c}
' P7 C6 c8 n% U% P. u// Get optional host information
3 l+ u+ F( T# N- {String serverHost = "http://localhost:7001/tc";
" O4 O% @- [/ d1 w0 V; mString host = System.getProperty("host");
7 m5 l/ E5 U9 ?9 I  ^7 d9 Rif (host != null && host.length() > 0)% t  Y, f! O" g  p" p2 R
{
) y+ E  L7 d5 R, I' YserverHost = host;
0 n* N! K, g4 i5 m; q}/ ?2 ~* x( P. [$ w$ B
Session session = new Session(serverHost);5 s3 p% |( h+ O5 L- R- i! g$ U2 J; S
HomeFolder home = new HomeFolder();" b8 r1 f# n0 P- Z4 t
Query query = new Query();
4 \. C( T" j8 R) k6 VDataManagement dm = new DataManagement();
# Y+ Z9 B. R5 J  A. ?" Z6 B// Establish a session with the Teamcenter Server) P& l) Y6 r5 O$ U. H) H
User user = session.login();
& X3 x2 _% q2 o0 X( ^& w& [// Using the User object returned from the login service request5 _) B- g6 d' K4 O
// display the contents of the Home Folder2 \0 U( f; g/ D: s
home.listHomeFolder(user);2 j( A' P, Z! e* q" @
// Perform a simple query of the database
- G3 i7 s- z* l6 x9 u0 \! h% mquery.queryItems();! y' g, ]  g! r9 w" V7 ^
// Perform some basic data management functions' n+ ~' s! G0 A' t; ~! v: W
dm.createReviseAndDelete();: C$ c$ Y7 v% W5 D9 ]! C
// Terminate the session with the Teamcenter server
2 }: r, k) T' I& x. B2 X; [session.logout();
7 d3 }; ]) O, g$ E! m}
( Y& t8 ~( R4 S- P3 M& O; Z}) d" k+ c! `  B! M/ p

/ M% e% H& m- _$ W
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了