简体   繁体   中英

How to remove namespace xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”

I have this on my request soapenv:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

I want to remove xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Can I do that from my Service_BindingStub? Maybe can set org.apache.axis.client.Call object with some property... I don't know.

If your issue to have xsi namespace in the root so extend SoapSerializationEnvelope and then override method: write like:

@Override
    public void write(XmlSerializer writer) throws IOException {
//        writer.setPrefix("i", this.xsi);
        writer.setPrefix("d", this.xsd);
        writer.setPrefix("c", this.enc);
        writer.setPrefix("v", this.env);
        writer.startTag(this.env, "Envelope");
        writer.startTag(this.env, "Header");
        this.writeHeader(writer);
        writer.endTag(this.env, "Header");
        writer.startTag(this.env, "Body");
        this.writeBody(writer);
        writer.endTag(this.env, "Body");
        writer.endTag(this.env, "Envelope");
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM