PLM之家PLMHome-国产软件践行者

Teamcenter SOA 开发基础代码解析

[复制链接]

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

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

admin 楼主

2015-2-3 08:45:06

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

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

x

& p$ }& h1 J* c! a/ NTeamcenter SOA 开发基础代码解析: {- O7 a* g# K1 y3 h
* An instance of the Connection object is created with implementations of the
3 h' H9 Z' Z8 I' y8 _* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners0 H/ G+ K4 o# q$ z  H) A8 y
* intefaces. This client application performs the following functions:: k: z9 w6 A% u: f& g
* 1. Establishes a session with the Teamcenter server" F; S5 T+ \. ^0 h4 g' S! {
* 2. Display the contents of the Home Folder
% X; S5 i* w+ s% e* 3. Performs a simple query of the database
) T6 _! h$ M* v% C2 X. ]* 4. Create, revise, and delete an Item: w' `& c; a! y# j

$ J, k/ W1 u6 n& r! d8 c$ b& R# b( a) A
public class Hello" U; `( y& r  J: |; [4 L
{! w, g) b  j# M
/**  ?# I$ i  U( W3 x
* @param args -help or -h will print out a Usage statement5 C3 x& d) i% @0 z
*/
  O3 O5 s; X  dpublic static void main(String[] args)
1 p9 y9 ~* v8 P) i; {  y) r% g1 x{
! R2 b9 {; e) Hif (args.length > 0)' U- H5 H7 ]* `' k6 W" D3 c
{
# _7 |  K7 H2 M- `6 I% }: Xif (args[0].equals("-help") || args[0].equals("-h"))2 w2 }: R+ B5 A5 ~- n
{; q) Y! N' v$ S& r& d; _5 X: Y% n
System.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
: C8 {& o; Z& _1 mSystem.exit(0);
& d8 x- ^  H6 ?2 ]# u" y}
  H) v! k+ S" Y( O}
. g" I4 s- l6 ]( K$ Y: }// Get optional host information
0 ]4 y! u/ [& `* q/ V: ^String serverHost = "http://localhost:7001/tc";
6 V. B& _; j: ~2 W0 r5 p' n. @String host = System.getProperty("host");
$ p: V& s7 K1 i) z( \2 G5 g% mif (host != null && host.length() > 0)$ c0 ~) S/ D6 M- d: T7 p
{
3 Y  v' j4 H, }! l% LserverHost = host;- N8 j' o2 k6 [" F4 q
}# I7 n! ~1 P" U$ }& ^! ~
Session session = new Session(serverHost);0 ^/ `6 \' b) Z/ b0 r% c
HomeFolder home = new HomeFolder();
" w% J: T8 ]' K0 `/ P3 a  I- K5 sQuery query = new Query();, X) N% n, q6 z3 \- K
DataManagement dm = new DataManagement();
0 d7 Q: Y1 k. s9 M9 A// Establish a session with the Teamcenter Server
6 H9 d* \* k; iUser user = session.login();
$ ]5 M5 x! b% `  e// Using the User object returned from the login service request6 c& i6 b' ], z: b" c1 Y; y( U0 t
// display the contents of the Home Folder0 S$ y7 u" H. e8 W
home.listHomeFolder(user);
6 q7 D7 ?% M  ]' P; |7 ^// Perform a simple query of the database
7 V0 j: m, V+ E. @" C3 x- g" @' }0 wquery.queryItems();
7 z6 x1 \) w. v! @6 q// Perform some basic data management functions
' }7 I. k" F; W7 p* Gdm.createReviseAndDelete();! |* D! g. T- R
// Terminate the session with the Teamcenter server
5 e4 F$ m- M, ksession.logout();. z4 u; M* v9 o3 @
}
8 B# t" x8 G% X1 M}
; y  N: L$ U# A) G% d& L9 H# R9 o( _* r$ {/ D- ?# |$ M; i1 k; ~
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了