我用的不是jboss server
我使用的环境是这样的:linux + jdk + tomcat + axis
我要部署一个写好的class,这个class中提供一个方法search(String str),这个方法返回一个Element对象;
这个方法被调用的时候没有任何问题,但是要使用
http://xx.xx.xx.xx:8080/axis/services/SearchService?wsdl来或的wsdl文件时却会出现我前面说到的问题。即:
WSDLException: faultCode=OTHER_ERROR: Can't find prefix for '
http://dom.w3c.org'. Namespace prefixes must be set on the Definition object using the addNamespace(...) method.:
AxisFault
faultCode: {
http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: WSDLException: faultCode=OTHER_ERROR: Can't find prefix for '
http://dom.w3c.org'. Namespace prefixes must be set on the Definition object using the addNamespace(...) method.:
。。。
我的deploy.wsdd是这样的:
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:ns="http://ccert.edu.cn/whoisservice"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:w3cdom="http://dom.w3c.org">
<service name="SearchService" provider="java:RPC">
<parameter name="className" value="search/SearchService"/>
<parameter name="allowedMethods" value="search"/>
<typeMapping
qname="w3cdom:Element"
type="java:org.w3c.dom.Element"
serializer="org.apache.axis.encoding.ser.ElementSerializerFactory"
deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
</service>
</deployment>
问题出在哪里呢?在google上查了一下,发现这似乎是一个FAQ,但是没有找到任何答案
请大家帮忙看看想一想
多谢了
【 在 sungsung (小李匪盗) 的大作中提到: 】
: 你是不是用的jboss server?
: 你到server console窗口看看出错信息
: 没猜错的话应该是你的某个bean类少了不设参数的构造器,导致不能自动生成wsdl文件
--
FROM 202.112.50.*