【问题标题】:JAX-WS client with AXIS server; missing namespace in response带有 AXIS 服务器的 JAX-WS 客户端;响应中缺少命名空间
【发布时间】:2009-04-27 13:02:24
【问题描述】:

我遇到了与 JAX-WS 和 AXIS 相关的问题。 JAX-WS (2.1.7) 作为客户端,Axis (1.4.x) 作为服务器。

一切正常,但无法将响应读取到 Java。

回复:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
  <ns1:myserviceResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://my/service">
   <ns1:myserviceReturn xsi:type="xsd:string">responsestring</ns1:myserviceReturn>
  </ns1:myserviceResponse>
 </soapenv:Body>
</soapenv:Envelope>

问题在于,如果从 myserviceReturn 中删除 ns1:-namespace 声明,JAX-WS 就能够返回 null 以外的任何内容。

有没有人知道如何强制 JAX-WS 忽略命名空间,如何手动修改 SOAP 响应以排除“ns1”,或针对此类问题的其他想法?

【问题讨论】:

    标签: java web-services jax-ws axis


    【解决方案1】:

    您需要编写一个不包含名称空间的自定义 WSDL 文件。该文件位于 META-INF 目录中。您可以从您的应用现在拥有的默认设置开始,然后将其保存在此处。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-05
      • 2012-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多