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

  • Home
  • SEARCH
  • 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 6664495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:37:02+00:00 2026-05-26T02:37:02+00:00

I have a very simples Hello World WCF Service, that looks like this: namespace

  • 0

I have a very simples Hello World WCF Service, that looks like this:

namespace MyWCFServices
{
    public class HelloWorldService : IHelloWorldService
    {

        public String GetMessage()
        {
            return "Hello world";
        }
}
}

namespace MyWCFServices
{
   [ServiceContract(Namespace = "http://127.0.0.1:49359/GetMessage/")]
    public interface IHelloWorldService
    {
        [OperationContract]
        String GetMessage();
    }
}

My web.config:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="false" targetFramework="4.0" />
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyServiceTypeBehaviors">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="MyWCFServices.HelloWorldService"
             behaviorConfiguration="MyServiceTypeBehaviors">

        <host>
          <baseAddresses>
            <add baseAddress="http://127.0.0.1:49359/HostDevServer/HelloWorldService.svc" />
          </baseAddresses>
        </host>

        <endpoint name="GetMessage" address="" binding="basicHttpBinding"
             contract="MyWCFServices.IHelloWorldService"/>
        <endpoint contract="IMetadataExchange"
           binding="mexHttpBinding" address="mex"/>
      </service>
    </services>
  </system.serviceModel>
</configuration>

And my android java:

HttpClient httpClient = new DefaultHttpClient(); 

        String url = "http://10.0.2.2:49359/HostDevServer/HelloWorldService.svc/GetMessage";
        //String url = "http://10.0.2.2:49359/HostDevServer/HelloWorldService.svc/GetMessage";
        //String url = "http://localhost:49359/HostDevServer/HelloWorldService.svc";
        //String url = "http://localhost:49359/GetMessage";
        try{

        HttpGet method = new HttpGet( new URI(url) );
        HttpResponse response = httpClient.execute(method);
        if ( response != null )
        {
            Log.i( "login", "received " + getResponse(response.getEntity()) );
        }
        else
        {
            Log.i( "login", "got a null response" );
        }

I’m getting the java.net.SocketException: Permission denied. I already have:

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

So or my WS is not accepting connections or the android client is connecting in wrong way. Probably both. For those who know, in the android client its needed to place 10.0.2.2 to redirect to a localhost web server, so no problem there (at least it works when connecting to a PHP KSOAP WS locally)

Can anyone please guide me?

  • 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-26T02:37:03+00:00Added an answer on May 26, 2026 at 2:37 am

    That is completely wrong. It looks like you don’t understand basics of web services. You are exposing SOAP service (basicHttpBinding) – it expects HTTP POST requests and communication must follow SOAP 1.1 protocol. But you are calling it as HTTP GET = no SOAP body. Also namespace in your ServicContract has nothing to do with real service’s URL.

    To call that service you must build valid SOAP request and post it. It is better to use some SOAP protocol stack on Android – for example kSoap2.

    Here is example of using kSoap2 to call WCF service.

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

Sidebar

Related Questions

i have a html like this: ......whatever very long html..... <span class=title>hello world!</span> ......whatever
We have method that looks like this : public String getCommandString(Object...args) { return this.code
I have this simple hello world version of a google map api javascript v3
I am having a hard time consuming a very simple (Hello World) WCF web
Given this HTML: <button id=buttonId1 class=hello universe> <button id=buttonId2 class=hello world> What's the correct
I have finally created a very simple Hello World style PHP Extension dll on
I have a string that contains the following text String my_string = hello world.
I have written a very simple C program to print Hello World in my
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I have this very simple jQuery function: $(.milestone-in-tree).live({ mouseenter: function() { setTimeout( $.ajax({ type:

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.