CXF不会将“urn:”添加到XML标记

时间:2013-11-15 17:07:40

标签: xml soap cxf

我正在使用CXF创建SOAP客户端和SoapUI来测试它。我发现CXF没有正确创建XML标记。 SOAP请求应该如下所示:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WS_Incid">
<SOAP-ENV:Body>
<urn:GetFirstDate>
<urn:id_enterprise>XXXX</urn:id_enterprise>
</urn:GetFirstDate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

但我检查过wireshark并收到:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetFirstDate xmlns="urn:WS_Incid">
<id_enterprise>XXX</id_enterprise>
</GetFirstDate>
</soap:Body>
</soap:Envelope>

由于CXF不在XML标记中发送“urn:”,SoapUI似乎无法解析它。

我该如何解决这个问题?

感谢。

1 个答案:

答案 0 :(得分:0)

最后我找到了解决方法:我必须使用“ns1”作为命名空间

def argid = holder.getNodeValue("//ns1:id_enterprise")