web-services - Axis 错误 : There is no SOAP service at this location

标签 web-services axis

注:我找不到这个问题的直接答案,所以我将在下面记录我的解决方案作为答案。

我使用 Axis 1.4 从 wsdl 生成了 webservice 的服务器端部分axistools-maven-plugin . 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">
    <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>

当我将此 Web 应用程序部署到 Tomcat 并访问时http://localhost:8080/testservice/services部署的服务列表是
回来。

And now... Some Services

  • TestService (wsdl)
    • TestService


点击 wsdl应该返回此服务的描述,但会导致以下错误页面:

AXIS error

Could not generate WSDL!

There is no SOAP service at this location

最佳答案

server-config.wsdd缺少必要的配置设置。

<transport name="http">
    <requestFlow>
        <handler type="java:org.apache.axis.handlers.http.URLMapper"/>
    </requestFlow>
</transport>

看来URLMapper负责从中提取服务名称
url,没有它, Axis 不知道要调用哪个服务。这是一种
记录在 axis faq 中:

This mechanism works because the HTTP transport in Axis has the URLMapper (org.apache.axis.handlers.http.URLMapper) Handler deployed on the request chain. The URLMapper takes the incoming URL, extracts the last part of it as the service name, and attempts to look up a service by that name in the current EngineConfiguration.

Similarly you could deploy the HTTPActionHandler to dispatch via the SOAPAction HTTP header. You can also feel free to set the service in your own custom way - for instance, if you have a transport which funnels all messages through a single service, you can just set the service in the MessageContext before your transport calls the AxisEngine



这使它听起来像 URLMapper默认情况下会配置,但情况似乎并非如此。

关于web-services - Axis 错误 : There is no SOAP service at this location,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8804717/

相关文章:

java - 连接 RPC SOAP 服务的确切 url 是什么

java - 如何从 axis1 stub 获取传输的响应 header

java - 通过 netbeans 在 Java Web 服务中获取方法?

web-services - RESTFful/面向资源的设计

c# - 如何从 html 页面后面的代码中读取值?或者有更好的方法吗?

python - matplotlib 如何开始刻度从 Axis 原点留下空间

python - pandas any 中 Axis 的定义

java - 发送对象而不是数组时,我无法捕获ProcessingException

java - 获取 CXF 错误 : javax. xml.ws.WebServiceException:WSDL 元数据无法用于创建代理

java - <service-name>SoapBindingImpl.java 文件的作用是什么