System.Net.WebException when trying to consume WCF service - c#

I am developing system composed of WCF service and Xamarin.Forms client app. Seems like my application connects to server just fine (client has status Open when I check before invoking any methods), but after I try to invoke a service method, I am getting System.Net.WebException:
There was no endpoint listening at {0} that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
And the inner exception is:
System.Net.WebException: There was an error on processing web request: Status code 404(NotFound): Not Found
I can access service via web browsers on both pc and phone with address http://localhost:4408/DatabaseService.svc or http://192.168.8.106:4408/DatabaseService.svc but I get the exception when I am trying to invoke any methods from my app.
My client app is connecting to the host and invokes methods like this:
public App()
{
var binding = new BasicHttpBinding();
var timeout = new TimeSpan(0, 0, 30);
binding.SendTimeout = timeout;
binding.ReceiveTimeout = timeout;
dbClient = new DatabaseServiceClient(binding, new EndpointAddress("http://192.168.8.106:4408/DatabaseService.svc"));
dbClient.Test();
}
My service is hosted by this simple program:
class Program
{
static void Main()
{
Uri baseAddress = new Uri("http://192.168.8.106:4408/DatabaseService.svc");
ServiceHost selfHost = new ServiceHost(typeof(DatabaseService.DatabaseService), baseAddress);
try
{
selfHost.AddServiceEndpoint(typeof(DatabaseService.IDatabaseService), new WSHttpBinding(), "DatabaseService");
ServiceMetadataBehavior smb = new ServiceMetadataBehavior
{
HttpGetEnabled = true
};
selfHost.Description.Behaviors.Add(smb);
selfHost.Open();
Console.WriteLine("Host Status: " + selfHost.State);
Console.WriteLine("Host Addresses: " + selfHost.BaseAddresses.Count);
foreach (var x in selfHost.BaseAddresses)
Console.WriteLine(" - " + x.AbsoluteUri);
Console.WriteLine("<q to close >");
string command = "";
while (command != "q")
command = Console.ReadLine();
selfHost.Close();
Console.WriteLine("Host shutdown");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine("Exception thrown:\n" + e.Message);
Console.ReadLine();
selfHost.Abort();
}
}
}
Part of my applicationhost.config edited by me is:
<site name="OutdoorGame" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="F:\Studia\Magisterka\Github\Serwer\OutdoorGame\OutdoorGame" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:4408:localhost" />
<binding protocol="http" bindingInformation="*:4408:127.0.0.1" />
<binding protocol="http" bindingInformation="*:4408:192.168.8.106" />
</bindings>
</site>
I tried to stick to the tips included here: https://learn.microsoft.com/pl-pl/xamarin/xamarin-forms/data-cloud/web-services/wcf and I should also mention, that my services are working just fine, when accesed via ISS Express WCF Test Client.
I think I am missing something very simple but I have no clue what would it be. Any help will be much appreciated.
EDIT1
I probably should also show part of Web.config of the server:
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttp"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text"
textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="DatabaseService.DatabaseService">
<endpoint
address="http://192.168.8.106:4409/DatabaseService.svc"
binding="basicHttpBinding" bindingConfiguration="basicHttp"
contract="DatabaseService.IDatabaseService"/>
</service>
</services>
<protocolMapping>
<add scheme="http" binding="basicHttpBinding" bindingConfiguration="basicHttp"/>
</protocolMapping>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true" />
</system.webServer>

If you have configured the endpoint information in the configuration file, you do not need to use the hosting program to configure the endpoint information. Moreover, if the project created using the WCF service application template does not require a program to host it, it can be directly deployed to IIS.
This project can be deployed directly to IIS or run directly in VS.
Secondly, I suggest you use Add Service Reference to generate the client:
Finally, you can directly call the service through the automatically generated proxy class.

Okey, so since I don't have much time, I basically gave up on this and just went to previous version of my project. Now my files look like this:
Connecting like this:
{
dbClient = new DatabaseServiceClient(new BasicHttpBinding(), new EndpointAddress("http://192.168.8.106:13409/DatabaseService.svc"));
}
applicationhost.config
<site name="DatabaseService" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="F:\Studia\Magisterka\Github\Serwer\OutdoorGame\DatabaseService" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:13409:localhost" />
<binding protocol="http" bindingInformation="*:13409:192.168.8.106" />
<binding protocol="http" bindingInformation="*:13409:127.0.0.1" />
</bindings>
</site>
My web.config is basically default.
Ports used are different because meanwhile I tried to create a new service (thought that could solve the problem) and that could be the thing.
Thanks to Ding Peng now I know, that I don't need service host, IIS Express is enough to host it.
Thanks guys for help.

Related

