title: Problem passing simple string parameter to .net webservice
body: <p>I have the following code which invokes a .net webservice. The code connects to the service fine, but the paramter(deviceid) does not appear to get passed. The method simply returns the passed deviceid which is always null.</p>
  
  <p>This is telling me the deviceid parameter is not being passed. I thought I saw someone recommend a packet sniffer to view the outgoing xml, but can't seem to remember what it was. Can someone suggest one that i can use in conjunction with eclipse and windows.</p>
  
  <p>activity code    </p>
  
  <pre><code>    String deviceid = tManager.getDeviceId();
  
      SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
  
      PropertyInfo pi = new PropertyInfo();
  
      pi.setName("deviceid");
      pi.type = PropertyInfo.STRING_CLASS;
      pi.setValue(deviceid.toString());
      request.addProperty(pi);
  
      SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
      soapEnvelope.dotNet = true;
      soapEnvelope.setOutputSoapObject(request);
  
      HttpTransportSE ht = new HttpTransportSE(URL);
  
  
      try{
          ht.call(SOAP_ACTION, soapEnvelope);
          SoapPrimitive result = (SoapPrimitive ) soapEnvelope.getResponse(); 
  
  
          Toast.makeText(ctx, "result = " + result.toString(), Toast.LENGTH_SHORT).show();
  
      }catch(Exception e){
          e.printStackTrace();
          Toast.makeText(ctx, "error: " + e.getMessage(), Toast.LENGTH_SHORT).show();
  
      }
  </code></pre>
  
  <p>webservice code</p>
  
  <pre><code>        &lt;WebMethod()&gt; _
      Public Function CheckTrial(ByVal deviceid As String) As String
  
          Return deviceid
      End Function
  </code></pre>
  
  <p>I,ve tried everything and cannot figure out how to resolve this. Does anyone else have any suggestions to try?</p>
  
  <p>xml sent as spy'ed from wire shark:</p>
  
  <pre><code>POST /android_service_test.asmx HTTP/1.1 
  Host: ikonicsoft.com 
  user-agent: kSOAP/2.0 
  soapaction: http://ikonicsoft.com/CheckTrial 
  content-type: text/xml 
  connection: close 
  content-length: 421  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:d="http://www.w3.org/2001/XMLSchema" 
  xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" 
  xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;v:Header /&gt;
  &lt;v:Body&gt;
      &lt;CheckTrial xmlns="http://ikonicsoft.com" id="o0" c:root="1"&gt;
          &lt;deviceid i:type="d:string"&gt;000000000000000&lt;/deviceid&gt;
      &lt;/CheckTrial&gt;
  &lt;/v:Body&gt;
  &lt;/v:Envelope&gt;
  
  HTTP/1.1 200 OK 
  Connection: close 
  Date: Mon, 21 Jun 2010 16:35:10 GMT 
  Server: Microsoft-IIS/6.0 
  X-Powered-By: PleskWin 
  X-Powered-By: ASP.NET 
  X-AspNet-Version: 2.0.50727 
  Set-Cookie: .ASPXANONYMOUS=fnyqjfFHywEkAAAAZGVjYjZmNTEtNWNiYi00YTIwLWEzYzktNzUxZDNjMDA0OGY00; 
  expires=Mon, 30-Aug-2010 03:15:09 GMT; path=/; HttpOnly 
  Cache-Control: private, max-age=0 
  Content-Type: text/xml; charset=utf-8 
  Content-Length: 299  
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope 
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;soap:Body&gt;
      &lt;CheckTrialResponse xmlns="http://ikonicsoft.com/" /&gt;
  &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Patrick</p>