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 8219699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:16:04+00:00 2026-06-07T13:16:04+00:00

I have a PC with a WCF service localhosted, I can add a reference

  • 0

I have a PC with a WCF service localhosted, I can add a reference to the service in a C# program. However when I run the program, I get an Access Denied error. I get no other information apart from Access Denied.

Does anyone have any suggestions on what to do. I have another machine which looks the same set up but am able to connect to the localhosted version on the same machine. I’ve looked at other questions already posted but nothing seems correct.

Edited….

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.diagnostics> 
       <sources> 
            <source name="System.IdentityModel" switchValue="All"> 
                <listeners> 
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default"> 
                        <filter type="" /> 
                    </add> 
                    <add name="IdentityModelListener"> 
                        <filter type="" /> 
                    </add> 
                </listeners> 
            </source> 
        </sources> 
        <sharedListeners> 
            <add initializeData="C:\Tracing\App_identitymodellog.svclog"                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
         name="IdentityModelListener" traceOutputOptions="Timestamp, Callstack">
            <filter type="" /> 
        </add> 
    </sharedListeners> 
    <trace autoflush="true" /> 
</system.diagnostics> 
    <system.web>
<compilation debug="true" targetFramework="4.0">
        <assemblies></assemblies></compilation>
        <identity impersonate="true" userName="domain\username" password="password" />
    <hostingEnvironment shadowCopyBinAssemblies="false"/>
<trust level="Full" /> 
</system.web>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

and the app.config is :-

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
    <binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://localhost:2745/ActDemo/Service.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
    contract="ActWS.IService" name="BasicHttpBinding_IService" />
  <endpoint address="http://localhost/ActDemo/Service.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="Act.IService" name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>`

Code :-

using ActDemoApp;    

namespace ActDemoApp
{
    class Program
    {
        static void Main(string[] args)
        {


            string strXML="";
            string strRetXML = "";

            try
            {

                ActWS.IService oService;

                ActWS.Request oRequest = new ActWS.Request();
                ActWS.Response oResponse;

                ActWS.Acceptance oAccept = new ActWS.Acceptance();


                StreamReader streamReader = new StreamReader("c:\\temp\\Request.dat");
                strXML = streamReader.ReadToEnd();
                streamReader.Close();

                Stopwatch stopWatch = new Stopwatch();
                oRequest = new ActWS.Request();
                oService = new ActWS.ServiceClient("BasicHttpBinding_IService1");

                // To ignore BindingFailure, turn off Errors -> Managed Debugging Assitant -> BindingFailure


                oResponse = new ActWS.Response();

                strRetXML  = oService.MakeRequest(strXML);

                if (strRetXML == null)
                {
                    Console.WriteLine("XML was invalid");
                    Environment.Exit(0);
                }
  • 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-06-07T13:16:06+00:00Added an answer on June 7, 2026 at 1:16 pm

    Found out what the problem was and quite laughable. Whilst I thought it was IIS or .NET the cause, I was as close to the problem as a bargepole. The problem was that the Windows Firewall was set to block everything including network traffic. Question was posted here because I thought it was .NET code.

    Thanks Grzegorz, CodeCaster amd Shailesh for spending the time to read and provide suggestions.

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

Sidebar

Related Questions

I'm new here and I hope anyonte can help me. I have WCF Service
I have a WCF service that I can debug. I put a breakpoint in
I have a WCF service that can return large amount of data depending on
I have a WCF service running on my machine, which get lauched while I
I have a requirement to access the HttpContext.Current from with-in a RESTful WCF service.
Possible Duplicate: Restricting WCF Service access to only localhost I have a WCF method
I have a WCF service that accesses a SQL database to fetch data .
I have a wcf service defined like this: [OperationContract] [WebInvoke(Method = POST, ResponseFormat =
I have a WCF service that I need to call in a ASP.NET web
I have a WCF service hosted in IIS6. It is doing simple WebRequest. When

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.