Open GoogleCodeExporter opened 9 years ago
I had some time today and did a quick fix just so I could use ksoap and get
past my issue. Here is my class, but basically I was hoping this option could
be rolled into org.ksoap2.serialization.SoapSerializationEnvelope. Let me know
what you think:
public class SoapSerializationEnvelope extends
org.ksoap2.serialization.SoapSerializationEnvelope {
private boolean outputSoapHeader = true;
public SoapSerializationEnvelope(int version) {
super(version);
}
public boolean isOutputSoapHeader() {
return outputSoapHeader;
}
public void setOutputSoapHeader(boolean outputSoapHeader) {
this.outputSoapHeader = outputSoapHeader;
}
@Override
public void write(XmlSerializer writer) throws IOException {
writer.setPrefix("i", xsi);
writer.setPrefix("d", xsd);
writer.setPrefix("c", enc);
writer.setPrefix("v", env);
writer.startTag(env, "Envelope");
if (outputSoapHeader) {
writer.startTag(env, "Header");
writeHeader(writer);
writer.endTag(env, "Header");
}
writer.startTag(env, "Body");
writeBody(writer);
writer.endTag(env, "Body");
writer.endTag(env, "Envelope");
}
}
Original comment by mba...@gmail.com
on 14 Sep 2014 at 2:43
Thought about this a little more and it would probably be better to detect if
anything has been added in the soap header or not. Then the option would only
suppress the element if it's empty.
At least the example I have above shows if you have a service provider that
doesn't like this I guess it's a temporary workaround.
Original comment by mba...@gmail.com
on 14 Sep 2014 at 2:45
Original issue reported on code.google.com by
mba...@gmail.com
on 13 Sep 2014 at 7:47