javaºÍ.net»¥Ïàµ÷ÓÃwebservice×¢ÒâÊÂÏî
×îºóÔÚÑо¿GWT,ÐèÒªÓõ½.net µÄwebservice,ÍøÉÏËÑÁ˵ã´úÂë,»ù±¾ÉÏÎÊÌâ¶à¶à.
JavaÒªµ÷ÓÃ.netµÄwebserviceÊÇÐèÒªÒ»¸öaxisµÄ°üµÄ. ÐèÒªÏÂÔØ,È»ºóÒýÓÃ.
ÒýÓõÄʱºò,ÐèҪעÒâһЩСÎÊÌâ.
Java ¶Ë
public String ServiceLogon(String user, String pwd) throws ServiceException
{
String url="http://localhost/WebServices/Service.asmx";
Service service = new Service();
Call call = (Call)service.createCall();
//We have to figure our the namespace. The java doesn't know where is the namespace
call.setOperationName(new QName("http://localhost/WebServices/Service.asmx","Logon"));
call.addParameter(new QName("http://localhost/WebServices/Service.asmx","username"),XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter(new QName("http://localhost/WebServices/Service.asmx","password"),XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
String res = "";
try {
call.setTargetEndpointAddress(new URL("http://localhost/WebServices/Service.asmx"));
res = (String)call.invoke(new Object[]{user,pwd});
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
&n
Ïà¹ØÎĵµ£º
Ò»£¬ÍøÂç±à³ÌÖÐÁ½¸öÖ÷ÒªµÄÎÊÌâ
Ò»¸öÊÇÈçºÎ׼ȷµÄ¶¨Î»ÍøÂçÉÏһ̨»ò¶ą̀Ö÷»ú£¬ÁíÒ»¸ö¾ÍÊÇÕÒµ½Ö÷»úºóÈçºÎ¿É¿¿¸ßЧµÄ½øÐÐÊý¾Ý´«Êä¡£
ÔÚTCP/IPÐÒéÖÐIP²ãÖ÷Òª¸ºÔðÍøÂçÖ÷»úµÄ¶¨Î»£¬Êý¾Ý´«ÊäµÄ·ÓÉ£¬ÓÉIPµØÖ·¿ÉÒÔΨһµØÈ·¶¨InternetÉϵÄһ̨Ö÷»ú¡£
¶øTCP²ãÔòÌá¹©ÃæÏòÓ¦ÓõĿɿ¿µÄ»ò·Ç¿É¿¿µÄÊý¾Ý´«Êä»úÖÆ£¬ÕâÊÇÍøÂç±à³ÌµÄÖ÷Òª¶Ô ......
DOM³õ²½
DOMÊÇDocument Object ModelµÄËõд£¬¼´Îĵµ¶ÔÏóÄ£ÐÍ¡£Ç°ÃæËµ¹ý£¬XML½«Êý¾Ý×é֯Ϊһ¿ÅÊ÷£¬ËùÒÔDOM¾ÍÊǶÔÕâ¿ÅÊ÷µÄÒ»¸ö¶ÔÏóÃèÐð¡£Í¨Ë×µÄ˵£¬¾ÍÊÇͨ¹ý½âÎöXMLÎĵµ£¬ÎªXMLÎĵµÔÚÂß¼ÉϽ¨Á¢Ò»¸öÊ÷Ä£ÐÍ£¬Ê÷µÄ½ÚµãÊÇÒ»¸ö¸ö¶ÔÏó¡£ÎÒÃÇͨ¹ý´æÈ¡ÕâЩ¶ÔÏó¾ÍÄܹ»´æÈ¡XMLÎĵµµÄÄÚÈÝ¡£
ÏÂÃæÎÒÃÇÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£¬¿´¿´ÔÚDOMÖ ......
ÏÂÃæµÄÄÚÈÝ£¬ÎÒÃǽ«¸ü¶àµÄ¹Ø×¢DOM£¬ÎªDOM×÷Ò»¸ö½ÏΪÏêϸµÄ½âÎö£¬Ê¹ÎÒÃÇʹÓÃÆðÀ´¸üΪµÃÐÄÓ¦ÊÖ¡£
DOMÏê½â
1£®»ù±¾µÄDOM¶ÔÏó
DOMµÄ»ù±¾¶ÔÏóÓÐ5¸ö£ºDocument£¬Node£¬NodeList£¬ElementºÍAttr¡£ÏÂÃæ¾ÍÕâЩ¶ÔÏóµÄ¹¦ÄܺÍʵÏֵķ½·¨×÷Ò»¸ö´óÖµĽéÉÜ¡£
Document¶ÔÏó´ú±íÁËÕû¸öXMLµÄÎĵµ£¬ËùÓÐÆäËüµÄNode£¬¶¼ÒÔÒ»¶¨µÄ˳Ðò°üº ......
2£®DOMʵÀý
ÓÐÁËÉÏÃæµÄ½éÉÜ£¬ÏàÐÅÄã¶ÔDOMÀí½âµÄ¸ü¶àÁ˰ɡ£ÏÂÃæµÄÀý×Ó½«ÈÃÄã¶ÔDOM¸ü¼ÓÊìϤÆðÀ´¡£
ÏÈ˵˵Õâ¸öÀý×Óµ½µ×Òª×öµÄÊÇʲô°É£¬ÎÒÃÇÏ£ÍûÔÚÒ»¸öÃûΪlink.xmlÎļþÖб£´æÁËһЩURLµØÖ·£¬Í¨¹ýÒ»¸ö¼òµ¥µÄ³ÌÐò£¬ÎÒÃÇ¿ÉÒÔͨ¹ýDOM°ÑÕâЩURL¶Á³ö²¢ÏÔʾ³öÀ´£¬Ò²¿ÉÒÔ·´¹ýÀ´ÏòÕâ¸öXMLÎļþÖÐдÈë¼ÓÈëµÄURLµØÖ·¡£ºÜ¼òµ¥£¬È´ºÜÊµÓ ......
Ò»¡¢JSP_Ñ¡ÔñÌâ
1. ÒÔÏÂÑ¡ÏîÖв»ÊÇjspÒþʽ¶ÔÏóµÄÊÇ£º£¨ £©
A pageContext
B context
C application
D out
²Î¿¼´ð°¸£ºB
2. ÏÂÃæÄÄÒ»¸ö²»ÊÇJSP±¾ÉíÒѼÓÔØµÄ»ù±¾Àࣿ£¨ £©
A java.lang.*
B java.io.*
C javax.servlet.*
D javax.servlet.j ......