Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a service with the following binding:

<bindings>
  <mexHttpsBinding>
    <binding name="MetadataHTTPSBinding" />
  </mexHttpsBinding>
  <basicHttpsBinding>
    <binding name="BasicHTTPSBinding" maxBufferPoolSize="2147483646" maxBufferSize="2147483646" maxReceivedMessageSize="2147483646" messageEncoding="Mtom" />
  </basicHttpsBinding>
</bindings>
<services>
  <service name="MyNameSpace.PDFGenerator">
    <endpoint address="" binding="basicHttpsBinding" bindingConfiguration="BasicHTTPSBinding" name="DataEndpoint" contract="MyNameSpace.IPDFGenerator" />
  </service>
</services>

Whenever I use the WCF Test client, the service adds fine. Whenever I visit the service URL in IE, it is not displaying in errors or warnings about the certificate not being trusted. However, I am still getting a problem whenever I try to add the service within visual studio in the Add Service Reference dialog.

There was an error downloading 'baseurl/services/PDFGenerator.svc/_vti_bin/ListData.svc/$metadata'. The underlying connection was closed: An unexpected error occurred on a send. 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: 'baseurl/services/PDFGenerator.svc'. An error occurred while making the HTTP request to baseurl/services/PDFGenerator.svc. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server. The underlying connection was closed: An unexpected error occurred on a send. 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 If the service is defined in the current solution, try building the solution and adding the service reference again.

share|improve this question
    
If you change the bindings to http what happens? –  Jay Jun 25 '13 at 19:49

1 Answer 1

up vote 0 down vote accepted

It turns out I had to change the URL when adding the service. I was doing the following

myservername/services/PDFGenerator.svc

but it needed to be

myservername.mycompany.com/services/PDFGenerator.svc

I don't understand why it needed that to work properly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.