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

javaÓë.netµÄweb serviceÏ໥µ÷ÓÃ

Ò»:¼ò½é
±¾ÎĽéÉÜÁËJavaÓë.NET¿ª·¢µÄWeb ServicesÏ໥µ÷Óõļ¼Êõ¡£±¾ÎÄ°üÀ¨Á½¸ö²¿·Ö£¬µÚÒ»²¿·Ö½éÉÜÁËÈçºÎÓÃ.NET×ö¿Í»§¶Ëµ÷ÓÃJavaдµÄWeb Services,µÚ¶þ²¿·Ö½éÉÜÁËÈçºÎÓÃJava×ö¿Í»§¶Ëµ÷ÓÃ.NET¿ª·¢µÄWeb Services¡£ ¡¡
¡¡
¶þ:ÏîÄ¿ÐèÒªµÄ¹¤¾ß¡¡¡¡
WindowsXP Professial(IIS)
¡¡ Eclipse3.1(ÒÑ×°ºÃTomcat axis)
¡¡¡¡VS.Net 2003
¡¡ ±¸×¢:ÏÂÔØ°²×°Tomcat5.5.16 ÒÔ¼° AxisµÄ¿ª·¢°ü£¬²¢×öÏàÓ¦ÅäÖ᣿´ÎÒǰһƬÎĵµ¡£
Èý:ÓÃ.NET×ö¿Í»§¶Ëµ÷ÓÃJavaдµÄWeb Services
1.Éú³ÉÒ»¸öJava Web Services
ʹÓÃEclipseÉú³ÉÒ»¸öWeb ServicesÊǷdz£¼òµ¥µÄ¡£Ð½¨Ò»¸öWeb¹¤³Ì£¬ÓÒ¼ü½¨Á¢Ò»¸öClass,ÃûΪHelloClient.java¡£´úÂëÈçÏÂ:
public class HelloClient
{
public String getName(String name)
{
return "Hello,"+name;
}
}
ÓÒ¼ü´ËÎļþÑ¡Ôñ"WebServices"-->"Create Web Service"¼´¿É²¿ÊðΪ±¾»úµÄÒ»¸öws¡£ÔÚIEä¯ÀÀÆ÷ÖÐÊäÈëhttp://localhost:8008/testWebService/services/HelloClient¿ÉÒÔ¿´µ½ÒѾ­²¿ÊðÁ˵ÄHelloClient·þÎñ¡£ÊäÈëhttp://localhost:8008/testWebService/services/HelloClient?wsdlÕâ¸ö·þÎñµÄÃèÊöÎļþ¡£
н¨Ò»¸öÏîÄ¿(WinForm,ASP.net¶¼¿ÉÒÔ)£¬ÎÒÔÚÕâÀïʹÓõÄÊÇÒ»¸öAsp.NetÏîÄ¿¡£ÔÚÆðʼҳÃæÉÏ·ÅÖÃÒ»¸öÎı¾ÊäÈë¿òÓÃÀ´ÊäÈ룬һ¸ö±êÇ©ÓÃÀ´ÏÔʾµ÷ÓÃWeb ServicesµÄ½á¹û£¬·ÅÖÃÒ»¸ö°´Å¥£¬ÓÃÀ´µ¥»÷µ÷ÓÃWeb Services¡£È»ºó£¬Ñ¡ÔñÌí¼ÓWeb ÒýÓã¬URLÒ»À¸ÀïÌîÈëhttp://localhost:8008/testWebService/services/HelloClient?wsdl£¬Web ÒýÓõÄÃû³ÆÊäÈëJavaWebService£¬µ¥»÷Ìí¼ÓÒýÓð´Å¥¾Í¿ÉÒÔÁË¡£´Ëʱ£¬ÎÒÃÇ¿ÉÒÔÔÚVS.net µÄSolution ExploreÖп´µ½Õâ¸öWeb ÒýÓá£
Ìí¼Ó´úÂëÈçÏÂ:
protected System.Web.UI.WebControls.TextBox txtName;
protected System.Web.UI.WebControls.Button btnSend;
protected System.Web.UI.WebControls.Label lblMsg;
private JavaWebService.HelloClientService ws;
private void Page_Load(object sender, System.EventArgs e)
{
// ÔÚ´Ë´¦·ÅÖÃÓû§´úÂëÒÔ³õʼ»¯Ò³Ãæ
ws=new testWebService.JavaWebService.HelloClientService();
}
private void btnSend_Click(object sender, System.EventArgs e)
{
lblMsg.Text=ws.getName(txtName.Text);
}
ÕâÑù£¬Ò»¸ö.NET¿Í»§


