JAX-WS client with AXIS server; missing namespace in response

JAX-WS client with AXIS server; missing namespace in response

坏尐絯 发布于 2021-11-28 字数 1151 浏览 889 回复 1 原文

I'm having a problem related to JAX-WS and AXIS. JAX-WS (2.1.7) as a client, Axis (1.4.x) as server.

Everything works OK, but the response can't be read to Java.

Response:

<?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>

The problem is that if ns1:-namespace declaration is removed from myserviceReturn, JAX-WS is able to return anything else than null.

Does anyone have a clue how to force JAX-WS to ignore namespaces, how to modify SOAP response manually to exclude "ns1", or other ideas for this kind of problem?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

已下线请稍等 2022-06-07 1 楼

You need to write a custom WSDL file that does not include the name space. This file goes in the META-INF directory. You can start with the default one that your app has now, then save it here.