Webservic axis发布出错----找了好久都不知道哪错,求高手解答

时间:2021-09-16 14:45:18
我是看着这个做的http://hi.baidu.com/zzticzh/blog/item/b290b2386f36bdddd4622521.html。他的源代码我运行没问题。但是我把他的东西全复制过去出现404 未找到。
而且我的web.xml 报(唯一一个报错的地方)
cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'. One of '{"http://java.sun.com/xml/ns/
 javaee":servlet-class, "http://java.sun.com/xml/ns/javaee":jsp-file}' is expected.


web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<!-- Apache-Axis 配置开始 --> 
<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
</servlet> 

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<display-name>查看Services列表</display-name>
<url-pattern>/services/</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<display-name>Services地址</display-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>  
<!-- Apache-Axis 配置结束 -->


<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

server-config.wsdd
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="sendMultiRefs" value="true" />
<parameter name="disablePrettyXML" value="true" />
<parameter name="adminPassword" value="admin" />
<parameter name="attachments.Directory" value="./attachments" />
<parameter name="dotNetSoapEncFix" value="true" />
<parameter name="enableNamespacePrefixOptimization" value="false" />
<parameter name="sendXMLDeclaration" value="true" />
<parameter name="sendXsiTypes" value="true" />
<parameter name="attachments.implementation"
value="org.apache.axis.attachments.AttachmentsImpl" />
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="session" />
</handler>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="request" />
<parameter name="extension" value=".jwr" />
</handler>
</requestFlow>
</globalConfiguration>
<handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper" />
<handler name="LocalResponder"
type="java:org.apache.axis.transport.local.LocalResponder" />
<handler name="Authenticate"
type="java:org.apache.axis.handlers.SimpleAuthenticationHandler" />

<!-- 发布WebService  name:service名称  -->
<service name="SayHello" provider="java:RPC">
  <!-- 允许调用的方法 * 全部  -->
<parameter name="allowedMethods" value="*" />
<!-- WebService 对应的class  -->
<parameter name="className" value="com.WebService.server.SayHello" />
</service>
<!-- end  -->

<!--
<service name="AdminService" provider="java:MSG">
<parameter name="allowedMethods" value="AdminService" />
<parameter name="enableRemoteAdmin" value="false" />
<parameter name="className" value="org.apache.axis.utils.Admin" />
<namespace>http://xml.apache.org/axis/wsdd/</namespace>
</service>
  -->
<service name="Version" provider="java:RPC">
<parameter name="allowedMethods" value="getVersion" />
<parameter name="className" value="org.apache.axis.Version" />
</service>

<transport name="http">
<requestFlow>
<handler type="URLMapper" />
<handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler" />
</requestFlow>
<parameter name="qs:list"
value="org.apache.axis.transport.http.QSListHandler" />
<parameter name="qs:wsdl"
value="org.apache.axis.transport.http.QSWSDLHandler" />
<parameter name="qs.list"
value="org.apache.axis.transport.http.QSListHandler" />
<parameter name="qs.method"
value="org.apache.axis.transport.http.QSMethodHandler" />
<parameter name="qs:method"
value="org.apache.axis.transport.http.QSMethodHandler" />
<parameter name="qs.wsdl"
value="org.apache.axis.transport.http.QSWSDLHandler" />
</transport>
<transport name="local">
<responseFlow>
<handler type="LocalResponder" />
</responseFlow>
</transport>
</deployment>

3 个解决方案

#1


File &quot;/axis2-web/listSingleService.jsp&quot; not found

#2


我已经用XFire解决发不webservice的问题了,现又遇到一个问题。求解答。。。。
http://topic.csdn.net/u/20120507/23/20f7ae61-183d-47c6-97b4-c3383e3aee9b.html

#3


给分,版本问题真纠结

#1


File &quot;/axis2-web/listSingleService.jsp&quot; not found

#2


我已经用XFire解决发不webservice的问题了,现又遇到一个问题。求解答。。。。
http://topic.csdn.net/u/20120507/23/20f7ae61-183d-47c6-97b4-c3383e3aee9b.html

#3


给分,版本问题真纠结