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

Teamcenter SOA 开发基础代码解析

[复制链接]

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

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

admin 楼主

2015-2-3 08:45:06

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

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

x
) n6 }( b, T, X( f1 \& y3 O
Teamcenter SOA 开发基础代码解析0 g! ~, X7 H" ^5 G( M9 r- V8 g
* An instance of the Connection object is created with implementations of the1 U9 N( Y+ Q. B
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners
; j4 ~5 h/ n$ j1 ]; f* intefaces. This client application performs the following functions:3 Y, U7 w9 {  Q: q1 B1 E
* 1. Establishes a session with the Teamcenter server9 g1 s9 n- D* g0 [- ]4 {
* 2. Display the contents of the Home Folder2 f! K0 q" a0 P
* 3. Performs a simple query of the database& P( J2 m; k/ w2 }, \# ?0 _# R
* 4. Create, revise, and delete an Item+ p. S+ `* r' X3 U: B
" L+ l$ U' H/ k0 P6 p8 k  k& {: w% [# F3 J
7 L( X+ P/ n; r5 I3 X
public class Hello
+ r1 F5 c/ D3 W; R7 R{
8 X9 l# L: F2 o% s  n/**# h8 j3 i! |! X$ p3 q+ i; t
* @param args -help or -h will print out a Usage statement
% q1 J8 j( |3 ]' w! k  U! c5 x. R*/
" S6 O& ~8 r& p4 F5 Ypublic static void main(String[] args)$ T+ ^3 h+ a) ~2 N  W, J
{; E4 ?" k; n0 I
if (args.length > 0)
+ G" K+ I5 k3 l- i% t8 u9 T0 X{
2 k, u  P' b$ o4 P8 l+ nif (args[0].equals("-help") || args[0].equals("-h"))
  t/ D9 ~8 ^# `! j{
6 _6 \: H3 ^' o& s# NSystem.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
' k: ?- S2 }  g3 ?System.exit(0);( R* A" M& f1 v3 u
}: L% Q" O/ p# c/ D% s% H; E1 m4 E! D) J
}
! b! b( f+ x, l; F// Get optional host information; i( V# d( Z( f9 y/ L/ j+ [7 ~( d
String serverHost = "http://localhost:7001/tc";/ r( X7 ~$ Z6 A1 F' k
String host = System.getProperty("host");
5 d/ B5 r& f: s& p; f+ qif (host != null && host.length() > 0)
* y' m7 E0 u( n/ [  x* @{( Z7 P& b" S9 v- q' z& b. y
serverHost = host;! }( B3 e/ J: E8 V
}
+ i" r! ^' e  Q5 |6 DSession session = new Session(serverHost);8 k" _  [% T6 a3 b
HomeFolder home = new HomeFolder();& Z9 U4 q! c, p
Query query = new Query();
5 h2 B8 J, E( {) R* U: [$ M& mDataManagement dm = new DataManagement();
, z4 w* C; a( T6 K. U" u// Establish a session with the Teamcenter Server
( ?$ z4 Z( R- [. `8 F7 hUser user = session.login();' r+ [& H. e( {* D6 _8 }
// Using the User object returned from the login service request7 a/ n' n) J( A+ f% j& W5 L  R
// display the contents of the Home Folder
. n8 j  q' f4 y1 shome.listHomeFolder(user);5 @( u7 G% o& P2 N: ~. [
// Perform a simple query of the database
1 h. h& N& ?  x6 ]query.queryItems();6 N6 c8 j( {# u
// Perform some basic data management functions
+ h) ~9 h7 l1 ~  ?* E4 udm.createReviseAndDelete();( l% I  B# o# {0 T5 n
// Terminate the session with the Teamcenter server
3 U; I$ ?9 H8 {+ S$ }9 Y1 X0 Ysession.logout();4 P: n2 ]8 q6 {. f) H
}
, _+ H' E1 O; E, d9 e8 h}
9 s/ |/ g- ^( M% R+ `+ |7 V( G4 z2 ]. U
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了