I have a WCF Service published to a site I am working on right now. Here is the development URL for the service: https://aspireportal.azurewebsites.net/BridgeService.svc
When I try to connect to the service using the Wcf Test Client, I get back the following error.
Error: Cannot obtain Metadata from https://aspireportal.azurewebsites.net/BridgeService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: https://[redacted no longer needed]/BridgeService.svc Metadata contains a reference that cannot be resolved: 'https://[redacted no longer needed]/BridgeService.svc'. An error occurred while making the HTTP request to https://[redacted no longer needed]/BridgeService.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 hostHTTP GET Error URI: https://[redacted no longer needed]/BridgeService.svc There was an error downloading 'https://[redacted no longer needed]/BridgeService.svc'. 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
For reference, here is the relevant portion of my web.config file
<services>
<service name="OnePortal.BridgeService">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="OnePortal.IBridgeService"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAddressVerify">
<security mode="Transport" />
</binding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="[redacted by post]"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAddressVerify"
contract="AddressService.IAddressVerify" name="BasicHttpBinding_IAddressVerify" />
</client>
And here are my service and classes.
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
[ServiceContract]
public interface IBridgeService
{
[OperationContract]
BridgeResponse AcceptBridgeRequest(BridgeRequest request);
}
[DataContract]
public class BridgeRequest
{
[DataMember]
public string AcordXML { get; set; }
[DataMember]
public string Vendor { get; set; }
}
[DataContract]
public class BridgeResponse
{
[DataMember]
public string ResponseXML { get; set; }
[DataMember]
public bool HasError { get; set; }
[DataMember]
public string ErrorMessage { get; set; }
}
public class BridgeService : IBridgeService
{
public BridgeResponse AcceptBridgeRequest(BridgeRequest request)
{
return new BridgeResponse
{
HasError = false,
ErrorMessage = string.Empty,
ResponseXML = xml_response.OuterXml
};
}
}
As you can see, all the classes are decorated appropriate, that I can tell. This kind of feels like the whole TLS1.2 thing that messed with everyone last year, but I seem to recall the error messages for that being more explicit about the TLS connection (unless I am mistaken.)
It is my hope that a fresh set of eyes can see what I am missing. TIA!!
Ok so, its late and my brain isn't fully functional. I just whipped up a project, added the service reference, and it worked great. I think, possibly, this is the TLS1.2 thing and now that I think about I seem to recall that the WCF Test Client was maybe not super compliant with the new protocol.
I should have done this test before making my post.