Error In XamarinAndroid "System.Net.Sockets.SocketException: Connection refused at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException" - wcf

I created A WCF Application that has 3 methods to return some users Data for test. that It has no Problem I tested.
I added the Web Reference in Xamarin But When I want to use the method it has Error Exception.
WCF web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior">
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="MyStoreService.MyStoreService"
behaviorConfiguration="MyBehavior">
<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration="MyBinding"
behaviorConfiguration="EndpointBehavior"
contract="MyStoreService.IMyStoreService"
name="MyStoreService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:58514/MyStoreService.svc" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="MyBinding" >
</binding>
</wsHttpBinding>
</bindings>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="true" />
</system.webServer>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="ServiceConnection" connectionString="Data Source=.;Initial Catalog=StoreDb;Integrated Security=true;" providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
this is the Code I Use in Xamarin android with C#
localhost.MyStoreService service = new MyStoreService();
var user = service.UserGetById(1, true);
label.Text = user.FName;
And this is the Error Exception
{System.Net.WebException: Error: ConnectFailure (Connection refused) ---> System.Net.Sockets.SocketException: Connection refused at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs:127 at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net.Sockets/Socket.cs:1214 at System.Net.WebConnection+<>c.<Connect>b__16_1 (System.IAsyncResult asyncResult) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net/WebConnection.cs:182 at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/FutureFactory.cs:538 --- End of stack trace from previous location where exception was thrown --- at System.Net.WebConnection.Connect (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x00197] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net/WebConnection.cs:180 --- End of inner exception stack trace --- at System.Net.WebConnection.Connect (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x0025d] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net/WebConnection.cs:202 at System.Net.WebConnection.InitConnection (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x000cc] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net/WebConnection.cs:273 at System.Net.WebOperation.Run () [0x00052] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net/WebOperation.cs:268 at System.Net.WebCompletionSource`1[T].WaitForCompletion () [0x0008e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System/System.Net/WebCompletionSource.cs:111 at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x000a7] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs:364 at MyStoreApplication.localhost.MyStoreService.UserGetById (System.Int64 UId, System.Boolean UIdSpecified) [0x00001] in F:\StoreProject\MyStoreApplication\MyStoreApplication\Web References\localhost\Reference.cs:227 at (wrapper remoting-invoke-with-check) MyStoreApplication.localhost.MyStoreService.UserGetById(long,bool) at MyStoreApplication.MainActivity.GetData () [0x00007] in F:\StoreProject\MyStoreApplication\MyStoreApplication\MainActivity.cs:147 at MyStoreApplication.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x000aa] in F:\StoreProject\MyStoreApplication\MyStoreApplication\MainActivity.cs:47 at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00010] in /Users/builder/azdo/_work/1/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-30/mcw/Android.App.Activity.cs:2986 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.3(intptr,intptr,intptr)}
I am new to wcf and xamarin. Please help me to solve the problem?
this is the Pic may help
[1]: https://s21.picofile.com/file/8444961626/Error.png

Related

Request Entity Too Large I've tried everything

I've searched this and tried everything that SO has to offer. I've been at this for quite some time and I cannot find in my web.config what is wrong. I'm getting the message "The remote server returned an unexpected response: (413) Request Entity Too Large."
I can't for the life of me figure out what I'm doing wrong! Help!
Here is my web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<system.web>
<compilation targetFramework="4.6" debug="true">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="DefaultCache" duration="60" varyByParam="none" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
<authentication mode="Windows" />
<pages controlRenderingCompatibilityVersion="4.0" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="3521478366" />
</requestFiltering>
</security>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding" allowCookies="true"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="32"
maxArrayLength="2147483647"
maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="TruckService.TruckService">
<endpoint
binding="basicHttpBinding"
bindingConfiguration="BasicHttpEndpointBinding"
contract="TruckService.ITruckService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="false" showFlags="Date, Time, Size, Extension" />
</system.webServer>
<connectionStrings>
<!-- removed for security purposes -->
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
What I've tried:
how to increase MaxReceivedMessageSize when calling a WCF from C#
The maximum message size quota for incoming messages (65536) has been exceeded
First of all, you need to keep the file transfer format of the server-side and the client-side the same. Deviation may cause this problem.
In addition, on the premise that increasing the message size and buffer size does not work, you can try to change a value: maxitemsinobjectgraph like this:
<behaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<dataContractSerializer maxItemsInObjectGraph="1365536" />
</behavior>
</behaviors>
<serviceBehaviors>
<behavior name="restBehavior">
<dataContractSerializer maxItemsInObjectGraph="1365536" />
</behavior>
</serviceBehaviors>

service is giving an error ServiceHost only supports class service types

I am trying to publish a service and have it use Windows Authentication and I'm getting an error when I even try to publish it so I haven't gotten far enough to get prompted for a username.
This is my error:
[ArgumentException: ServiceHost only supports class service types.]
System.ServiceModel.Description.ServiceDescription.GetService(Type serviceType) +16602430
System.ServiceModel.ServiceHost.CreateDescription(IDictionary`2& implementedContracts) +80
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +174
System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +475
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +43
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +530
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172
[ServiceActivationException: The service '/subservice/ISubService.svc' cannot be activated due to an exception during compilation. The exception message is: ServiceHost only supports class service types..]
System.Runtime.AsyncResult.End(IAsyncResult result) +901424
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178638
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +136
I've researched this a hundred times but I have very little experience with publishing a service. I've worked with them once they are built just never published one.
This is my web.config that I've modified from another web.config where that publishes fine:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true" />
</appSettings>
<system.web>
<compilation targetFramework="4.0" debug="true">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="DefaultCache" duration="60" varyByParam="none" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="None">
<!-- Basic <security mode="Transport"> -->
<!-- To use Basic auth, just comment Windows and use this, but you need to configure basic in IIS as well -->
<!-- <transport clientCredentialType="Basic" /> -->
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="default">
<security mode="None">
<!-- Basic <security mode="Transport"> -->
<!-- To use Basic auth, just comment Windows and use this -->
<!-- <transport clientCredentialType="Basic" /> -->
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="subservice.ISubService">
<endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="subservice.ISubService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="rest" binding="webHttpBinding" bindingConfiguration="default" behaviorConfiguration="restBehavior" contract="subservice.ISubService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<httpProtocol>
<customHeaders>
<add name="p3p" value="CP="CAO PSA OUR"" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
I have nothing in my web.release.config:
<?xml version="1.0"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>
This is what my application looks like:
Anyone see what I'm doing wrong?
The error says you are using the Interface type to construct a host instead of a class type that implements your service interface ISubService.
eg.
ServiceHost host = new ServiceHost(
typeof(subservice.ISubService), new Uri("someuri"));
If this is your usage, change it to use the implemented service class type of ISubService
ServiceHost host = new ServiceHost(
typeof(subservice.SubService), new Uri("someuri"));
If configuring the service in .svc then:
<%#ServiceHost Service="subservice.SubService"%>
Also in you config file, change service name to the service instead of the service contract as:
<services>
<service name="subservice.SubService">
...

