我的任务是使用更新的WCF服务更新旧的WSE 3.0 amsx服务,看起来我已经将旧服务的签名/ wsdl欺骗得足够好但我可以&#39 ;似乎在右边设置了安全配置。
我当然没有WSE向导,但我确实找到了与"查询"相关的wse3政策文件条目。服务我更新:
<extensions>
<extension name="usernameOverTransportSecurity"
type="Microsoft.Web.Services3.Design.UsernameOverTransportAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader"
type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="mutualCertificate11Security" type="Microsoft.Web.Services3.Design.MutualCertificate11Assertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="x509" type="Microsoft.Web.Services3.Design.X509TokenProvider, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="Inquiry">
<usernameOverTransportSecurity />
<!--requireActionHeader /-->
</policy>
...
基于this msdn resource我应该可以使用自定义绑定来模仿wse安全性,这是我当前的web.config:
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="portName" type="CustomWsdlExtension.PortNameWsdlBehaviorExtension, TT_Demo3"/>
</behaviorExtensions>
</extensions>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="customPortName12">
<portName name="InquirySoap12"/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="OnePointTwo">
<security authenticationMode="UserNameOverTransport" />
<textMessageEncoding messageVersion="Soap12WSAddressingAugust2004" />
<httpsTransport/>
</binding>
</customBinding>
</bindings>
<services>
<service name="TT_Demo3.Inquiry">
<endpoint address=""
binding="customBinding"
bindingConfiguration="OnePointTwo"
contract="InquirySoap"
behaviorConfiguration="customPortName12"
name="InquirySoap12"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
我得到的错误是 无法找到与绑定CustomBinding的端点的方案https匹配的基地址。已注册的基地址方案为[http]。
我已经看到很多针对此类问题的修复,即在绑定中添加<security mode="transport" />
元素,但CustomBinding似乎不支持此功能。
有什么想法吗?提前谢谢。