Note that there are some explanatory texts on larger screens.

plurals
  1. POSet Soap Header ksoap2 android
    text
    copied!<p>First, I apologize for asking a question that is already common here in the SOF.</p> <p>But I am a beginner and I'm certainly cruel.</p> <p>I am creating an android application that communicates with a WS. So I can make requests to the WS, I have to add a value to the header of the envelope, but I can not add.</p> <p>I found some answers about it here in the SOF, however, could not fully understand how it works. Perhaps, my doubts are due to the nodes of the header, which ended up confusing me even more.</p> <p>One of the answers I found I ended up not helping: "<a href="https://stackoverflow.com/questions/5613675/how-to-set-soap-header-using-ksoap2-android">How to set soap header using ksoap2 android</a>"</p> <p>Below is the XML request that needs to be done:</p> <pre><code> ?xml version="1.0" encoding="utf-8"? soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header ValidationSoapHeader xmlns="http://tempuri.org/" DevToken&gt;string/DevToken /ValidationSoapHeader /soap:Header soap:Body ListaCidades xmlns="http://tempuri.org/" / /soap:Body /soap:Envelope </code></pre> <p>And my code below:</p> <pre><code>SoapObject request = new SoapObject(ApplicationData.NAMESPACE, ApplicationData.METHOD_NAME_LISTA_CIDADES); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); </code></pre> <p>How exactly do I use the envelope.HeaderOut? Is it really necessary to create a helper method to build an Element even having to pass only one parameter (DevToken)?</p> <p>Thank you for your attention!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload