Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5964285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:24:14+00:00 2026-05-22T19:24:14+00:00

I have a WCF service that is hosted on a remote server using IIS.

  • 0

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:

Service

    public class PublicService : IPublicService
{
    public Wallpaper[] GetWallpapers()
    {
        //return _wallpaperRepository.Items.ToArray();
        return new Wallpaper[]{ new Wallpaper()
                                    {
                                        Id = 10
                                    }};
    }
}

Interface

[ServiceContract(Namespace = "http://XXXXXXXX.com/ServiceA")]
public interface IPublicService
{
    [OperationContract]
    Wallpaper[] GetWallpapers();
}

Web.Config

    <bindings>
            <wsHttpBinding>
<binding name="android" 
maxReceivedMessageSize="4097152" 
maxBufferPoolSize="4097152">
                    <readerQuotas 
maxStringContentLength="4097152" 
maxArrayLength="4097152" 
maxBytesPerRead="4097152" 
maxNameTableCharCount="4097152" 
maxDepth="4097152"/>
                </binding>
            </wsHttpBinding>
        </bindings>
        <services>
            <service name="Service.Concrete.PublicService" behaviorConfiguration="ServiceBehavior">
                <endpoint address="PublicService" binding="wsHttpBinding" name="PublicService" contract="Service.Abstract.IPublicService" bindingConfiguration="android"/>
                <endpoint binding="mexHttpBinding" bindingConfiguration="" name="mex" contract="IMetadataExchange"/>
            </service>

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:24:15+00:00Added an answer on May 22, 2026 at 7:24 pm

    Use basicHttpBinding instead. You can try it with default configuration:

    <endpoint address="PublicService" binding="basicHttpBinding" name="PublicService" contract="Service.Abstract.IPublicService" />
    

    In your android service make sure that you are specifying correct SOAP action, correct namespaces and that SoapSerializationEnvelope is constructed for SOAP 1.1 and has dotNet flag set to true.

    WsHttpBinding defaults to many advanced WS-* protocols. For example WS-Addressing which is set of well known SOAP headers. If you don’t include them in your message WCF service will reject the request.

    WebHttpBinding will also not solve the problem because that binding is used for REST services but you want to consume the service with ksoap = you need SOAP service.

    Edit:

    Another question on Stack overflow has nice example in the answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service that's hosted on IIS 7 using a basicHttpBinding .
I have a wcf service that is hosted on a server. I can browse
I have a WCF service, hosted in IIS 7.0 that needs to run database
I have WCF service that is IIS-hosted and I have to send binary data
I have a IIS hosted WCF service that is configured with a WebHttpBinding. It
I have a WCF service that is hosted via IIS on multiple web servers.
I have WCF service hosted by Windows service. This is my app.config file (server-side)
I have a REST WCF service that is being hosted in IIS. I have
I have a WCF service that is hosted in a windows application. The service
I have an wcf service that is hosted in II6. The service uses the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.