Axis2 java WebServices¿ª·¢¶þ
¿ª·¢»·¾³ eclipse3.2 £¨Ã»ÓÐÅäÖû·¾³ Çë²Î¿´ÉÏһƪÈÕÖ¾£©
н¨ÏîÄ¿£º
UserCover£¨Ãû³ÆËæ±ã£© ×ö¸ö¼òµ¥µÄ±¨µÀ²¢¼Ç¼µ÷ÓÃserverµÄusername
н¨°ü£ºcom.axis2.test
н¨½Ó¿Ú£º
package com.axis2.test;
public interface UserCover {
public void CoverName(String myname);
public String getUserList();
}
н¨°ü£ºcom.axis2.test.impl
±àдʵÏÖÀࣺ
package com.axis2.test.impl;
import java.util.ArrayList;
import java.util.List;
import com.axis2.test.UserCover;
public class UserCoverService implements UserCover {
public static List<String> userlist = new ArrayList<String>();
public void CoverName(String myname) {
if(myname != null)
userlist.add(myname);
}
public String getUserList() {
String usernames = "";
for(String username:userlist){
usernames += username+"\n";
}
return usernames;
}
}
½ÓÏÂÀ´ÊÇÓÿª·¢Ò»ÖнéÉܵÄeclipse²å¼þ Éú³É·þÎñÇø¶ËºÍ¿Í»§¶ËÎļþ
1.Ê×ÏÈÉú³É·þÎñÆ÷¶ËʹÓõÄaarÎļþ
ͼ½â£º
Ñ¡Ôñ´ËÏîÄ¿µÄclass·¾¶
Èç¹ûÓÐwsdl¿ÉÒÔÑ¡ÔñÖ¸¶¨µÄwsdl ²»Ñ¡Ôñwsdl ·þÎñÆ÷¶ËÔÚµ÷ÓõÄʱºòÒ²ÊÇ»á×Ô¶¯Éú³ÉµÄ £¨ºóÃæÉú³É¿Í»§¶ËµÄʱºò»áÉú³Éwsdl£©
²»ÐèÒªÆäËûµÄjar°ü ÕâÀïʲô¶¼²»ÓÃÑ¡ ¼ÌÐøÏÂÒ»²½
Ñ¡Ôñ×Ô¶¯Éú³Éserver.xmlÎļþ
server nameËæ±ãÆð£¬
classÄÇôΪÌṩ¸ø¿Í»§¶ËµÄserverÀà ¼´¿ªÊ¼±àдµÄUserCoverÀࣨ´ø°üÃû£© ÌîдÍê³Éºóµã»÷load °´Å¥ ¼ÓÔØ´ËÀàÖеķ½·¨
ÕâÀïµÄfilenameΪaarÎļþµÄÃû³Æ Ò²¿ÉÒÔËæ±ãÈ¡£¬³ÌÐòÖÐÒªÓõÄÊÇÉÏÒ»²½ÖеÄserver name¡£¼´ÅäÖÃÔÚserver.xmlÖеÄserver name¡£
Êä³öÎļþ¼ÐÑ¡Ôñ ²¿ÊðµÄaxis2µÄwebĿ¼µÄWEB-INF/servicesĿ¼Ï£¬Èç¹ûûÓÐʹÓÃweb ÈÝÆ÷ ¿ÉʹÓÃaxis½âѹºó×Ô´øµÄÈÝÆ÷ ½«´ËÎļþÊä³öµ½
%AXIS2_HOME%\repository\services
ÏÖÔÚ¿ÉÒÔÆô¶¯tomcat »òÊÇaxis2
¼ì²âÊÇ·ñ³É¹¦
http://localhost:8080/axis2/services/UserCoverService?wsdl
Èç¹û³É¹¦½«³öÏÖwsdlÎļþµÄÄÚÈÝ ±ÊÕßÏÔʾÄÚÈÝΪ
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns
Ïà¹ØÎĵµ£º
1. Êý×éÓÐûÓÐlength()Õâ¸ö·½·¨? StringÓÐûÓÐlength()Õâ¸ö·½·¨£¿
´ð£ºÊý×éûÓÐlength()Õâ¸ö·½·¨£¬ÓÐlengthµÄÊôÐÔ¡£
StringÓÐlength()Õâ¸ö·½·¨¡£
2. String s = new String("xyz");´ ......
ÕæÕý·¢ÏÖÈËÉúÐèҪ֪ʶµÄʱºò£¬ÎÒµÄÇà´ºÒѾÀË·ÑÁËÒ»°ë¡£
ÓÚÊǹÄÆðÓÂÆøÀ´µ½±±´óÇàÄñѧϰIT£¬¼øÓڶ෽¿¼ÂÇ£¬»¹ÊÇÑ¡ÔñÁËÈí¼þ²âÊÔ¡£
Èç½ñ¿ÎÒµµÄÒ»´ó°ëÒ²ÒѽáÊø£¬´Ó¸Õ¿ªÊ¼µÄÒ»ÎÞËùÖª£¬½¥½¥³É³¤ÎªÒ»¸ö²ËÄñ……
Ôڿγ̵Äѧϰ¹ý³ÌÖУ¬²Å½¥½¥·¢ÏÖ×Ô¼º¶ÔÓÚÕâ¸öÐÐÒµµÄÐËȤ£¬ÓÈÆäÊÇÈí¼þ¿ª·¢ÕâÒ»¿é¡£
ÉõÖÁ¶Ô×Ô¼ºÑ¡Ôñ×ö²â ......
MyEclipseÉèÖÃJSPÒ³ÃæĬÈϱàÂ뷽ʽ£º
windows(´°¿Ú)-Preferences(Ê×Ñ¡Ïî)-MyEclipse-Files & Editors-JSP-ÓÒ²àencoding:ÉèÖÃΪISO10646/Unicode(UTF-8)
MyEclipseÔÚJavaÎļþÖÐÉèÖÃ×÷Õß¡¢ÈÕÆÚµÈ˵Ã÷£º
windows(´°¿Ú)-Preferences(Ê×Ñ¡Ïî)-Java-Code Style(´úÂëÑùʽ)-Code Templates(´úÂëÄ£°æ)-ÓÒ²àComments(×¢ÊÍ)- ......
½üÈÕÔÚ±à³ÌÖÐÓõ½½Ó¿Ú֪ʶ,ÓÉÓڿα¾ÖжԽӿÚÃèÊö½ÏÉÙ,ËùÒÔÏë´ÓÍøÉϲéÕÒ×ÊÁÏ,µ«ÍøÉϵÄ×ÊÁÏ´ó¶àÒ²Ö»ÊÇÈß³¤µÄÃèÊö,ËùÒÔÔÚ´ËÌṩһ×Ô¼ºÐ´µÄʵÀý,¹©´ó¼Ò²Î¿¼:
ÔÌâÊÇÕâÑùµÄ£ºÔÚjavaÖУ¬¶¨ÒåÒ»¸ö½Ó¿Ú£¬ÉùÃ÷¼ÆË㳤·½ÐÎÃæ»ýºÍÖܳ¤µÄ³éÏó·½·¨£¬ÔÙÓÃÒ»¸öÀàȥʵÏÖÕâ¸ö½Ó¿Ú£¬ÔÙ±àдһ¸ö²âÊÔÀàȥʹÓÃÕâ¸ö½Ó¿Ú¡£
Ê×ÏÈ£¬½Ó¿Ú±ØÐëµ¥ ......
1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·Òë³ÉΪÐéÄâ»ú¿ÉÒÔÖ´ÐеĴúÂë¡£Ò»¸öJava½âÊÍÆ÷×îÖÕÖ´ÐÐÕâЩ´úÂë¡£ÕâÆäÖÐûÓÐÁ¬½ÓµÄ¹ý³Ì£»½âÊÍÔÚÐèÒªµÄʱºò¶¯Ì¬µÄ¼ÓÔØһЩÀࣻ
2.JavaÊÇÍêÈ«ÃæÏò¶ÔÏóµÄ
JavaÊÇÒ»ÖÖÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ¡£ÕâÒâζ×ÅÄã¶ÔÈκÎÒ»¸öJava¶ÔÏóËù×öµÄ¶¯×÷¶¼ÊÇͨ¹ýÒ ......