Ïà¹ØÎĵµ£º

Ìá¸ßjava¿ª·¢Ëٶȣ¨Eclipse¿ì½Ý¼üÓ¦Óã©

ÏëÔÚ¿ª·¢ÖÐÌá¸ßËٶȺÍЧÂÊ£¡²»ÄÜÍü¼ÇµÄEclipse¿ì½Ý¼ü
Eclipse¿ì½Ý¼ü´óÈ«
ÍƼöCtrl+1 ¿ìËÙÐÞ¸´(×î¾­µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³Ìù ......

JAVA(Ò»)

1£® ¹ØÓÚ¶¯Ì¬¼ÓÔØ»úÖÆ?? 
ѧϰJava±ÈC++¸üÈÝÒ×Àí½âOOPµÄ˼Ï룬±Ï¾¹C++»¹»ìºÏÁ˲»ÉÙÃæÏò¹ý³ÌµÄ³É·Ö¡£ºÜ¶àÈ˶¼Äܱ³³öÀ´JavaÓïÑÔµÄÌص㣬ËùνµÄ¶¯Ì¬¼ÓÔØ»úÖƵȵȡ£µ±È»¸ÅÄîÍùÍùÊÇÏȼÇס¶øºóÏû»¯µÄ£¬¿ÉÓжàÉÙÈËÕæÕýÈ¥Ìå»á¹ý¶¯Ì¬¼ÓÔصĻúÖÆ£¬ÊÔͼȥѰÕÒ¹ýÆäÖеÄϸ½ÚÄØ?   Ìṩ´ó¼ÒÒ»¸ö·½·¨£º 
ÔÚÃüÁîÐд°¿ ......

java rmi¼òµ¥Àý×Ó

----------½Ó¿Ú------------
import java.rmi.*;
public interface HelloIn extends java.rmi.Remote{
 String sayHello() throws RemoteException;
}
--------ʵÏÖÀà-------------
import java.rmi.*;
import java.net.*;
import java.rmi.registry.*;
import java.rmi.server.*;
public class Hello exten ......

JavaÖÐ×Ö·û´®ÓëASCIIÏ໥ת»»


import java.io.UnsupportedEncodingException;
public class T {
 public static void main(String[] args) throws UnsupportedEncodingException {
  t1();//ASCIIת»»Îª×Ö·û´®
  t2();//×Ö·û´®×ª»»ÎªASCIIÂë
 }
 public static void t1(){//ASCIIת»»Îª×Ö·û´®
   ......

JNBridge¿çÔ½JavaºÍ.Net´úÂë

ƾ½èJNBridge
¼¼Êõ£¬JavaºÍ.NET´úÂëÎÞÐè½»²æ±àÒë
Æ÷¾Í¿ÉÒÔʵÏÖ¶ÔÏó¹²Ïí¡£ËùÓÐJava´úÂëÔËÐÐÔÚJVMÉÏ£¬¶ø.NET´úÂëÔòÔËÐÐÔÚCLRÉÏ¡£Ôڸ÷½°¸Ï£¬JVMºÍCLR¿ÉÒÔÔËÐÐÔÚ²»Í¬µÄ»úÆ÷ÉÏ£¬Ò²¿ÉÒÔÔË
ÐÐÔÚһ̨»úÆ÷µÄ²»Í¬½ø³ÌÉÏ£¬ÉõÖÁ»¹ÄÜÔËÐÐÔÚÏàͬµÄ½ø³ÌÉÏ¡£´Ó¿ª·¢ÕߵĽǶÈÀ´¿´£¬ÔËÐÐÔÚÆäËûÐéÄâ»úÉϵĶÔÏó½ö½öÊÇ´úÀíµÄÔ¶³Ì¶ÔÏó¶øÒÑ¡£JN ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