0

ルートから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/">
4

1 に答える 1

0

注文を更新してこれを修正しました

try {
            SOAPMessage saajMessage = saajSoapMessage.getSaajMessage();

            saajMessage.getSOAPPart().getEnvelope().removeNamespaceDeclaration("SOAP-ENV");
            saajMessage.getSOAPPart().getEnvelope().addNamespaceDeclaration("ims", "http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p");
            saajMessage.getSOAPPart().getEnvelope().setPrefix("soapenv");
            saajMessage.getSOAPHeader().setPrefix("soapenv");
            saajMessage.getSOAPBody().setPrefix("soapenv");
            saajMessage.saveChanges();
        } catch (SOAPException e) {
            e.printStackTrace();
        }
于 2013-03-20T22:52:39.233 に答える