I am having a problem where I cannot add a service link in Visual Studio 2010 through a URL.
I have a HOST file setup to allow http://mydomain.com locally and set up a web.config file to link to this url. However, when I go to add a link to the service at the URL, I get the following error:
Metadata contains a reference that cannot be resolved: 'http://mydomain.com/myservice.svc?wsdl'. The WSDL document contains links that could not be resolved. There was an error downloading 'http://mydomain.com/myservice.svc?xsd=xsd0'. The underlying connection was closed: An unexpected error occurred on a receive. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host Metadata contains a reference that cannot be resolved: 'http://mydomain.com/myservice.svc'. There was no endpoint listening at http://mydomain.com/myservice.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found.
Other URLs work fine: http://mydomain.com/myservice.svc?wsdl and http://mydomain.com/myservice.svc
Here is my web.config file:
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <services> <service name="FuncWS.Email" behaviorConfiguration="ServiceType" > <endpoint address="myservice.svc" binding="webHttpBinding" contract="FuncWS.IEmail"></endpoint> <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" /> <host> <baseAddresses> <add baseAddress="http://mydomain.com"/> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceType"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
wcf
Clarence klopfstein
source share