Mysterious issue in WCF and IIS?

Hello
I wrote WCF duplex service . This service works in Visual Studio, but when I publish this service and put it in IIS, Service don't answer to any Client .
All clients connect to this service. They are also called Service Well, and there are no exceptions.
They differ only between these services (Internet Information Services and IIS). For instance:
* IIS address http: //localhost/SmsService/SmsService.svc or better, this is the address of the virtual path.
* Host service address VS http: // localhost: 1408 / SmsSrevice.svc . absolutely I changed Server address for client's.

Here is the Service / Application Configuration:
VS Hosted Service

 <system.serviceModel> <services> <service name="SmsService.Business.SmsService" behaviorConfiguration="ServiceBehavior"> <endpoint address="http://localhost:1408/SmsService.svc" binding="wsDualHttpBinding" contract="SmsService.Business.ISmsService"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> 

IIS hosting

  <system.serviceModel> <services> <service name="SmsService.Business.SmsService" behaviorConfiguration="ServiceBehavior"> <endpoint address="" binding="wsDualHttpBinding" contract="SmsService.Business.ISmsService"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> 

Client configuration

  <system.serviceModel> <bindings> <wsDualHttpBinding> <binding name="WSDualHttpBinding_SMSService" closeTimeout="00:10:00" clientBaseAddress="http://MyMachinName:10300/SmsClientService" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" /> <security mode="Message"> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" /> </security> </binding> </wsDualHttpBinding> </bindings> <client> <endpoint address="http://SERVER1/SmsService/SmsService.svc" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_SMSService" contract="ServiceReference.SMSService" name="WSDualHttpBinding_SMSService"> <identity> <dns value="localhost" /> </identity> </endpoint> </client> 

Even I wrote an event log in the first of the service methods, but this does not work!

so what's the problem?

Change 1

Thank you all first

Secondly, I think I am not explaining my question clearly. โ€œThis service work is Fine in Visual studio,โ€ see VS. I can communicate with the server through the client (in the same solution in VS with the service). The client can call the service, as well as the service can call the client, as well as work (any calculations, callbacks, database actions, etc.).

But when I publish this service, which itself does the work in VS, in IIS, which does not work normally (even on my own computer). This means Client can create service object and connect to that IIS Hosted Service , but when servicing a clientโ€™s call, there are no events (calculation, callback, database actions) and Service also don't call Client's .

I do not understand if any step of my code had an error that should happen at runtime in VS. So there must be something I missed, like security config, client side config or something else

+4
source share
3 answers

Perhaps the firewall is blocking port 1408

+2
source

First of all, Duplex is bad (very bad), but I'm not going to talk about it since you decided to use it.

The main problem that I see is security . I am sure that the windows log window will tell you stories about this - just check for errors in the security log. By default, IIS application pools cannot communicate with other machines. You did not mention that you specifically did something with this, so I assume that this is all by default. Just change the application pool identifier to admin (which you think is not recommended for production) and I think you will see that your problem goes away - I just think.


OFF-TOPIC: WHY DUPLEX NEEDED

  • With a server trying to establish a connection with a client, it greatly reduces the scalability of the service. In fact, if the client has a poor connection or ... the connection to the server can be there until it expires during this time, all resources destined for this call will be blocked, so they will be lost.
  • The client machine specification and connection may affect service performance.
  • For the server, confidence is usually made that it is available. If the client is behind a firewall or NAT, they cannot communicate with the server. [ THIS IN FACT MAY BE YOUR PROBLEM ].
  • So, if you open the client for the server, this means that the client can also be accessible to the whole world. Security issues for servers are generally good, but clients that they ignore now require a number of things to consider.
  • And there is more ... but that should be enough.

+2
source

can you open http: // localhost: 1408 / SmsSrevice.svc in your browser? If not check your IIS configuration. http://msdn.microsoft.com/en-us/library/ms733766.aspx

0
source

All Articles