Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA WebServiceʵÀý

Ò»¡¢Axis°²×° 1¡¢»·¾³ J2SE SDK 1.5 or 1.6: ÎÒʹÓà 1.6 Servlet Container: ÎÒʹÓõÄTomcat 6.0
2¡¢µ½ http://ws.apache.org/Axis/ÍøÕ¾ÏÂÔØAxis°²×°°ü
3¡¢ÏÈÔÚeclipseÏÂн¨web projectΪWebServiceDemo.ÔÚTomcatµÄÅäÖÃxmlÅäÖÃÉÏ£º<Context path="/webservice" docBase="D:\workspace\WebServiceDemo\WebRoot"/>.½âѹÏÂÔصÄaxis°²×°°ü£¬½«webapps\axisϵÄlibÎļþ¼ÐºÍweb.xmlÎļþ¿½µ½¹¤³Ì¶ÔӦĿ¼
4¡¢Æô¶¯tomcat,·ÃÎÊhttp://localhost/webservice¼ì²é°²×°ÊÇ·ñ³É¹¦£¬ÎҵĶ˿ÚÉèÖÃΪ80£¬Ò³Ãæindex.html×Ô¶¯Ìøתºó³ö´í£¬ÊÇÒòΪû°ÑÀ࿽È룬ÏȲ»¹Ü¡£
5¡¢ÒÔÉϲ½ÖèÖ´Ðгɹ¦£¬¿ÉÒÔ¿ª·¢webserviceÀý×ÓÁË
AxisÖ§³ÖÈýÖÖweb serviceµÄ²¿ÊðºÍ¿ª·¢£¬·Ö±ðΪ£º
1¡¢Dynamic Invocation Interface ( DII)
2¡¢Stubs·½Ê½
3¡¢Dynamic Proxy·½Ê½
¶þ¡¢±àдDII(Dynamic Invocation Interface )·½Ê½web·þÎñ
1.н¨°ücom.qdl.server,±àд·þÎñ¶Ë³ÌÐòSayHello
package com.qdl.server;
public class SayHello
{
public String getName(String name)
{
return "hello "+name;
}
}

2¡¢½«Ô´Â뿽±´µ½WebRootÏ£¬ÖØÃüÃûΪ SayHello.jws (×¢Òâ²»Óÿ½ÉÏÃæµÄpackage ...ÐÐ)
3¡¢·ÃÎÊÁ¬½Óhttp://localhost/webservice/SayHello.jws?wsdl£¬Ò³ÃæÏÔʾAxis×Ô¶¯Éú³ÉµÄwsdl£¬Í¬Ê±»áÔÚWEB-INFÏ´´½¨jwsClassesÎļþ¼Ð£¬ÔÚ´ËÉú³ÉSayHello.classÎļþ
4¡¢Ð½¨°ücom.qdl.client,±àд·ÃÎÊ·þÎñµÄ¿Í»§¶Ë SayHelloClient.java
import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class SayHelloClient {
public static void main(String[] args){
//³ÌÐò·ÃÎʼ´Ê±·¢²¼µÄ·þÎñ
try{
//´´½¨·ÃÎʵã
String endpoint = "http://localhost/webservice/SayHello.jws";
//´´½¨service
Service service = new Service();
Call call = null;
//´´½¨call
call = (Call) service.createCall();
//ÉèÖòÙ×÷Ãû
call.setOperationName(new QName("http://localhost/webservice/SayHello.jws","getName"));
//ÉèÖ÷ÃÎʵã
call.setTargetEndpointAddress(new java.net.URL(endpoint));
//µ÷Ó÷þÎñ£¬·µ»ØÖµ
String ret = (String) call.invoke(new Object[]{"zhangsan"});
System.out.println("·µ»ØµÄ


Ïà¹ØÎĵµ£º

javaÊý¾Ý½á¹¹Ö®É¢Áм¯HashSetÓëÉ¢ÁбíHashtable

1.É¢Áм¯HashSet
     HashSetÀàÔÚjava.util°üÖÐ
     A.¹¹Ôì·½·¨£ºHashSet()
     B.³£Ó÷½·¨
          public boolean add(Object o)£ºÏò¼¯ºÏÖÐÌí¼ÓÖ¸¶¨ÔªËØo
      &nb ......

ÈçºÎ ʹÓà java ²Ù×Ý XML Îļþ


Introduction to XML and XML With Java  
 
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......

JAVA±íµ¥×Ô¶¨ÒåµÄÉèÏëÓëºÃ´¦

˵µ½OAϵͳ¾Í»áÏëµ½·¢²¼¹«¸æ¡¢ÉóÅúÎļþ¡¢Îļþ¹ÜÀíµÈµÈÕâЩ¹¦ÄÜ£¬£¬µ½ÁË¿ª·¢ÈËÔ±ÊÖÀï¾ÍÊÇ´æ´¢Êý¾Ý¡¢²éѯÊý¾Ý£¬ÍùÍù²»Í£µÄ×öÖظ´¹¤×÷£¬ÓÚÊǾÍÓÐÁËOA±íµ¥ÒýÇæµÄÉèÏëºÍ¹¹Ë¼¡£ÓÃjavascript¶¨Òå±íµ¥£¬ÓÃjavaÇý¶¯XML£¬×Ô¶¯´´½¨¡¢ÐÞ¸ÄÊý¾Ý¿â¡£ÊµÏÖ¶Ô±íµ¥µÄͼÐλ¯ÖÆ×÷£¬¼´Ê¹ÊǷǼ¼ÊõÈËÔ±Ò²¿ÉËæÒâÉè¼Æ³ö×Ô¼º¹¹ÏëµÄ±íµ¥¹¦ÄÜ¡£
JAVA³ÌÐ ......

Java×ÔѧС½á——2

×î½üÓ¦ÀÏʦµÄÒªÇó¿´ÁËÊý¾Ý¿â¡£ÔÚÍøÉÏÕÒÁËÊÓƵ£¬ÊǸö½ÌÓý»ú¹¹·¢µÄ¡£ÄǸöÊÓƵ¿´µÃÎÒÖ±·¸À§£¬³ýÁËÀÏʦ½²¿Î½²´íµÄʱºò¡£
ÊÓƵ½²µÃºÜdzÏÔ£¬µÚÒ»Õ½²ÁËsqlÊý¾Ý¿â½á¹¹£¬ÓÐʲôģÐÍ¡£½Ó׎²Ö÷¼ü£¬Íâ¼ü£¬È»ºóÊǽ¨±íÓï¾ä£¬²éѯÓï¾äµÈµÈ¡£
show databases ÏÔʾÊý¾Ý¿â¡£
use ** ʹÓÃÊý¾Ý¿â¡£
create table ** (**,**,**) ½¨±í¡£
se ......

Object Ordering java ÅÅÐò

Object Ordering
A List l may be sorted as follows.
Collections.sort(l);
If the List consists of String elements, it will be sorted into alphabetical order. If it consists of Date elements, it will be sorted into chronological order. How does this happen? String and Date both implement the Compara ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