因为需要写一个WS的服务端程序,用来接收消息,而且对方文档和wsdl文件都是使用axis 1.x版本做的,所以只能使用axis1.4来做了,官方网站上只有axis1.4可以下载了。

axis1.4的配置倒是很简单,网上也有很多资料,这里就不重复了。

参考资料如:http://www.cnblogs.com/qqzy168/p/3372330.html

axis1.4部署好了,默认情况下,SOAPMonitor是关闭的,如果要打开,需要如下步骤:

1、查找SOAPMonitorApplet.java程序,编译它,并将生成的class文件放到webapps\axis目录下,这里假定WEB根目录为webapps,axis为部署目录,访问SOAPMonitor的目录为:http://localhost:8080/axis/SOAPMonitor

2、不知道是不是因为我下载的axis1.4包的问题,在使用appletviewer http://localhost:8080/axis/SOAPMonitor运行小程序时,会报错,如下:

HTML 解析: 宽度/高度属性的值不正确

java.lang.NumberFormatException: For input string: "100%"

所以我又上官网[http://www.eu.apache.org/dist/axis/axis/java/1.4/]下载了源码,修改了org.apache.axis.monitor.SOAPMonitorService的167行:

response.getWriter().println("<embed type=\"application/x-java-applet;version=1.3\" code=SOAPMonitorApplet.class width=100% height=100% port=\""+port+"\" scriptable=false pluginspage=\"http://java.sun.com/products/plugin/1.3/plugin-install.html\">");

修改成如下:

response.getWriter().println("<embed type=\"application/x-java-applet;version=1.3\" code=SOAPMonitorApplet.class width=800 height=600 port=\""+port+"\" scriptable=false pluginspage=\"http://java.sun.com/products/plugin/1.3/plugin-install.html\">");

3、将生成的3个class文件替换原来的axis.jar里org.apache.axis.monitor目录下相应文件

4、按照其他网友文章部署后,即可访问了,参考资料如下:

http://m.blog.csdn.net/blog/chong232/3992004

如果按照这个的话,在客户端调用时会报错:

faultString: org.apache.axis.ConfigurationException: Can't find handler name:'null' type:'soapmonitor' in the registry

需要修改server-config.wsdd文件,加上两段:

<handler name="soapmonitor"   type="java:org.apache.axis.handlers.SOAPMonitorHandler">
        
<parameter name="wsdlURL"   value="/axis/SOAPMonitorService-impl.wsdl"/>
        
<parameter name="namespace"   value="http://tempuri.org/wsdl/2001/12/SOAPMonitorService-impl.wsdl"/>
        
<parameter name="serviceName" value="SOAPMonitorService"/>
        
<parameter name="portName" value="Demo"/>
      
</handler>

<service name="SOAPMonitorService" provider="java:RPC">
        
<parameter name="allowedMethods" value="publishMessage"/>
        
<parameter name="className"   value="org.apache.axis.monitor.SOAPMonitorService"/>
        
<parameter name="scope" value="Application"/>
      
</service>

可结合如下资料进行修改解决:

http://www.blogjava.net/RongHao/archive/2007/06/12/123635.html

5、刚开始我也是按照第4条,网上大部分的资料那样来安装,后来发现不行,所以一步一步去解决,终于出现了applet界面,现在记录下来,作为记忆以备下次再用,也希望对遇到同样问题的人有帮助。