title: Making a WCF service Android compatible
body: <p>I have a WCF service that is hosted on a remote server using IIS. I want to make this service android compatible so I can consume the service on an android client. The problem I'm having is that I'm trying to use ksoap2 to connect to the service but it's giving me a 400 error every time I try to call the method. I've used fiddler2 to try and see what the problem is and in addition to the 400 error, it's also sending back a content-length: 0 (don't know if that is the cause. Interesting fact, when I specify a content-length in the request on fiddler, it doesn't give me a 400 error but rather doesn't return a response at all) I've already tried changing the binding to a webHttpBinding instead of wsHttpBinding and adding a WebGet attribute above the method with a URITemplate, BodyStyle, etc. but no luck. Here's my code:</p>
  
  <p>Service</p>
  
  <pre><code>    public class PublicService : IPublicService
  {
      public Wallpaper[] GetWallpapers()
      {
          //return _wallpaperRepository.Items.ToArray();
          return new Wallpaper[]{ new Wallpaper()
                                      {
                                          Id = 10
                                      }};
      }
  }
  </code></pre>
  
  <p>Interface</p>
  
  <pre><code>[ServiceContract(Namespace = "http://XXXXXXXX.com/ServiceA")]
  public interface IPublicService
  {
      [OperationContract]
      Wallpaper[] GetWallpapers();
  }
  </code></pre>
  
  <p>Web.Config</p>
  
  <pre><code>    &lt;bindings&gt;
              &lt;wsHttpBinding&gt;
  &lt;binding name="android" 
  maxReceivedMessageSize="4097152" 
  maxBufferPoolSize="4097152"&gt;
                      &lt;readerQuotas 
  maxStringContentLength="4097152" 
  maxArrayLength="4097152" 
  maxBytesPerRead="4097152" 
  maxNameTableCharCount="4097152" 
  maxDepth="4097152"/&gt;
                  &lt;/binding&gt;
              &lt;/wsHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;services&gt;
              &lt;service name="Service.Concrete.PublicService" behaviorConfiguration="ServiceBehavior"&gt;
                  &lt;endpoint address="PublicService" binding="wsHttpBinding" name="PublicService" contract="Service.Abstract.IPublicService" bindingConfiguration="android"/&gt;
                  &lt;endpoint binding="mexHttpBinding" bindingConfiguration="" name="mex" contract="IMetadataExchange"/&gt;
              &lt;/service&gt;
  </code></pre>
  
  <p>I've been beating my head against the wall for the past several hours and going through countless googling, I'm at a complete lost on what to do next. If anyone has any idea what I'm doing wrong, any advice would be greatly appreciated.</p>