Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

problem running visual studio 2005 WCF example

 
 
Thread Tools Display Modes
Old 05-17-2007   #1 (permalink)
dshemesh
Guest


 

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
Old 05-21-2007   #2 (permalink)
jasonrawlins@gmail.com
Guest


 

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

Old 05-21-2007   #3 (permalink)
Scott Holman
Guest


 

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



 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOS! visual studio 2005 problem! ½ªÊ¿³É Vista General 2 12-26-2007 10:46 AM
Installing Visual Studio 2005 Std Ed, SQL Server 2005 Expr./Compac Stéphane Vista installation & setup 4 04-28-2007 11:20 AM
Visual Studio 2005 Jordan Vista General 1 02-21-2007 10:22 PM
PowerShell from Visual Studio 2005 Ivan Mckenzie PowerShell 4 02-21-2007 01:31 PM
Re: Visual Studio 2005 Vista 5308 Tester Vista General 0 04-01-2006 04:57 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50