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

Teamcenter SOA 开发基础代码解析

[复制链接]

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

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

admin 楼主

2015-2-3 08:45:06

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

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

x

3 w+ w* a! X* q( K4 G! ^Teamcenter SOA 开发基础代码解析
* {0 s7 f$ ^0 w/ ?/ h5 m* An instance of the Connection object is created with implementations of the! y* i2 s6 Z9 C7 o2 Z; e9 ~* ]4 C
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners8 c: A! J/ s' j5 x
* intefaces. This client application performs the following functions:2 U$ V% q6 P  d) b4 Q- C
* 1. Establishes a session with the Teamcenter server$ M6 |& l/ X4 [
* 2. Display the contents of the Home Folder8 W! p1 G, X2 T. h. j9 `2 ]
* 3. Performs a simple query of the database
+ @( Q% Y, X( V+ @* s* 4. Create, revise, and delete an Item6 X7 A% ?3 q6 x. `
% G; T) `, {4 i* M5 V& V4 H
# [! u' b! E2 }, m: x
public class Hello! f: u# ^. x6 J2 i8 F
{. N) y: w- J8 S
/**3 t( m) J4 `1 A1 j9 @& S! |6 R; `
* @param args -help or -h will print out a Usage statement
. x) M$ G9 `# ~" m0 ?6 o3 }) Y( h*/& h: ~- T& S; ^/ l7 v3 ~
public static void main(String[] args)
$ a( Q$ t, `' {" p$ _6 h0 G8 q{
0 `' P* D! E% b& Rif (args.length > 0)
9 U4 _8 E, v% a/ o$ y4 n/ [8 E{4 T/ _7 g+ E! \2 A4 z2 q
if (args[0].equals("-help") || args[0].equals("-h"))0 Q" [# ]7 [; A0 s' Z1 B
{4 I: a+ D0 m8 `" b0 D* |# O
System.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
, U* O, l+ t2 B+ PSystem.exit(0);
7 M% T+ F. [: }% K8 ~- s}/ @5 }/ Q3 g- F) x; V
}
1 \2 r" ^: \, E! r1 i0 j// Get optional host information
# X/ Y. L; M) F# L5 _! k# T) W8 VString serverHost = "http://localhost:7001/tc";" c# S% z, h6 G4 d: ~! {5 U3 g
String host = System.getProperty("host");
5 `4 S7 g+ `! y  Z% z1 S7 {- {if (host != null && host.length() > 0)
+ u5 ]) s  k2 B! _{8 ~: c9 x  \: V  `" D1 Z
serverHost = host;
, m$ B# S3 Q; q, m}
% a0 v; f, K6 A2 x% Q( rSession session = new Session(serverHost);
$ a& v! F8 @) V& Z$ nHomeFolder home = new HomeFolder();
) p% x2 L. h7 f. w$ B: X* {' }  PQuery query = new Query();
7 \3 n2 i/ ~/ c+ T% v' ~DataManagement dm = new DataManagement();: A2 }0 Q! U% N. K8 D$ {
// Establish a session with the Teamcenter Server3 q9 Q, w! F$ f
User user = session.login();
/ N& L' h0 }! {2 X1 ^$ Z// Using the User object returned from the login service request
; E% ^7 Z, U9 |. _: R# r// display the contents of the Home Folder
) @, l" u" L4 F: K: Q' O/ jhome.listHomeFolder(user);
8 s- j' B9 ^: O7 k5 A; u5 A) N8 t0 @// Perform a simple query of the database+ k5 b9 S6 ?# u( r8 A1 {* P
query.queryItems();
# Z# A7 k* D& H2 I2 U. S6 L// Perform some basic data management functions
$ X4 x- Q' {( K0 `5 Rdm.createReviseAndDelete();$ C$ ?+ ], Z0 m9 O2 f0 P
// Terminate the session with the Teamcenter server! W+ `/ }5 G! f$ m
session.logout();
+ J& m4 \% p/ ^8 d}) i3 I* a% n/ z8 y  T
}
; C: `* m* R6 |/ i. t" o1 a0 T1 P4 d9 Y/ {7 Q6 S' N
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了