EclipseÏÂʹÓÃAxis¿ª·¢webservice
2010Äê01ÔÂ21ÈÕ
¡¡¡¡
1. ½«axisϵÄserver-config.wsdd¿½±´µ½myeclipseµÄweb projectµÄWEB-INFÏ¡£
¡¡¡¡2. µ¼ÈëµÚÈý·½°üµ½¹¤³ÌϵÄlibĿ¼
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡1.2. É趨servlet¿ØÖÆÆ÷ÐÞ¸ÄWEB-INFϵÄweb.xmlÎļþ£¬Ìí¼ÓÒÔÏÂÄÚÈÝ£º
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡org.apache.axis.transport.http.AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ SOAPMonitorService
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡org.apache.axis.monitor.SOAPMonitorService
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ SOAPMonitorPort
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ 5001
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ 100
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ /servlet/AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ *.jws
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ /services/*
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ AxisServlet
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ /ws/*
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ SOAPMonitorService
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ /SOAPMonitor
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ wsdl
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ text/xml
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ xsd
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ text/xml
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡1.3. Ìí¼ÓÒª·¢²¼µÄ·þÎñÌí¼ÓÒª·¢²¼µÄ·þÎñµ½server-config.wsdd¡£È磺
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡ com.xxxxx.ws
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
¡¡¡¡1.4. ʹÓÃjava2wsdlÉú³ÉwsdlÓÃaxisµÄjava2wsdlÀàÀ´Éú³ÉwsServerTest.wsdl£º
¡¡¡¡Ñ¡ÔñÏîÄ¿£¬Ñ¡Ôñ»òÕßÌîÈëmainº¯Êýorg.apache.axis.wsdl.Java2WSDL
¡¡¡¡ÔÚrunµÄ³ÌÐò²ÎÊýÉèÖÃΪ£º
¡¡¡¡-o wsServerTest.wsdl
¡¡¡¡-l "http://localhost:8080/myproject/services/wsServerTest"
¡¡¡¡-n "urn:wsServerTest"
¡¡¡¡-p"com.xxxxx.ws.server" "urn:wsServerTest"
¡¡¡¡com.xxxxx.ws.server.ServerTestFacade
¡¡¡¡1.5. ʹÓÃwsdl2javaÉú³ÉstubÓÃaxisµÄwsdl2javaÀ´Éú³Éstub£º
¡¡¡¡Ñ¡ÔñÏîÄ¿£¬Ñ¡Ôñ»òÕßÌîÈëmainº¯Êýorg.apache.axis.wsdl.WSDL2Java
¡¡¡¡ÔÚrunµÄ³ÌÐò²ÎÊýÉèÖÃΪ£º
¡¡¡¡D:\program\Eclipse3.2\wsSeverTest\wsServerTest.wsdl -t -p com.xxxxx.ws.client
¡¡¡¡1.6. ¿Í»§¶Ë²âÊÔÈç¹ûÊǰ²È«Í¨µÀ£¬½«client.keystoreºÍclient.truststore·Åµ½wsClientTest¹¤³ÌÏ¡£ÔÚvm ²ÎÊýÉ趨£º
¡¡¡¡-Djavax.net.ssl.keyStore=D:\program\Eclipse3.2\wsClientTest\client.keystore
¡¡¡¡-Djavax.net.ssl.keyStorePassword=changeit
¡¡¡¡-Djavax.net.ssl.trustStore=D:\program\Eclipse3.2\wsClientTest\client.truststore
¡¡¡¡½«url¸ÄΪhttps:localhost:8443/myproject/services/wsServerTestÀ´µ÷Ó÷¢²¼µÄº¯Êý¡£
¡¡¡¡***********************************************************************
¡¡¡¡File->New->Project->Plug-in developmentµÄPlug-in project->Next£¬ÌîдProjectÃû,Next, ÌîдÄÚÈÝ£¬Next£¬Ñ¡ÔñCreate plug-in using one of the templates£¬Ñ¡ÔñHello£¬World£¬Finish¡£
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ÔÚÊÓͼ¿É¿´µ½plugin.xml,ÔÚÀï¼ÓÉÏÔËÐе÷ÓÃWeb ServiceËùÐèjar°ü¡£ÄÚÈÝÈçÏ£º
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ ¡¡¡¡
¡¡¡¡¡¡¡¡id="colimas_plugin"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡name="Colimas_plugin Plug-in"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡version="1.0.0"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡provider-name="nova"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡class="colimas_plugin.Colimas_pluginPlugin">
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ ¡¡¡¡
¡¡¡¡¡¡¡¡point="org.eclipse.ui.actionSets">
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡label="Sample Action Set"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡visible="true"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡id="colimas_plugin.actionSet">
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ ¡¡¡¡
¡¡¡¡¡¡¡¡label="Sample &Menu"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡id="sampleMenu">
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ ¡¡¡¡
¡¡¡¡¡¡¡¡name="sampleGroup">
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡label="&Sample Action"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡icon="icons/sample.gif"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡class="colimas_plugin.actions.SampleAction"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡tooltip="Hello, Eclipse world"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡menubarPath="sampleMenu/sampleGroup"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡toolbarPath="sampleGroup"
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡id="colimas_plugin.actions.SampleAction">
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡2 ½¨Á¢µ÷ÓÃWeb ServiceÀ࣬¸ÃÀàʵÏÖµ÷ÓÃAxisµÄWebService
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/*
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡Created on 2005/07/30
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* TODO To change the template for this generated file go to
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* Window - Preferences - Java - Code Style - Code Templates
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/package com.nova.colimas.plugin.eclipse;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import org.apache.axis.client.Call;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import org.apache.axis.client.Service;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import javax.xml.namespace.QName;import java.io.*;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*@author tyrone
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* TODO To change the template for this generated type comment go to
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* Window - Preferences - Java - Code Style - Code Templates
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡public class SendFileClient {¡¡private Call call;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* The constructor.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡public SendFileClient() {
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡try{
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡Service¡¡service=
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡new Service();
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡call¡¡¡¡= (Call) service.createCall();
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡}catch(Exception ex){¡¡ System.out.println(ex.getMessage());
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡} } public void saveFile(){¡¡try {¡¡ String endpoint =¡¡¡¡"http://localhost:8080/axis/services/DocumentFileManagement";
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡System.out.println("start web service");
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡call.setTargetEndpointAddress( new java.net.URL(endpoint) );
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡call.setOperationName(new QName("http://soapinterop.org/", "saveFile"));
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡File fp=new File("D:\\MyProject\\colimas\\colimas_plugin\\lib\\mail.jar");
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡BufferedInputStream in=new BufferedInputStream(new FileInputStream(fp));
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡int len=in.available();
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡byte[] contents=new byte[len];
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡in.read(contents,0,len);
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡System.out.println("begin run");
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡//¿ªÊ¼µ÷ÓÃWeb Service£ºDocumentFileManagementµÄsaveFile·½·¨
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡String ret = (String) call.invoke( new Object[] {fp.getName(),contents} );
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡in.close();
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡} catch (Exception e) {¡¡ System.err.println("error"+e.toString());
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡}
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡}
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡}
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡3 ÐÞ¸ÄActionÀàµÄrun·½·¨
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ActionÀàµÄrun·½·¨ÀïµÄÄÚÈÝÊÇEclipse²å¼þÕæÕýÒª×öµ½ÊÂ
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡package colimas_plugin.actions;import org.eclipse.jface.action.IAction;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import org.eclipse.jface.viewers.ISelection;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import org.eclipse.ui.IWorkbenchWindow;import org.eclipse.ui.IWorkbenchWindowActionDelegate;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import org.eclipse.jface.dialogs.MessageDialog;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡import com.nova.colimas.plugin.eclipse.*;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* Our sample action implements workbench action delegate.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* The action proxy will be created by the workbench and
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* shown in the UI. When the user tries to use the action,
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* this delegate will be created and execution will be
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* delegated to it. * @see IWorkbenchWindowActionDelegate
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/public class SampleAction implements IWorkbenchWindowActionDelegate { private IWorkbenchWindow window;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* The constructor.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/ public SampleAction() { }
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* The action has been activated. The argument of the
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* method represents the 'real' action sitting
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* in the workbench UI.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* @see IWorkbenchWindowActionDelegate#run
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/ public void run(IAction action) {¡¡SendFileClient client=new SendFileClient();
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡client.saveFile();
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡MessageDialog.openInformation(¡¡¡¡window.getShell(),
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡"Colimas_plugin Plug-in",¡¡¡¡"Colimas Connected");
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡} /**¡¡* Selection in the workbench has been changed. We
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* can change the state of the 'real' action here
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* if we want, but this can only happen after
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* the delegate has been created.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* @see IWorkbenchWindowActionDelegate#selectionChanged
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/ public void selectionChanged(IAction action, ISelection selection) { }
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* We can use this method to dispose of any system
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* resources we previously allocated.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* @see IWorkbenchWindowActionDelegate#dispose
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/ public void dispose() { }
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡/**
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* We will cache window object in order to
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* be able to provide parent shell for the message dialog.
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡* @see IWorkbenchWindowActionDelegate#init
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡*/ public void init(IWorkbenchWindow window) {¡¡this.window = window;
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡}
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡4 µ÷ÊÔ
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡Ê×ÏÈÆô¶¯Axis·þÎñÆ÷£¬È»ºóÑ¡ÔñEclipseµÄRun²Ëµ¥µÄRun As -¡µRun time workbench¡£
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡ÕâÑù»áÆô¶¯ÁíÒ»¸öEclipse workbench£¬ÔÚÕâ¸öworkbenchÀïÄã»á¿´µ½toolbarÀïÐÂÔöÁËÒ»¸ö°´Å¥£¬
¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡µã»÷°´Å¥¾Í»áµ÷ÓÃWebservice²¢·µ»Ø¿ØÖÆÌ¨½á¹û¡£
¡¡¡¡9***************************************************************