title: Accessing .NET WCF services from Android
body: <p>I have a .NET WCF service (not a web service) with many methods, some accepting and returning complex data types. I use these services from my Windows Phone 7 apps. It all works great and it's easy.</p>
  
  <p>Now I'm evaluating the feasibility of porting some of my apps to Android, but I can't figure out how to invoke my WCF services from an Android client.</p>
  
  <p>I have a working example I found in <em><a href="http://naveenbalani.com/index.php/2011/01/invoke-webservices-from-android/" rel="nofollow">Invoke webservices from Android</a></em>.</p>
  
  <p>But this looks to be accessing a "Web Service", not a WCF Service.</p>
  
  <p>My service is at <code>http://www.deanblakely.com/Service2.svc</code>, and it contains a simple method named "SimpleTest" that just returns the string "Alive".</p>
  
  <p>Using the code in the linked article, I put <code>http://www.deanblakely.com/Service2.svc</code> in SOAP_ADDRESS and SimpleTest in OPERATION_NAME.  But I have no idea what to put in SOAP_ACTION and WSDL_TARGET_NAMESPACE. I don't even know if this approach is valid.</p>
  
  <p>In .NET, Visual Studio builds us a "Service Reference" and everything just works.</p>
  
  <p>I also don't understand the following two lines of code...</p>
  
  <pre><code>httpTransport.call(SOAP_ACTION, envelope);
  Object response = envelope.getResponse();
  </code></pre>
  
  <p>With WCF services, the call is async so we make the call to SimpleTestAsync and leave a callback for the async return. These two lines of code appear to be synchronous, no?</p>