![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | problem running visual studio 2005 WCF example Hello, I copy pasted the example of visual studio for creating a simple service and client in c# for WCF. When I try to run it, I have the line: Service1Client client = new Service1Client(); it throws the following exception: Could not find default endpoint element that references contract '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 contract could be found in the client element. Here is the config file of the client: <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService1" 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:8080/service1" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1" contract="IService1" name="WSHttpBinding_IService1"> <identity> <userPrincipalName value="drors@prosight.com" /> </identity> </endpoint> </client> </system.serviceModel> </configuration> Does anyone know what might be the problem? (The service seems to be fine, since I can run it. I think the problem is in the client) -- dshemesh |
My System Specs![]() |
| | #2 (permalink) |
| | Re: problem running visual studio 2005 WCF example I am having a similar problem. The service was working previously. However, I had changed the namespaces on the service. When I add a service reference it seems to be drawing from some cache and selecting "Update Service Reference" does not seem to refresh this cache. This is my ErrorReportingService.svc file: <%@ ServiceHost language="c#" Debug="true" Service="EventService.Services.ErrorReportingService" %> In my project (HealthMonitoring), I add a reference to the virtual directory of the .svc file at http://localhost/EventService/ErrorReportingService.svc, calling it ErrorReporting, which results in the following ErrorReporting.map file: <?xml version="1.0" encoding="utf-8"?> <ServiceReference> <ProxyGenerationParameters ServiceReferenceUri="http://localhost/EventService/ ErrorReportingService.svc" Name="ErrorReporting" NotifyPropertyChange="False" UseObservableCollection="False"> </ProxyGenerationParameters> <EndPoints> <EndPoint Address="MyMachineNameHere/EventService/ErrorReportingService.svc" BindingConfiguration="WSHttpBinding_IErrorReportingService" Contract="EventService.HealthMonitoring.ErrorReporting.IErrorReportingService" > </EndPoint> </EndPoints> </ServiceReference> Why does it add the HealthMonitoring namespace? Shouldn't the contract reference the ErrorReportingService? This extra namespace is causing a problem in the generated .cs client. I can go manually erase all the HealthMonitoring namespaces in the proxy, but that seems to defeat the point of auto-generating the code. Since I had this working before, I think the problem was introduced when I changed the namespaces. Is there a cache problem I'm missing here? (I have already deleted all temp .asp files in all of their locations, so I don't think it is those files.) Thanks |
My System Specs![]() |
| | #3 (permalink) |
| | Re: problem running visual studio 2005 WCF example Make sure that the configuration in the app.config file is present in the *.exe.config file in the directory (debug or release) you are running the client executable. "dshemesh" <dshemesh@discussions.microsoft.com> wrote in message news:FEB90DA5-223C-4F4E-82FD-1E236C46DA94@microsoft.com... > Hello, > I copy pasted the example of visual studio for creating a simple service > and > client in c# for WCF. > > When I try to run it, I have the line: > Service1Client client = new Service1Client(); > > it throws the following exception: > Could not find default endpoint element that references contract > '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 contract could be found in the client element. > > Here is the config file of the client: > <configuration> > <system.serviceModel> > <bindings> > <wsHttpBinding> > <binding name="WSHttpBinding_IService1" > 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:8080/service1" > binding="wsHttpBinding" > bindingConfiguration="WSHttpBinding_IService1" > contract="IService1" > name="WSHttpBinding_IService1"> > <identity> > <userPrincipalName value="drors@prosight.com" /> > </identity> > </endpoint> > </client> > </system.serviceModel> > </configuration> > > Does anyone know what might be the problem? (The service seems to be fine, > since I can run it. I think the problem is in the client) > > -- > dshemesh |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Visual Studio 2005 | Vista General | |||
| Problem installing Microsoft Visual Studio 2005 | Software | |||
| SOS! visual studio 2005 problem! | Vista General | |||
| Installing Visual Studio 2005 Std Ed, SQL Server 2005 Expr./Compac | Vista installation & setup | |||
| Visual Studio 2005 | Vista General | |||