使用Java在输入Spring WS-SOAP的XML标记的所有字段中强制使用前缀
我正在使用SpringSOAP,它会自动为我的SOAP web服务生成WSDL 我的问题是,当我使用WSDL时,SOAP UI生成了以下输入:使用Java在输入Spring WS-SOAP的XML标记的所有字段中强制使用前缀,java,xml,web-services,soap,wsdl,Java,Xml,Web Services,Soap,Wsdl,我正在使用SpringSOAP,它会自动为我的SOAP web服务生成WSDL 我的问题是,当我使用WSDL时,SOAP UI生成了以下输入: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.servicename.test/"> <soapenv:Header/> <soapenv:Body> &
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.servicename.test/">
<soapenv:Header/>
<soapenv:Body>
<ser:serviceName>
<InputParameters>
<service>
<id>0</id>
</service>
</InputParameters>
</ser:serviceName>
</soapenv:Body>
0
但我需要这样的东西:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.servicename.test/">
<soapenv:Header/>
<soapenv:Body>
<ser:serviceName>
<ser:InputParameters>
<ser:service>
<ser:id>0</ser:id>
</ser:service>
</ser:InputParameters>
</ser:serviceName>
</soapenv:Body>
0
如何将前缀“ser:”添加到所有标记中?您是如何生成WSDL的?您是否创建了请求和响应模式(.xsd)?我在Java类中使用注释,如@xmlement(name=“service”,nillable=true)。。。等等希望这个链接能帮助你。