在Web服务器上启用HTTPS后,还需要执行一些额外的步骤,以使应用程序能够完全使用HTTPS。 步骤详细如下。
- 更新MedicalViewerService的web.config文件。 进行以下更改:
a. 将安全信息添加到<webHttpBinding>标签。
原版的:
<webHttpBinding>
<binding name="HandleLargeData" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
更改后:
<webHttpBinding>
<binding name="HandleLargeData" maxReceivedMessageSize="2147483647">
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
<binding name="wsHttpEndpointBinding">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
突出显示的行设置了支持HTTPS的服务。
b. 使用新的bindingConfiguration属性更新每个端点声明(Leadtools.Medical.Web Viewer.Wcf.Annotations Service除外),如下所示:
<service
name="Leadtools.Medical.WebViewer.Wcf.PatientAccessRightsService"
behaviorConfiguration="WebViewerServiceBehavior">
<endpoint
address=""
binding="webHttpBinding"
bindingConfiguration="wsHttpEndpointBinding"
contract="Leadtools.Medical.WebViewer.ServiceContracts.IPatientAccessRightsService"
behaviorConfiguration="WebViewerServiceBehavior">
</endpoint>
</service>
这个告诉服务使用上面指定的配置。
-
更新MedicalViewerService中的所有.svc文件以删除Factory属性。
原版:
<% @ServiceHost Language=C# Debug="true" Factory="System.ServiceModel.Activation.WebServiceHostFactory" Service="Leadtools.Medical.WebViewer.Wcf.ArchiveQueryService" CodeBehind="ArchiveQueryService.cs"%>
更改后:
<% @ServiceHost Language=C# Debug="true" Service="Leadtools.Medical.WebViewer.Wcf.AnnotationsService" CodeBehind="AnnotationsService.cs"%>
黄色背景的属性被去掉了.
-
更新MedicalViewer / Members目录中的WebViewer.aspx文件以指向jquery的HTTPS版本。
<link href=https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css rel="stylesheet" type="text/css"/> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
The highlighted portions have been changed from "http" to "https".