0
votes

I have created an ASP.NET web application that contains a WCF Service. I have successfully tested this application locally. In addition, I can successfully use my WCF service. I then deployed it to my remote IIS 7 web server which has an HTTPS binding setup. I don't know if that makes a difference.

When I attempt to access the svc file in my browser (via something like https://www.mydomain.com/myService.svc), I see the service description page. However, when I attempt to execute my operation through the browser (like https://www.mydomain.com/myService.svc/Test) I get a 404 error. The only thing my "Test" operation does is return "Hello World" as shown here:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceBehavior(IncludeExceptionDetailInFaults = false)]
[ServiceContract]
public class MyService
{
  [OperationContract]
  [WebGet(UriTemplate = "/Test", ResponseFormat = WebMessageFormat.Json)]
  public string Test()
  {
    return "Hello World";
  }
}

In an attempt to diagnose the problem further, I created a new ASP.NET web application. In this new application, I attempted to add a new service reference to "https://www.mydomain.com/myService.svc". When I do this, I get a long error message that says:

The document at the url https://www.mydomain.com/myService.svc was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'. - Report from 'https://www.mydomain.com/myService.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'. - Report from 'DISCO Document' is 'There was an error downloading 'http://computername.com/myService.svc?disco'.'. - The request failed with HTTP status 502: Fiddler - DNS Lookup Failed. - Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'. Metadata contains a reference that cannot be resolved: 'https://www.mydomain.com/myService.svc'. There was no endpoint listening at https://www.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. If the service is defined in the current solution, try building the solution and adding the service reference again.

What am I doing wrong? Thank you!

1

1 Answers

0
votes

Ah ha! The problem was I did not have "bindingConfiguration="SSL"" in my configuration on the deployment server. Added that and everything is peachy.

Thank s for your help!