UAP平台(NC65)下webService的开发流程,及测试方法(含过程截图)
ICNC DEMO
)t NC KLUN
MNC WebService的性
o ksNE Pl AYFR
ˇNMw
人过滤文本
Java构砷路径
web services
fE ncitt web
>Matoran
源码)项目P()4序和导址()
四 service1/src/ client
右键,属性
构律路径十的AR和兴文但实
an
i# service1/src/private
ad axis-ant jar- D) \nc worcijarWWebServices
添力J∧R
v At Il. irripl weJ
kai\WeLSe viLe>
〉Java霸评器
ag comrmons-iscovery-0 2 jar- D \nc workyjar'
油 service
Jav代码样式
ne commons-ogging-1.0.4 jar- D nc work yar'
添加变≡
avedon位置
JRE系库 RublE
opertiecEditor
E Ant Libr
u162.jai- D: \nC v/oI k yar \Web Service象加文件(
Task Tags
rt era
Ei Product Common Library
TestNG
Add External Class Folde
>=s Generated EJB
ork Library
2JE系库 Runtime]
B Module Piblic I ihrary
偏谇检查先项
EA Middleware Library
移图(R
Module Client Library
>E Module Clent Library
M Module_private_Library
目引用
E Module Lary Lib
匹仃!词式设萱
zA Module_Private _ Library
引用的库
重恼历史
o G designmodel
v已ME|A-IN
回题J3ado日经剂台■UP- ULJ0 error -eport吧N资潭管谁器楼型视图厦性
8-选中项目,启动中间服务器
9-进行运行配置:选中项目->右键->运行方式->运行配置->选择项目->自变量->在
VM自变量最后添加“ uapws'
>E NC DEMO
创建、管埋和运行幽置
中 nc itf weh
鸥 scrvIcc1/src/ prIvate
|月靠
名称 N). NC_WebService_Server
a# simpl.
输入过滤器文本
主要自交旦JE>类路v沸陽环埃口公共()
an sgPsnlmpl java
I NC DEMO STarter
程宁自变呈/A)
C service1/src/test
x NC DEMO Scrvcr
Y nc homework是 tarter
RE系统库 Rulling
Y NC KLUN STarer
M Ant librarv
Y NC KLUN S
>E Product Commcn Library
Ra Middleware I ihrary
I NC PLAYER Server
D ExLService ConliyDir=S(FIELD NC HOME)/ejbXMLS-XIIX 76B1-
XX: MaxPermsIze=25m -Duap. hctwebs=itw, portal, ts
E Flarrlewuik Libr ary
器 A Module Public Library
NC Webservice
Modile Privare I ihrary
I n65 elp sy udp Serve
工作目录
E Module Lang Library
K nc65 crp sq zb ]Starter
○缺省(): workspace Inc: NC. Weh Service
〉画引用的库
重nc65 erp sg zb Server
0其他什H:3 FIELD_NC_HOME)
L META-INF
I nc65 kI imydermw JSLai ler
E nc65 kl mydemo Server
工作宁间O灬文件系统GF
变(E
C config
实nc65 ca hind Starter
过滤器已匹瓦59项,总共59面
应用
乌META-|NF
彐 SaPs upm
运行关闭
乌 METADATA
L script
10-在浏览器地址栏输入http://127.0.0.1/uapws/service(i端口为80),检查是否成功
端口号不是80的:htt:1270.0.1端口号/ uapws/ service
新建Java项目,建包、测试类
Java项目导入jar包
2-生成客户端:在测试类编写代码,运行,成功的话就会在sc目录下生成包
代码如下
//接口路径
Stringwsdl="http://127.0.0.1/uapws/service/nc.itf.webIsGpsn?wsdL
WSDL2Java. main( new
String囗{
src
-p",
nc itf hr. oa IHr ForoAQueryService stub", wsdl D);
l包资流管器以
4g8.3a
smW.est., java t D LIsts h江t.jv1rtrs⊥ Binding otu.a
B NC DCMO
import org. apache axis wsdl. SDL2Jovo;'
public class Test1 i
H- n=65 sg bidd
public static void main (string[l args)i
b E! testworkg
5r1整=p,/127.0:/(eri是L2、m
2WebServicesTest
NSDL23ave. in(new string! 1 f"o","arc", "p"."nt. Lf. hr, od. LHrFcroAQuer
ice.sLub, wsul b:
t nc itf hr. o3JHrFcroAQLeryServ cestul!
运行这段代码
引用的库
成功就会生成包
接口路径?wsdl
测试类
3-将测试类中生成客户端的代码注释掉,在测试类中编写代码调用接口方法,运行方式
>Java应用程序,测试能否成功
團包交源管理器8
鸟日s,jam8snml.ava日Egs-,mTet. java KD ISgfsnfortTy?. jara DI8
它 NC DEMO
package webtest
忌 NC KLUN
N叫A执行生成客户端排0:::+:9t
≥nc65 erp sg uap
代码,生成的包
mport nc itfhr.oa. IH-ForCAQucnyScrvicc stub ISgPsnPortTypc;
o E nch.5 erp sg_7h
simport org. apache axiswsdl WSDL2Java;
>E nc65 test
public class Test1
v i= WebServices Test
public static void main(Stringl] args)t
/*STring wsdl="hLLp: //127-0.0. 1/uapws/service/rIc.Lf. Net. ISgPsri?wsdl
WSDL2Java. main (new String[]t-0,src","-p","nc itf hr. oa. IHrForoAQueryse
v E nc. ill.hl Ud. Hr For OAQuer ySer vice. slul
n ISgPsnLocator j
D ISgPsn Type java
TsePsnporTtypeaction=isp.ettsepsnsoAp1lrorthttpd
In ISgPsnsoAP11Hindingstub java
String str= action. qucrynsnInfo("菅理员"
v母 web test
D Test1 java
)。tem.ou+ print in(tr)
// TODO: handle exception
JRE系统库 lavas-1.7
画引用约库
}
测试接口