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

Teamcenter SOA 开发基础代码解析

[复制链接]

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

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

admin 楼主

2015-2-3 08:45:06

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

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

x

% Z4 K" c" Z% e. ?3 ?Teamcenter SOA 开发基础代码解析
0 e0 g% M! u# m5 D$ R* An instance of the Connection object is created with implementations of the. f# a2 t, k$ {( T" S- f$ O1 j8 ~
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners  j3 ^/ t( A  \' m6 V( u: x
* intefaces. This client application performs the following functions:
9 v4 y. W4 K8 ?* 1. Establishes a session with the Teamcenter server& ~! s* T4 [, S1 K
* 2. Display the contents of the Home Folder
1 ~1 ~/ i% \/ J* 3. Performs a simple query of the database0 @2 S3 W3 Z- w! I/ x0 U$ Y, W+ ^
* 4. Create, revise, and delete an Item
  l& V7 R' S* V: M0 i4 A! b! a  i' o1 O9 L- Q( O
! m) S3 M, _; l: h& q# K( V: @
public class Hello% e) b. F6 K( Y: ^9 G  _. B/ `
{
% g8 R1 _) G1 r6 ^# o6 X: G3 _/**) F5 K2 v5 c/ O1 |
* @param args -help or -h will print out a Usage statement( E3 ^. B& J9 I1 |$ d
*/! _& r; b5 m3 v& p1 \. K
public static void main(String[] args)
5 m% |$ A3 }: a: z{6 x; s0 F6 o! k- W. U7 \0 g$ r
if (args.length > 0)
4 q6 M0 m# Y  F4 t+ c/ m8 L* }; ]8 |{3 w- A8 t+ u% x
if (args[0].equals("-help") || args[0].equals("-h"))7 O+ Q" I" }4 S: y* {! x$ y9 p
{
% Q! K8 q+ T5 A; y; k) v* jSystem.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
4 [% b5 i- h& t6 i4 R( q2 S0 `% s( bSystem.exit(0);; `% \5 L) H9 }
}# y: _# m5 E; }$ k9 j1 V% `# K
}; m5 L, b, V- W+ H. [/ J" x
// Get optional host information! i7 {* `2 p) x3 _; ~
String serverHost = "http://localhost:7001/tc";! X& p: _# `% o/ W. i% e; d! @$ F
String host = System.getProperty("host");9 E" ~8 _9 H9 N2 x# {# _
if (host != null && host.length() > 0)
. k" p$ J4 f9 C% `{
6 p$ i1 M5 f3 \( tserverHost = host;( T0 P3 t  e  i
}
: U9 }. [+ g; DSession session = new Session(serverHost);2 G, |7 g) N3 g
HomeFolder home = new HomeFolder();/ Y3 k- c5 w. Q
Query query = new Query();8 {/ N: ~" d/ H
DataManagement dm = new DataManagement();
! _' H$ U! h5 V$ X: H// Establish a session with the Teamcenter Server
3 N+ j: H. i* wUser user = session.login();/ `- W+ v6 C6 x) f3 d
// Using the User object returned from the login service request
* U1 p. }& T' |, W2 F// display the contents of the Home Folder
  f3 u8 g% G- B( t$ hhome.listHomeFolder(user);
5 r& |& Q  O. i7 C" Y// Perform a simple query of the database+ f: B) p, A" G' L# y% E
query.queryItems();  D, {) P( S* }- S
// Perform some basic data management functions0 v" \) M6 Y5 ]% |" ?/ q- F
dm.createReviseAndDelete();2 L" y, Z4 W4 `3 ^
// Terminate the session with the Teamcenter server
) H5 [: Y* N+ P- wsession.logout();9 Y9 S8 s/ D2 @
}* n0 g% ]& `! @/ Q- H4 u' z
}# f. j/ w) j1 q) w: H  x4 ?
- f' y. y- X# r/ S: m. 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二次开发专题模块培训报名开始啦

    我知道了