ルートからns0を取り除くことができないようです。私は何が間違っているのですか?
インターセプター
@Override
public boolean handleFault(MessageContext messageContext, Object endpoint) {
SaajSoapMessage saajSoapMessage = (SaajSoapMessage) messageContext.getResponse();
SoapMessage soapMessage = (SoapMessage) messageContext.getResponse();
try {
SOAPMessage saajMessage = saajSoapMessage.getSaajMessage();
saajMessage.getSOAPPart().getEnvelope().setPrefix("soapenv");
saajMessage.getSOAPPart().getEnvelope().removeNamespaceDeclaration("SOAP-ENV");
saajMessage.getSOAPPart().getEnvelope().addNamespaceDeclaration("ims", "http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p");
saajMessage.getSOAPHeader().setPrefix("soapenv");
saajMessage.getSOAPBody().setPrefix("soapenv");
saajMessage.saveChanges();
} catch (SOAPException e) {
e.printStackTrace();
}
正しい
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ims="http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p0">
正しくない
<soapenv:Envelope ns0:ims="ims" xmlns:ns0="http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">