Web services AXIS错误:此位置没有SOAP服务
注意:我找不到这个问题的直接答案,因此我将在下面记录我的解决方案作为答案 我使用Axis1.4和 axistools maven插件。Axis servlet映射到Web services AXIS错误:此位置没有SOAP服务,web-services,axis,Web Services,Axis,注意:我找不到这个问题的直接答案,因此我将在下面记录我的解决方案作为答案 我使用Axis1.4和 axistools maven插件。Axis servlet映射到/services/*,即 服务在WEB-INF/server config.wsdd中配置如下: <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java
/services/*
,即
服务在WEB-INF/server config.wsdd
中配置如下:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="TestService" style="document" use="literal">
<namespace>http://example.com/testservier</namespace>
<parameter name="className" value="com.example.TestServiceImpl"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="scope" value="Session"/>
</service>
</deployment>
http://example.com/testservier
当我将此web应用程序部署到Tomcat和access时
http://localhost:8080/testservice/services
已部署服务的列表如下
返回
现在。。。一些服务
- 测试服务(wsdl)
- 测试服务
wsdl
应返回此服务的描述,但会导致以下错误页面:
轴误差
无法生成WSDL
此位置没有SOAP服务
服务器配置.wsdd
缺少必要的配置设置
<transport name="http">
<requestFlow>
<handler type="java:org.apache.axis.handlers.http.URLMapper"/>
</requestFlow>
</transport>
似乎URLMapper
负责从中提取服务名称
如果没有url,axis不知道调用哪个服务。这有点
记录在:
这种机制之所以有效,是因为Axis中的HTTP传输在请求链上部署了URLMapper(org.apache.Axis.handlers.HTTP.URLMapper)处理程序。URLMapper获取传入URL,提取其最后一部分作为服务名称,并尝试在当前EngineConfiguration中按该名称查找服务
类似地,您可以通过SOAPAction HTTP头部署HTTPActionHandler进行调度。您还可以自由地以自己的自定义方式设置服务—例如,如果您有一个通过单个服务传输所有消息的传输,您可以在传输调用AxisEngine之前在MessageContext中设置该服务
这听起来好像默认情况下会配置
URLMapper
,但事实并非如此。您最好以“admin”为目标自动构建server-config.wsdd。请参阅有关此插件的文档:
手动生成server-config.wsdd非常困难
例如:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<filename>${project.artifactId}.wsdl</filename>
<namespace>http://server.ws.xxx</namespace>
<namespaceImpl>http://server.ws.xxx</namespaceImpl>
<classOfPortType>XXXWebService</classOfPortType>
<location>http://localhost:8080/XX/services/XXXWebService</location>
<bindingName>XXServiceSoapBinding</bindingName>
<style>WRAPPED</style>
<use>literal</use>
<inputFiles>
<inputFile>${basedir}\src\main\webapp\WEB-INF\xxxx\deploy.wsdd</inputFile>
<inputFile>${basedir}\src\main\webapp\WEB-INF\xxxx\deploy.wsdd</inputFile>
</inputFiles>
<isServerConfig>true</isServerConfig>
<extraClasses></extraClasses>
</configuration>
<executions>
<execution>
<goals>
<goal>java2wsdl</goal>
<goal>admin</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
org.codehaus.mojo
AxisToolsMaven插件
1.3
${project.artifactId}.wsdl
http://server.ws.xxx
http://server.ws.xxx
XXXWebService
http://localhost:8080/XX/services/XXXWebService
XXServiceSoapBinding
包裹
字面意义的
${basedir}\src\main\webapp\WEB-INF\xxxx\deploy.wsdd
${basedir}\src\main\webapp\WEB-INF\xxxx\deploy.wsdd
真的
java2wsdl
管理
轴
轴
1.3
我最近也遇到了同样的问题
解决方案:
在我的例子中,我使用的是Axis1.4,并在tomcat上部署应用程序。但是,由于某些原因,生成的server-config.wsdd没有在war中打包,因此没有部署到tomcat上。一旦我确定了这一点,它就开始对我起作用了。- 确保包中包含server-config.wsdd,可以将该文件放到参考资料中,也可以通过maven在pom.xml中设置包中包含哪些文件
- server-config.wsdd必须有效且标记正确,或者存在必要的配置,因此下面的行必须在其中李>
当我遇到这个问题时,是因为使用了错误的URL 我用了
http://localhost:8080/axis/services/AdminWebService?wsdl
而不是http://localhost:8080/axis/services/AdminService?wsdl
AdminWebService
必须更改为AdminService
Horstmann,但如何打开server-config.wsdd文件?我也有同样的问题。
<handler type="java:org.apache.axis.handlers.http.URLMapper" name="URLMapper"/>
<handler type="java:org.apache.axis.transport.local.LocalResponder" name="LocalResponder" />
<transport name="http">
<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:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler" />
<requestFlow>
<handler type="URLMapper" />
<handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler" />
</requestFlow>
</transport>
<transport name="local">
<responseFlow>
<handler type="LocalResponder" />
</responseFlow>
</transport>