关于web service 接口头部验证问题
我使用SOAPHeaderElement 添加头部验证信息, 但是添加后的xml格式自带属性,怎么才能删掉这些自带的属性
比如我添加完的头部信息是:
<wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><wsse:UsernameToken xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsse="http://siebel.com/">
<wsse:Username xsi:type="xsd:string" xmlns:wsse="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">FENGJX</wsse:Username>
<wsse:Password xsi:type="xsd:string" xmlns:wsse="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">FENGJX</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
怎么样可以变成:
<wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><wsse:UsernameToken xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<wsse:Username>FENGJX</wsse:Username>
<wsse:Password>FENGJX</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
将username和password标签自带的属性删除 试过removeAttribute() 但是删不掉