WCF with SQL table - exposing metadata

I developed small WCF service which takes all records from table. It looks like that:
IService1.cs:
[ServiceContract]
public interface IService1
{
List<badanieCis> GetRecords();
}
Service1.svc.cs:
public List<badanieCis> GetRecords()
{
przychodniaEntities dataContext = new przychodniaEntities();
return dataContext.badanieCis.ToList();
}
And I am getting a message: Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata
What I have made after some research was changing markup in svc file for this one:
<%# ServiceHost Language="C#" Debug="true"
Service="Harvesting.Service.HarvestingService" CodeBehind="Service1.svc.cs" %>
But still nothing.
My web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
<connectionStrings>
<add name="przychodniaEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=DAREK-PC\SQLExpress;initial catalog=przychodnia;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
You are missing service definition in the config file. You need something like:
<services>
<service behaviorConfiguration="..." name="Service1 with namespace">
<endpoint address="..." name="..." binding="wsHttpBinding" bindingConfiguration="...." contract="IService1 with unterface" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<services>
...
You may use this tool to help with config.

WCF service page not available when browsing remotely

I have a service I have been trying to deploy on my server (iis7) for quite some time now. It works when I browse the .svc file from the server, but when I try to browse the .svc from another computer it complains that the webpage is not available.
I have enabled network discovery. What else could be causing this issue?
Here is my web.config:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="StudentInfoAlpha.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true">
<assemblies>
<add assembly="Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</assemblies>
</compilation>
</system.web>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="StudentInfoServiceBinding">
<security mode="Transport">
<message clientCredentialType="Windows"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="StudentInfoAlpha.StudentInfoService" behaviorConfiguration="StudentInfoAlpha.StudentInfoServiceBehavior">
<endpoint address="" binding="wsHttpBinding" contract="StudentInfoAlpha.IStudentInfo" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="https://IPADDRESS:443/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="StudentInfoAlpha.StudentInfoServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<applicationSettings>
<StudentInfoAlpha.Properties.Settings>
<setting name="StudentInfoAlpha_AIR_AIR" serializeAs="String">
<value>http://IPADDRESS/AIRv2Host/AIR.svc</value>
</setting>
</StudentInfoAlpha.Properties.Settings>
</applicationSettings>
</configuration>

Problem in WCF Configuration

There are two templates:one Middleware and other the webclient.
The web.config for the Middleware is as :
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="HoneywellMiddleware.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Windows"/>
<anonymousIdentification enabled="true"/>
<identity impersonate="true"/>
</system.web>
<connectionStrings>
<add name="SQLConnectionString" connectionString="server=01HW361477;uid=sa;pwd=MSS#L2008;database=Honeywell"/>
</connectionStrings>
<system.serviceModel>
<services>
<service name="HoneywellMiddleware.HoneywellService" behaviorConfiguration="ServiceBehaviour">
<endpoint address="" binding="webHttpBinding" contract="HoneywellMiddleware.IHoneywellService" behaviorConfiguration="web"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:56334/HoneywellService.svc"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
For the webclient web application it is like this :
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="HoneywellMiddleware_IHoneywellService"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:56334/HoneywellService.svc" binding="basicHttpBinding"
bindingConfiguration="HoneywellMiddleware_IHoneywellService" contract="HoneywellService.IHoneywellService"
name="HoneywellMiddleware_IHoneywellService" />
</client>
</system.serviceModel>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Error:
There was no endpoint listening at http://localhost:56334/HoneywellService.svc
that could accept the message. This is often caused by an incorrect address or
SOAP action. See InnerException, if present, for more details.
Any help will be appreciated
Either you have a binding mismatch (http vs web binding) or you have a contract mismatch (HoneywellService.IHoneywellService vs HoneywellMiddleware.IHoneywellService).
Change your client endpoint to:
<client>
<endpoint address="http://localhost:56334/HoneywellService.svc" binding="webHttpBinding"
contract="HoneywellService.IHoneywellService"
name="HoneywellMiddleware_IHoneywellService" />
</client>
or
<client>
<endpoint address="http://localhost:56334/HoneywellService.svc" binding="webHttpBinding"
contract="HoneywellMiddleware.IHoneywellService"
name="HoneywellMiddleware_IHoneywellService" />
</client>