Set WCF Service endpoints at server side web config for https

I am stuck in very odd situation and do not know how to solve this issue.
I have very simple WCF service working very fine with http BUT now I want to move it to https.
The issue is Server where it needs to be hosted. Server IIS have an alias name "server-test.local" (not "localhost") with http. Its is accessible locally with this alias name. And its mapped to a Domain name with https (example, https://rmt.XXXXXXX.com).
When I deploy my WCF to that server and check WSDL file, it has mapping of the local alias name instead of public domain name.
it is showing http://server-test.local/WCFService/Service.svc (WRONG)
I want mapping like https://rmt.XXXXXXXX.com/WCFService/Service.svc (CORRECT)
Service web.config
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="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="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>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
When I add service reference to app. It adds following endpoint which is not conrrect.
Client App.config (endpoint)
<endpoint address="http://server-test.local/WCFService/Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProcessing"
contract="WCFService.IService" name="BasicHttpBinding_IProcessing" />
I am able to access the url and WSDL file through browser but not able to consume any Service methods. I am getting error "There is no endpoint which can accept the message."
I think I am missing something obvious here. Please suggest me changes.
You can try to change some simple steps in the web.config file, you can refer to this post for details.
1.Enable transport level security in the web.config file of the service:
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
2.Use the bindingConfiguration tag to specify the binding name and the behaviorConfiguration tag to configure the behavior, and then specify the address of the managed service. The code is as follows:
<service name="***" behaviorConfiguration="***">
<endpoint address= https://rmt.XXXXXXXX.com/WCFService/Service.svc
binding="basicHttpBinding"
bindingConfiguration="???"
contract="WCFService.IService"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>

WCF Service returns Error when invoking method from client after changing from http to https "ContractFilter mismatch at the EndpointDispatcher"

I created a HTTP wcf service that will be consumed by a windows client and utilized. I had no issue until I was using HTTP. Now my customer wants to change the site to HTTPS. So for development purpose I have used IIS express certificate and setup the service. Now my service is up and running in IIS with iisexpress self signed certificate. I am able to browse my new https service via browser as well as wcf test client tool.
But when I try invoke the method from my windows application to new https wcf service. My service instance is created but only during invoking a method I get following error:
System.ServiceModel.ActionNotSupportedException was unhandled by user code
HResult=-2146233087
Message=The message with Action 'http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
In service my binding config (config 3 is being used at https mode and config 2 was used during http mode) are as follows:
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding_IPGPService">
<!--config test 1 - start -->
<!--<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>-->
<!--config test 1 - end -->
<!--config test 2 - start -->
<!--<security mode="None" />
<reliableSession enabled="true" />-->
<!--config test 2 - end -->
<!--config test 3 - start -->
<!--<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"/>
<message clientCredentialType="Certificate" algorithmSuite="Default" />
</security>-->
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
<!--config test 3 - end -->
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="PGPService.PGPService">
<endpoint address="" binding="wsHttpBinding" contract="PGPService.IPGPService" bindingConfiguration="wsHttpBinding_IPGPService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<!--<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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"/>-->
<!--test config - start-->
<serviceDebug includeExceptionDetailInFaults="True" />
<!--test config - end-->
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
In client we use custom binding to create service instance.
url = "https://localhost:550/TestService/TestService.svc";
customBinding = new CustomBinding();
customBinding.Elements.Add(new ReliableSessionBindingElement());
customBinding.Elements.Add(new HttpsTransportBindingElement());
EndpointAddress endpointAdress = new EndpointAddress(url);
pgpServiceClientInstance = new PGPServiceClient(customBinding, endpointAdress);
pgpServiceClientInstance.ClientCredentials.ClientCertificate.SetCertificate(
StoreLocation.CurrentUser,
StoreName.Root,
X509FindType.FindByThumbprint,
‎"03815c894b62dcf2d17336ade2d9ca61ddb7f92c");
After adding service reference the app.config generated on my Windows application is as follows:
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IPGPService">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://localhost:550/TestService/TestService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IPGPService"
contract="PGPServiceReference.IPGPService" name="WSHttpBinding_IPGPService" />
</client>
So now I can see my service instance is getting successfully created. but on the time of invoking a method I get above error.
There is no code changed before and after moving to https on service end. It is the same service code. It was completely working fine on http but is broken on https.
I have completely removed the service reference and added it newly after making my wcf service https. IIS express self signed certificate is installed and available already on my system. Both service and client are running in same system as of now since it is development
I am suspecting I am having a configuration problem....but with less experience I could not figure out.
Actually it was an additional binding during service instantiation that was causing the problem. Got it sorted by commenting below line in instantiation part.
url = "https://localhost:550/TestService/TestService.svc";
customBinding = new CustomBinding();
//customBinding.Elements.Add(new ReliableSessionBindingElement());
customBinding.Elements.Add(new HttpsTransportBindingElement());
This helped me to proceed with developing the entire service and client.
So that concludes my fix for above issue.
Further down the lane since i am a newbie to wcf service i faced following problems which i faced and solved. Someone who is struggling like me can use below step if you are facing my errors
Next my service had problems accessing folder
Fix: add seperate application pool with an service or administrator account with enough privileges.
To add wcf session to existing code.
Fix: This is where i am facing problem because i was using wshttpbinding with transport security. Then after browsing several materials and codes understood i have to make my config to custombinding with reliablesession and httpstransport to proceed further with development. so my config roughly appears as
<customBinding abc of wcf>
<reliableSession/>
<httpsTransport/>
<\customBinding>
And also uncommented above line of service instantiation after understanding its real purpose.No need for any values in reliable session tag and httpsTransport for basic support of security.
This solved my second issue.
However i am facing wsdl import error in wcf client test tool now which i am struggling now to solve. svcutil proxy generation option or add service refrence with uncheked assembly option doesnt seem to be working. Also i noticed that even if add my service refrence freshly to client there is no configurations generated to my app.config file surprisingly.....and above mentioned options dont help.....looking for experts ideas....
Fix : ??? Expolring....
Souls who read this are welcome to give answer/suggestion.

Unable to find element in WCF ServiceModel client configuration section

[ServiceContract]
public interface IService1
{
[OperationContract]
DataTable GetADUserList(string strUserName, string strFirstName, string strLastName, string strEmail, string domain);
}
I have a WCF service hosted in IIS with the sample service contract above. The service web.config file settings are as below.
Full WCF Web.config file
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="notSecureBinding">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
<binding name="SecureBinding">
<binaryMessageEncoding />
<httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://ServerName.myDomain.org/ADSearcher/Service1.svc"
binding="customBinding"
bindingConfiguration="notSecureBinding"
contract="ADSearcher.IService1"
name="notSecureBinding" />
<endpoint address="http://ServerName.myDomain.org/ADSearcher/Service1.svc"
binding="customBinding"
bindingConfiguration="SecureBinding"
contract="ADSearcher.IService1"
name="SecureBinding" />
</client>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
And i'm trying to access the service programmatically as below.
EndpointAddress endpointAddress = new EndpointAddress("http://ServerName.myDomain.org/ADSearcher/Service1.svc");
IService1 ADUser = new ChannelFactory<IService1>("notSecureBinding", endpointAddress).CreateChannel();
The above code is throwing the error below
Could not find endpoint element with name 'notSecureBinding' and contract 'ADSearcher.IService1' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element
I can't seem to figure out what i'm doing wrong here or is there a better alternative to access this service programmatically?
In your endpoint, you are specifying a contract of type Data.GetData. The contract is of type IService1, and by default, the contract name should be the typename of the service interface.
If you really want your IService to be referred to as Data.GetData, you can specify the identifying name via the ServiceContractAttribute:
[ServiceContract(ConfigurationName = "Data.GetData")]
public interface IService1
{
[OperationContract]
DataTable GetADUserList(string strUserName, string strFirstName, string strLastName, string strEmail, string domain);
}
Could not find endpoint element with name 'customBinding'....in the
ServiceModel client configuration section
This is because you are defining two client endpoints in your config file. And they are named:
notSecureBinding, and
SecureBinding
So the error message is correct, there is no endpoint element with name "customBinding".
I think you need to do this:
IService1 ADUser = new ChannelFactory<IService1>("<either of the two bindings you defined>").CreateChannel();
Do i need to configure any thing related to WCF in the ASP.NET MVC
application's web.config file?
OK so now I understand. You are hosting the WCF service in your ASP.NET website. And you're trying to call it from somewhere else I assume?
You definitely need to define a <system.serviceModel /> section in your web.config, which will tell IIS how to host your service.
At the moment, the configuration you gave posted above defines to client endpoints. These do not reference service endpoints, but rather is client config designed to allow you to call services. The hint is in the name of the section node: <client />. To define service endpoints that you wish to expose you need to put your endpoint config in a <service /> section. In your case it may only be necessary to change the "client" to "service" to make it all work.
The code which is calling the service may or may not need client configuration in the app.config file. You say you are calling it programatically (although without seeing your full client code I don't know that you are doing enough to satisfy the WCF client call stack), in which case you don't need client config. I hope this makes things clearer for you.

Hosting NamedPipe WCF on Win7 IIS 7.5 EndpointNotFoundException

I am trying to create WCF NamedPipe in win7 with IIS 7.5.
In IIS Manager right click, and create WebSite named "TestWCFWithNamedPipe"
Right click my WebSite "TestWCFWithNamedPipe" -> select Edit bindings
Type:http
Host Name:sample.localdev.net
Port:80
Address:*
Type:net.pipe
Binding informations:*
In Advanced settings set the value for Enabled Protocol as "http,net.pipe"
In My WebSite "TestWCFWithNamedPipe" Web Application Project
web.config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceDebug />
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="DefaultBehavior" name="SampleWcfLib.SampleWcfObj">
<endpoint address="net.pipe://localhost/Sample" binding="netNamedPipeBinding"
bindingConfiguration="" contract="SampleWcfInterfaceLib.ISampleWcfObj" />
</service>
</services>
</system.serviceModel>
TestClient.exe code is following
string address = "net.pipe://localhost/Sample";
NetNamedPipeBinding binding = new NetNamedPipeBinding();
EndpointAddress ep = new EndpointAddress(address);
ISampleWcfObj channel = ChannelFactory<ISampleWcfObj>.CreateChannel(binding, ep);
string result = channel.Ping("Test");
And I run TestClient.exe, and I get an exception:
There was no endpoint listening at net.pipe://localhost/Sample that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
I have checked Win7 Service status:
Net.Pipe Listener Adapter Started
Net.Tcp Listener Adapter Started
I have done all settings for WCF.
Why do I still get the EndpointNotFoundException error message ?
You can find the name of your tcp binding if you have a look in your XSD file.
It will be on the bottom of your file and it will look like this
<wsdl:service name="PersonService">
<wsdl:port name="NetNamedPipeBinding_IPersonContract" binding="tns:NetNamedPipeBinding_IPersonContract">
<soap12:address location="net.pipe://wcftestpipe/WcfTest/PersonService.svc/test"/>
<wsa10:EndpointReference>
<wsa10:Address>net.pipe://wcftestpipe/WcfTest/PersonService.svc/test</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
Afther that you propably get a security exeception that will say you don't have the right credentials. You can set your binding security mode to NONE in your web.config of your WCF service and app.config of your Client.
<bindings>
<netNamedPipeBinding>
<binding>
<security mode="None"/>
</binding>
</netNamedPipeBinding>
</bindings>
Hope this helps

Unable to Connect to Remote WCF Service - TimeoutException

I previously asked a question to resolve the SecurityNegotiationException while trying to access a WCF service from a remote machine. That exception has been resolved thanks to the answer by ValtasarIII.
Now i have a different problem. I have hosted my service on a server and want to connect to it using a client application. But, when i try to Subscribe to the service from the client application, nothing happens and at the end i get the exception:
The open operation did not complete within the allotted timeout of 00:00:59.9939996. The time allotted to this operation may have been a portion of a longer timeout.
(I can share the stack trace if necessary)
Although when i try to test whether the service is running, i can successfully access it through the browser from the client machine.
Here are my configurations:
Service - web.config
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="wsHttpDual">
<security mode="None">
<message clientCredentialType="None" algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<protocolMapping>
<add scheme="http" binding="wsDualHttpBinding" bindingConfiguration="wsHttpDual"/>
</protocolMapping>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Client - app.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_ISampleContract" clientBaseAddress="http://95.138.188.232:8000/myClient/">
<!--<security mode="Message">
<message clientCredentialType="Windows" algorithmSuite="Default" />
</security>-->
<security mode="None">
<message clientCredentialType="None" algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://95.138.188.232/autofxtools/service.svc"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_ISampleContract"
contract="ISampleContract" name="WSDualHttpBinding_ISampleContract">
<identity>
<servicePrincipalName value="host/95.138.188.232" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
I have searched for a solution but nothing has worked for me. The Service config seems to suggest no security requirement. But, the client with the same configuration actually works from the same machine as the Service but not off a remote machine. Does this mean that there still exists a Windows authentication (as per default for wsDualHttpBinding)? If so then where am i going wrong?
Hoping to get some positive feedback.
Regards.
This may be a firewall problem. I assume you're hosting the service within ISS - are you sure that the respective ports are open? What happens when you try to access the service through a browser?
Also, I read in a German forum the following:
Anscheinend tritt das Problem nur bei WsDualBinding auf, wenn der Port 80 belegt ist.
Gibt wohl keine Möglichkeit den Port mit Hilfe von ClientBaseAdress zu ändern.
Einzige Möglichkeit ist hier wohl netTcpBinding.
Which in English means:
Obviously this problem arises when using WsDualBinding while port 80 is already occupied. There seems to be no way to change the port using ClientBaseAddress. The only way seems to be to use netTcpBinding.

Categories