首页 > 解决方案 > 如何更改 JAXB 消息中的模式?

问题描述

我发送 JAXB 生成的消息(使用 WSDL 和 XSD):

   ...
   <SOAP-ENV:Body>
      <ns28:getClientsDetailRequest ...>
         <ns28:ClientIdentifier>
            <ns12:id>123</ns12:id>
            <ns12:system>qwe</ns12:system>
            <ns12:type>asd</ns12:type>
         </ns28:ClientIdentifier>
         <ns28:entitySet>zxc</ns28:entitySet>
         <ns28:clientScope>rty</ns28:clientScope>
      </ns28:getClientsDetailRequest>
   </SOAP-ENV:Body>
   ...

但方案应该是“tns”和“idn”,像这样:

   ....
    <SOAP-ENV:Body>
        <tns:getClientsDetailRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <tns:ClientIdentifier>
            <idn:id>123</idn:id>
            <idn:system>qwe</idn:system>
            <idn:type>asd</idn:type>
        </tns:ClientIdentifier>
        <tns:entitySet>zxc</tns:entitySet>
        <tns:clientScope>rty</tns:clientScope>
    </tns:getClientsDetailRequest>
    </SOAP-ENV:Body>
    ...

如何更改方案?

标签: javaxmlspringjaxb

解决方案


推荐阅读