Professional Documents
Culture Documents
com
2, Thit lp eclipse v bin mi trng trong window Thit lp JAVA_HOME, TOMCAT_HOME, AXIS2_HOME trong system variable Trong phn cu hnh user variables for user: Add thm bn ghi: + variavle: PATH + VALUE: %JAVA_HOME%\bin
Trong Eclipse sau khi copy cc plugin y . Tin hnh cu hnh +Java\Installed JRE (chn ng path ci JRE trn my) + Server Runtime Environment + Tomcat (nu ci plugin Tomcat) + web service 3, To web service
Hong Minh Tun hoangtuan.cntt@gmail.com A, To web service B1: To java application nh bnh thng ri chy th. Nu OK ri th thc hin bc 2 B2: Chut phi vo file c .java c cha method mun tr thnh service operator. Chn New\Other. Trong Axis2 wizard (mc ny s c khi ci 2 plugin tng ng)chn axis2 service archive ri c nhn next (tick chn vo .include class file only v tick chn skip wsdl) n mc chn ng dn gii nn, ta chn ng dn \ApacheTomcat7\webapps\axis2\WEB-INF\services Sau vo Tomcat\bin. G lnh startup, web service s chy B, Invoke 1 webservice Search nhng tutorial v web service client in java using axis. Nguyn l hot ng l t file wsdl -> java stub. Sau khi c dc cc file java m axis gen t wsdl ta tin hnh call service nh sau: (y l 1 v d minh ha)
proxy=new MTServicePortTypeProxy(); request=proxy.getMTServicePortType(); do { status=request.sendMT(userId, message, serviceId, commandCode, messageType, requestId, contentType, username, password); counter++; Thread.currentThread(); Thread.sleep(2000); //pause 2s } while (status == -1 && counter < 8);
Copy folder Configure vo trong folder bin ca Tomcat Copy ton b library trong project vo folder \ApacheTomcat7\webapps\axis2\WEB-INF\lib (Ch : trong library ca project nh add thm ton b th vin ca axis1. Vic ny phc v cho vic Invoke service) Disable log mc nh ca axis bng cch: Vo folder \ApacheTomcat7\webapps\axis2\WEB-INF\classes Edit file: commons-logging.properties thnh ni dung sau: (Enable dng:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog