小弟新开发Eclipse插件,插件中需要调用jax-ws访问web service。我用MyEclipse6.5自动生成访问web service的客户端。通过代码
this.wslibDelegate = new WebServiceSearchService().getWebServiceSearchPort();
获得访问web service port的代理。我把界面程序独立运行为SWT程序或者Java程序时,一切都是正常的。但是当我通过下面代码将界面运行为Action插件的时候,就会阻塞在上面的代码地方.
public void run(IAction action) {
try {
WebServiceSearchLibUI wssearchUI = new WebServiceSearchLibUI();
wssearchUI.setDisplay(this.window.getShell().getDisplay());
this.window.getShell().getDisplay().syncExec(wssearchUI);
} catch (Exception e) {
e.printStackTrace();
}WebServiceSearchService().getWebServiceSearchPort()的代码如下:
@WebEndpoint(name = "WebServiceSearchPort")
public WebServiceSearchDelegate getWebServiceSearchPort() {
return super.getPort(new QName("http://pku.webservicesearch/",
"WebServiceSearchPort"), WebServiceSearchDelegate.class);
}小弟新开发Eclipse插件,还希望各位大侠指教。:)

解决方案 »

  1.   

    我已开发过9个myeclipse的插件开发。
    你所说的有web service port我不是很清楚。也不理解你要什么样的帮助。
    我用plugin-build.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="com.codestyle" default="build.update.jar" basedir=".">
    <property file="ant-build.properties" />
    <!-- Compiler settings. -->
    <property name="javacFailOnError" value="false"/>
    <property name="javacDebugInfo" value="on"/>
    <property name="javacVerbose" value="false"/>
    <property name="logExtension" value=".log"/>
    <property name="compilerArg" value=""/>
    <property name="javacSource" value="1.5"/>
    <property name="javacTarget" value="1.5"/>
    <condition property="dir_bootclasspath" value="${java.home}/../Classes">
    <os family="mac"/>
    </condition>
    <property name="dir_bootclasspath" value="${java.home}/lib"/>
    <path id="path_bootclasspath">
    <fileset dir="${dir_bootclasspath}">
    <include name="*.jar"/>
    </fileset>
    </path>
    <property name="bootclasspath" refid="path_bootclasspath"/>
    <property name="bundleJavacSource" value="${javacSource}"/>
    <property name="bundleJavacTarget" value="${javacTarget}"/>
    <property name="bundleBootClasspath" value="${bootclasspath}"/> <target name="init" depends="properties">
    <condition property="pluginTemp" value="${buildTempFolder}/plugins">
    <isset property="buildTempFolder"/>
    </condition>
    <property name="pluginTemp" value="${basedir}"/>
    <condition property="build.result.folder" value="${pluginTemp}/com.codestyle_1.0.0">
    <isset property="buildTempFolder"/>
    </condition>
    <property name="build.result.folder" value="${basedir}"/>
    <property name="temp.folder" value="${basedir}/temp.folder"/>
    <property name="plugin.destination" value="${basedir}"/>
    </target> <target name="properties" if="eclipse.running">
    <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> </target> <target name="build.update.jar" depends="init" description="Build the plug-in: com.codestyle for an update site.">
    <delete dir="${temp.folder}"/>
    <mkdir dir="${temp.folder}"/>
    <antcall target="clean"/>
    <antcall target="build.jars"/>
    <antcall target="gather.bin.parts">
    <param name="destination.temp.folder" value="${temp.folder}/"/>
    </antcall>
    <jar destfile="${plugin.destination}/comcodestyle_1.0.0.jar" basedir="${temp.folder}/com.nancodestyle_1.0.0" filesetmanifest="merge">
    <exclude name="ant-build.properties" />
    <exclude name="ant-build.xml" />
    <exclude name="plugin-build.xml" />
    <exclude name="export-build.xml" />
    </jar>
    <delete dir="${temp.folder}"/>
    </target> <target name="@dot" depends="init" unless="@dot" description="Create jar: com.codestyle @dot.">
    <delete dir="${temp.folder}/@dot.bin"/>
    <mkdir dir="${temp.folder}/@dot.bin"/>
    <path id="@dot.classpath">
    <pathelement path="${plugins.dir}/org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.equinox.app_1.0.1.R33x_v20070828.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.osgi.services_3.1.200.v20070605.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.swt_3.3.1.v3346j.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.swt.win32.win32.x86_3.3.1.v3346i.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.jface_3.3.1.M20070910-0800b.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.core.commands_3.3.0.I20070605-0010.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.ui.workbench_3.3.1.M20070921-1200.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.ui.workbench.compatibility_3.2.0.I20070319-0010/@dot"/>
    <pathelement path="${plugins.dir}/org.eclipse.ui.workbench.compatibility_3.2.0.I20070319-0010/compatibility.jar"/>
    <pathelement path="${plugins.dir}/com.ibm.icu_3.6.1.v20070906.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.help_3.3.1.v20070726_33x.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.core.expressions_3.3.0.v20070606-0010.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.jface.databinding_1.1.1.M20070910-0800b.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.core.databinding_1.0.1.M20070822-0800.jar"/>
    <pathelement path="${plugins.dir}/org.eclipse.core.resources_3.3.0.v20070604.jar"/> </path>
    <!-- compile the source code -->
    <!-- Copy necessary resources -->
    <copy todir="${temp.folder}/@dot.bin" failonerror="true" overwrite="false">
    <fileset dir="src/">
    <exclude name="**/*.java"/>
    <exclude name="**/package.htm*"/>
    </fileset>
    </copy>
    <mkdir dir="${build.result.folder}"/>
    <copy todir="${build.result.folder}/@dot" failonerror="true" overwrite="false">
    <fileset dir="${temp.folder}/@dot.bin">
    </fileset>
    </copy>
    <delete dir="${temp.folder}/@dot.bin"/>
    </target> <target name="build.jars" depends="init" description="Compile classes and build nested jars for the plug-in: com..codestyle.">
    <available property="@dot" file="${build.result.folder}/@dot"/>
    <antcall target="@dot"/>
    </target> <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
    <mkdir dir="${destination.temp.folder}/com.codestyle_1.0.0"/>
    <copy todir="${destination.temp.folder}/com.codestyle_1.0.0" failonerror="true" overwrite="false">
    <fileset dir="${build.result.folder}/@dot">
    <include name="**"/>
    </fileset>
    </copy>
    <copy todir="${destination.temp.folder}/com.codestyle_1.0.0" failonerror="true" overwrite="false">
    <fileset dir="${basedir}">
    <include name="plugin.xml"/>
    <include name="META-INF/"/>
    <include name="lib/checkstyle-all-4.4.jar"/>
    <include name="lib/checkstyle-optional-4.4.jar"/>
    </fileset>
    </copy>
    </target> <target name="clean" depends="init" description="Clean the plug-in: com.codestyle of all the zips, jars and logs created.">
    <delete dir="${build.result.folder}/@dot"/>
    <delete file="${plugin.destination}/com.codestyle_1.0.0.jar"/>
    <delete dir="${temp.folder}"/>
    </target></project>plugin.xml:
    [code=XML]<?xml version="1.0" encoding="UTF-8"?>
    <?eclipse version="3.2"?>
    <plugin>
       <extension
             id="CodeStyleChecker"
             name="代码规范检查"
             point="org.eclipse.core.resources.builders">
          <builder hasNature="false">
             <run
                   class="com.codestyle.CodeStyle">
             </run>
          </builder>
       </extension>
     
       <extension
             id="StyleError"
             name="StyleError"
             point="org.eclipse.core.resources.ers">
          <super
                type="org.eclipse.core.resources.problemer">
          </super>
          <persistent
                value="true">
          </persistent>
       </extension>
       <extension
             point="org.eclipse.ui.popupMenus">
          <objectContribution
                adaptable="true"
                objectClass="org.eclipse.core.resources.IProject"
                nameFilter="*"
                id="com.codestyle.contribution1">
             <action
                   label="添加/删除代码规范检查"
                   class="com.codestyle.ToggleStyleCheckAction"
                   menubarPath="additions"
                   enablesFor="999"
                   id="com.codestyle.addRemoveCodeStyleAction">
             </action>
          </objectContribution>
       </extension>
    </plugin>