开发者

HTTPS WCF Basic HttpBindings getting HTTP 403

开发者 https://www.devze.com 2023-04-09 15:27 出处:网络
I have an HTTPS webserver on WCF hosted under IIS 7.5. I have set the SSL settings to require SSL and ignore client certificates.

I have an HTTPS webserver on WCF hosted under IIS 7.5. I have set the SSL settings to require SSL and ignore client certificates.

When I try to add the web reference in Visual Studio, I get the following error. How do I fix this problem?

I can see that it's trying to request ?disco using HTTP instead of HTTPS. I think this is the problem, but I am not sure how to address this.

The document at the url https://testserver/service1.svc?wsdl was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://testserver/service1.svc?disco'.'.

- The request failed with HTTP status 403: Forbidden.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Repor开发者_如何学JAVAt from 'https://testserver/service1.svc?wsdl' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.


Since you're able to get the WSDL through your web browser, a possible issue might be with hosting the service in IIS and configuring site bindings. It was a known issue on the forums some time ago, check out these links:

  • Problem in consuming hosted WCF service

  • HOWTO: Fix WCF Host Name on IIS

Good luck!


I had to disable Require SSL to get it to work. I am not sure why disco goes to do an HTTP when the WSDL URL you provide is HTTPS.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号