WCF Configuration

WCF Configuration

Old forum URL: forums.lhotka.net/forums/t/4333.aspx


Lee posted on Tuesday, February 12, 2008

Dear All,

I am trying to call WCF Service in localhost from win forms , same route with PTTracker sample.     It is  CAB/SCSF projects and service  is a seperate assembly which uses http://localhost/JunoWcfService/JunoService.svc , and  all other win form modules communicate with server http://localhost/WcfHost/WcfPortal.svc via WCF channel. and most of them uses service assembly.

Each Web.config is same with PTTracker sample and WCF channel works fine,but WCF service is not working. The client app.config is as follows :

 <system.serviceModel>
  <bindings>
   <wsHttpBinding>
    <binding name="WSHttpBinding_IJunoService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false"  hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
     <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
     <security mode="Message">
      <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
      <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
     </security>
    </binding>
   </wsHttpBinding>
  </bindings>
  <client>
    
   <endpoint address="http://localhost:50746/JunoWcfService/JunoService.svc"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IJunoService"
                contract="IJunoService"
                name="WSHttpBinding_IJunoService">
    <identity>
     <userPrincipalName value="Rainman-PC\Rainman" />
    </identity>
   </endpoint>    
   
   <endpoint name="WcfDataPortal"
        address="
http://localhost:50858/WcfHost/WcfPortal.svc"
        binding="wsHttpBinding"
        contract="Csla.Server.Hosts.IWcfPortal" />
     </client>
 </system.serviceModel> 

As seen, I cut client endpoint section from app.config, which generated by VS.NET of my seperate WCF client assembly and added it to main exe's app.config. But I don't know this is fine which has   2 endpoint with diffrent .svc file. 

 Following is the method of client.

         public AnalysisRqst GetDiagnosis(AnalysisRqst analyRqst)
        {

            // here, always failed due to endpoint
            System.ServiceModel.ChannelFactory<JunoService.IJunoService> factory =
                 new System.ServiceModel.ChannelFactory<JunoService.IJunoService> ("WSHttpBinding_IJunoService");

            // tried this code but still same error

            // System.ServiceModel.ChannelFactory<JunoService.IJunoService> factory =
            //     new System.ServiceModel.ChannelFactory<JunoService.IJunoService> ("WSHttpBinding_IJunoService",
                // new EndpointAddress("http://localhost:50746/JunoWcfService/JunoService.svc"));

            AnalyRqstData resultData;
            AnalyRqstData rqstData = new AnalyRqstData();

           // lots of code goes here

         }

The error message is as follows :

Service 'JunoService.IJunoService' has zero application (non-infrastructure)
endpoints. This might be because no
configuration file was found for your
application, or because no service element matching the service name could be
found in the configuration file, or because no endpoints were defined in the
service element

I read many related threads of here and through google, but no success to figure out.

Any advice would be highly appreciated.

RGDS

HK.Lee

 

 

 

Lee replied on Wednesday, February 13, 2008

Never mind. I fixed error.

It looks like wrong Typing or another space or case sensitive chracter or something blabla that I didn't recognized in App.Config. I made another small test project and succeeded , so just copied appConfig and paste in exe.s config and problem has gone, but I lost many hours to settle. Really makes me fool.

RGDS

HK.Lee

 

 

 

Copyright (c) Marimer LLC